Skip to main content
POST
http://localhost:3000
/
roles
curl -X POST 'https://api.example.com/roles' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Editor",
    "description": "Can edit and publish content",
    "scopeId": "scope_123"
  }'
{
  "id": "role_456",
  "name": "Editor",
  "description": "Can edit and publish content",
  "scopeId": "scope_123"
}

Request Body

name
string
required
Display name for the role
description
string
Description of the role’s purpose
scopeId
string
required
The scope ID where this role will be defined

Response

Returns the created role object.
curl -X POST 'https://api.example.com/roles' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Editor",
    "description": "Can edit and publish content",
    "scopeId": "scope_123"
  }'
{
  "id": "role_456",
  "name": "Editor",
  "description": "Can edit and publish content",
  "scopeId": "scope_123"
}