Skip to Content
Members and roles

Create a custom role

Permissionroles:createRetriesIdempotency-Key requiredAuthentication
POST
/roles

Creates a role from the closed RBAC vocabulary. Permissions are canonicalized and cannot exceed the caller's effective permissions. System-role names are reserved.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Header Parameters

Idempotency-Key*string

Required. Reuse the same key to retry this write safely. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255

Request Body

application/json
  1. body
name*string
Length1 <= length <= 120
description?string
Lengthlength <= 1000
permissions*array<>
Itemsitems <= 256

Response Body

Created custom role.

application/json
  1. response
id*string
Formatuuid
name*string
Length1 <= length <= 120
description*string
Lengthlength <= 1000
is_system*boolean
is_locked*boolean
permissions*array<>
Itemsitems <= 256
member_count*integer
Formatint64
Range0 <= value
version*integer
Formatint64
Range1 <= value
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.kejue.co/v1/roles' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "permissions": [    "string"  ]}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "description": "string",  "is_system": true,  "is_locked": true,  "permissions": [    "string"  ],  "member_count": 0,  "version": 1,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}