List and search roles
Request to list roles:
GET /api/v2/roles.json
Example of response:
{
"roles": [{
"role_id": "546340bf-8b47-21e4-95a4-e03f497dbd55",
"tenant_id": "156340bf-8b47-21e4-95a4-e03f497dbd44",
"name": "Administrator",
"access_level": "system",
"permissions": {
"users": ["view", "add", "edit", "delete"],
"calls": ["view", "playback", "categorize", "on_demand_trigger", "delete"],
...
},
...
},{
"role_id": "e011c408-f288-11e4-9b73-e03f497dbdff",
"tenant_id": "156340bf-8b47-21e4-95a4-e03f497dbd44",
"name": "Agent",
"access_level": "user",
"permissions": {
"calls_own": ["view", "playback", "categorize", "on_demand_trigger"],
...
},
...
}],
"total": 2,
"next_url": null
}
Each item is a complete role object. See Collections for paging.
Search roles
| Parameter | Description |
|---|---|
search_term |
Search by role name, and by tenant name in multi-tenant deployments. Partial match, case insensitive. |
tenant_id |
Filter by tenant ID. |
Example with several parameters:
GET /api/v2/roles.json?tenant_id=2bfcefd4-f41d-11e4-983d-e03f497dbdff&search_term=Agent
Response contains HTTP status code as shown in the following table.
| Response | Description |
|---|---|
| 200 OK | The list of roles is returned in the response body |
| 403 Forbidden | The request cannot be completed because API user has no permission to view roles |
| 404 Not Found | The tenant_id parameter is not a valid UUID |