Update Role

Partial update of a custom role. Note that role_type is immutable — an account-scoped role cannot be converted to organization scope or vice versa. Create a new role with the desired role_type instead. See Create Role.

PATCH/organizations/roles/{role_id}

Partial update of a custom role. Note: role_type is immutable.

Path Parameters

role_idstringrequired

The unique identifier of the role.

Body application/json

namestring
descriptionstring
permission_idsstring[]
testing_permission_idsstring[]

Response

OK

idstring
namestring
descriptionstring
adminboolean
permission_idsstring[]
testing_permission_idsstring[]
role_typestring
created_atstring<date-time>
updated_atstring<date-time>

Bad Request - Validation failure

Not Found - Role not found in organization

Request
curl -X PATCH "https://api-sandbox.whitelabel.com/v1/organizations/roles/<role_id>" \
  -H "Content-Type: application/json" \
  -H "PUBLIC-API-KEY: <PUBLIC-API-KEY>" \
  -H "PRIVATE-SECRET-KEY: <PRIVATE-SECRET-KEY>" \
  -d '{
  "name": "string",
  "description": "string",
  "permission_ids": [
    "string"
  ],
  "testing_permission_ids": [
    "string"
  ]
}'
Response
{
  "id": "string",
  "name": "string",
  "description": "string",
  "admin": true,
  "permission_ids": [
    "string"
  ],
  "testing_permission_ids": [
    "string"
  ],
  "role_type": "string",
  "created_at": "1970-01-01T00:00:00.000Z",
  "updated_at": "1970-01-01T00:00:00.000Z"
}