curl -X GET 'https://api.example.com/roles/by-scope/scope_123' \
-H 'Authorization: Bearer YOUR_TOKEN'
const axios = require('axios');
const { data } = await axios.get('https://api.example.com/roles/by-scope/scope_123', {
headers: { 'Authorization': 'Bearer YOUR_TOKEN' },
});
[
{
"id": "role_1",
"name": "Admin",
"description": "Full administrative access",
"scopeId": "scope_123"
},
{
"id": "role_2",
"name": "Viewer",
"description": "Read-only access",
"scopeId": "scope_123"
}
]
Roles
Get Roles by Scope
Retrieve all roles defined within a specific scope
GET
/
roles
/
by-scope
/
{scopeId}
curl -X GET 'https://api.example.com/roles/by-scope/scope_123' \
-H 'Authorization: Bearer YOUR_TOKEN'
const axios = require('axios');
const { data } = await axios.get('https://api.example.com/roles/by-scope/scope_123', {
headers: { 'Authorization': 'Bearer YOUR_TOKEN' },
});
[
{
"id": "role_1",
"name": "Admin",
"description": "Full administrative access",
"scopeId": "scope_123"
},
{
"id": "role_2",
"name": "Viewer",
"description": "Read-only access",
"scopeId": "scope_123"
}
]
Path Parameters
string
required
The scope ID to get roles for
Response
Returns an array of role objects belonging to the specified scope.array
curl -X GET 'https://api.example.com/roles/by-scope/scope_123' \
-H 'Authorization: Bearer YOUR_TOKEN'
const axios = require('axios');
const { data } = await axios.get('https://api.example.com/roles/by-scope/scope_123', {
headers: { 'Authorization': 'Bearer YOUR_TOKEN' },
});
[
{
"id": "role_1",
"name": "Admin",
"description": "Full administrative access",
"scopeId": "scope_123"
},
{
"id": "role_2",
"name": "Viewer",
"description": "Read-only access",
"scopeId": "scope_123"
}
]
Was this page helpful?
⌘I