Get Role by ID (Read-Only)

GET/api/roles/{id}

Read-only, like every roles endpoint. The response also reports how many active staff users are assigned to the role, which is what an integration needs before anybody edits it in the admin area. The serialised permissions column is only included when include_permissions is set.

Headers

FieldTypeDescription
authtoken String Authentication token, generated from admin area

Parameters

FieldTypeDescription
id Number Role unique ID
include_permissions String optional Send 1, true, yes or on to include the serialised permissions column
curl -X GET "https://yoursite.com/api/roles/123" \
  -H "authtoken: YOUR_API_TOKEN"

Success-Response:

HTTP/1.1 200 OK
{ "id": "1", "title": "Project manager", "deleted": "0", "assigned_users": 4 }

Error-Response:

HTTP/1.1 404 Not Found
{ "status": false, "messages": { "error": "No data were found" } }
MethodGET
Path/api/roles/{id}
GroupRoles
Sincev1.0.0
Defined inRestApi/Controllers/RolesController.php