Skip to main content
POST
/
v1
/
roles
Create a custom role
curl --request POST \
  --url http://localhost:3333/v1/roles \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "Compliance Lead",
  "permissions": {
    "control": [
      "read",
      "update"
    ],
    "policy": [
      "read",
      "update",
      "publish"
    ],
    "risk": [
      "read"
    ]
  }
}
'
{
  "id": "rol_abc123",
  "name": "compliance-lead",
  "permissions": {},
  "isBuiltIn": false,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json
name
string
required

Name of the custom role

Required string length: 2 - 50
Example:

"Compliance Lead"

permissions
object
required

Permissions for the role. Keys are resource names, values are arrays of allowed actions.

Example:
{
"control": ["read", "update"],
"policy": ["read", "update", "publish"],
"risk": ["read"]
}

Response

Role created successfully

id
string
Example:

"rol_abc123"

name
string
Example:

"compliance-lead"

permissions
object
isBuiltIn
boolean
Example:

false

createdAt
string<date-time>
updatedAt
string<date-time>