Create Role

Create a custom role for the organization.

Set role_type to scope where the role applies once assigned to a user: account (the default) grants access on the specific account(s) it’s assigned to, while organization grants that same access across every account in the organization, including accounts created later.

POST/organizations/roles

Create a custom role for the organization.

Body application/json

namestringrequired
descriptionstring
permission_idsstring[]
testing_permission_idsstring[]
role_type"account" | "organization"

Response

Created

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

Bad Request - Duplicate name or validation failure

Request
curl -X POST "https://api-sandbox.whitelabel.com/v1/organizations/roles" \
  -H "Content-Type: application/json" \
  -H "PUBLIC-API-KEY: <PUBLIC-API-KEY>" \
  -H "PRIVATE-SECRET-KEY: <PRIVATE-SECRET-KEY>" \
  -d '{
  "name": "Operator",
  "description": "Custom operator",
  "permission_ids": [],
  "testing_permission_ids": [],
  "role_type": "account"
}'
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"
}