Skip to content

View one role

Request:

GET /api/v2/roles/<role-id>.json

The response is the complete role object, including the full permissions dictionary. Use this request on a reference role to discover the resource and action names supported by your version of MiaRec.

Example of response:

{
    "role": {
        "role_id": "546340bf-8b47-21e4-95a4-e03f497dbd55",
        "tenant_id": "156340bf-8b47-21e4-95a4-e03f497dbd44",
        "name": "Supervisor",
        "access_level": "managed_groups",
        "permissions": {
            "rest_api": ["allow"],
            "users": ["view"],
            "calls": ["view", "playback", "categorize", "on_demand_trigger"],
            ...
        },
        "access_restrictions": {
            "restrict_access_by_ip": false,
            "rules": [],
            "default_rule": "deny"
        },
        "restrict_access_by_tags": false,
        "restrict_access_tags": [],
        "use_managed_roles": false,
        "managed_roles": []
    }
}

Response contains HTTP status code as shown in the following table.

Response Description
200 OK The role 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 Role with such ID does not exist, or it is outside the access scope of the API user