Create role
Create role
client.zones.roles.create(stringzoneID, RoleCreateParams { identifier, description } body, RequestOptionsoptions?): Role { id, created_at, identifier, 4 more }
POST/zones/{zoneId}/roles
Creates a new customer-owned role in the specified zone. The owner_type is always customer; platform roles are managed by Keycard.
Parameters
zoneID: string
Returns
Create role
import KeycardAPI from '@keycardai/api';
const client = new KeycardAPI({
apiKey: process.env['KEYCARD_API_API_KEY'], // This is the default and can be omitted
});
const role = await client.zones.roles.create('zoneId', { identifier: 'identifier' });
console.log(role.id);{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "identifier",
"owner_type": "platform",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"description": "description"
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "identifier",
"owner_type": "platform",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"description": "description"
}