Reference

Guide

/api/roles

List roles

GET: /api/roles

Query parameters

Parameter Example Description
limit ?limit=5 Limits the number of returned roles.
offset ?offset=10 Sets a manual offset. Use the page option together with limit for easier pagination.
page ?page=2 Starts the collection at the given page. Only works when the limit is set.
pretty ?pretty=true Pretty prints the result. Only useful for debugging.
select ?select=id,title Defines the fields that will be returned for each role.

Role fields

The following fields are available in the role model and can be fetched with the select parameter:

  • description
  • name
  • permissions
  • title

Example response

GET: /api/roles
{
    "code": 200,
    "data": [
        {
            "description": "The admin has all rights",
            "name": "admin",
            "title": "Admin"
        },
        {
            "description": "Editors edit stuff",
            "name": "editor",
            "title": "Editor"
        }
    ],
    "pagination": {
        "page": 1,
        "total": 2,
        "offset": 0,
        "limit": 100
    },
    "status": "ok",
    "type": "collection"
}