Skip to content

List and search roles

List all roles:

GET /api/v2/roles.json

Example of response:

{
    "next_url": null,
    "roles": [{
        "role_id": "546340bf-8b47-21e4-95a4-e03f497dbd55",
        "tenant_id": "156340bf-8b47-21e4-95a4-e03f497dbd44",
        "name": "Administrator Role",
        "permissions": {
            "system": ["view", "edit"],
            "users": ["view", "edit", "delete"],
            "calls": ["view", "categorize", "on_demand_trigger", "delete"],
            ...
        }
    },{
        "role_id": "e011c408-f288-11e4-9b73-e03f497dbdff",
        "tenant_id": "156340bf-8b47-21e4-95a4-e03f497dbd44",
        "name": "Agent Role",
        "permissions": {
            "system": [],
            "users": ["view"],
            "calls": ["view", "categorize", "on_demand_trigger"],
            ...
        }
    }]
}

See also Paging through collections

Search roles:

  • Search by role name

    GET /api/v2/roles.json?search_term=Agent
    
  • Search by tenant id

    GET /api/v2/roles.json?tenant_id=2bfcefd4-f41d-11e4-983d-e03f497dbdff
    
  • Search by multiple parameters (tenant_id + search_term)

    GET /api/v2/roles.json?tenant_id=2bfcefd4-f41d-11e4-983d-e03f497dbdff&search_term=Agent