Create role
Create role
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.
Path Parameters
zoneId: string
Body ParametersJSON
identifier: string
Role identifier: a lowercase slug (letters and digits separated by single hyphens or underscores), unique per owner type within a zone. Role identifiers surface in policy evaluation, so the slug restriction keeps them unambiguous in policy text.
minLength1
maxLength255
description: optional string
Human-readable description
maxLength1000
Returns
Create role
curl https://api.keycard.ai/zones/$ZONE_ID/roles \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $KEYCARD_API_API_KEY" \
-d '{
"identifier": "identifier"
}'{
"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"
}