Skip to main content
POST
/
api
/
roles
/
{id}
Edit an existing role
curl --request POST \
  --url https://api.example.com/api/roles/{id} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'organization-id: <organization-id>' \
  --data '
{
  "roleName": "admin",
  "roleDescription": "Administrator",
  "permissions": [
    {
      "subject": "subject",
      "ability": "read",
      "value": true
    }
  ]
}
'

Headers

Authorization
string
required

Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.

Example:

"Bearer bc_1234567890abcdef"

organization-id
string
required

Required if Authorization is a JWT token. The organization ID to operate within.

Path Parameters

id
number
required

Role ID

Body

application/json
roleName
string
required

The name of the role

Example:

"admin"

roleDescription
string
required

The description of the role

Example:

"Administrator"

permissions
object[]
required

The permissions of the role

Response

200

Role updated successfully