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"
}'
const axios = require('axios');
const { data } = await axios.post('https://api.example.com/roles', {
name: 'Editor',
description: 'Can edit and publish content',
scopeId: 'scope_123',
}, {
headers: { 'Authorization': 'Bearer YOUR_TOKEN' },
});
{
"id": "role_456",
"name": "Editor",
"description": "Can edit and publish content",
"scopeId": "scope_123"
}
Roles
Create Role
Create a new role within a scope
POST
/
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"
}'
const axios = require('axios');
const { data } = await axios.post('https://api.example.com/roles', {
name: 'Editor',
description: 'Can edit and publish content',
scopeId: 'scope_123',
}, {
headers: { 'Authorization': 'Bearer YOUR_TOKEN' },
});
{
"id": "role_456",
"name": "Editor",
"description": "Can edit and publish content",
"scopeId": "scope_123"
}
Request Body
string
required
Display name for the role
string
Description of the role’s purpose
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"
}'
const axios = require('axios');
const { data } = await axios.post('https://api.example.com/roles', {
name: 'Editor',
description: 'Can edit and publish content',
scopeId: 'scope_123',
}, {
headers: { 'Authorization': 'Bearer YOUR_TOKEN' },
});
{
"id": "role_456",
"name": "Editor",
"description": "Can edit and publish content",
"scopeId": "scope_123"
}
Was this page helpful?
⌘I