Skip to main content
Skip table of contents

List of administrator roles

Getting the list of administrator roles

GET /api/admin/v1/roles

Method parameters

int per_page, number of items per pagination page. Default is 25


string type, role type


int exclude, array of role IDs to exclude


bool permissions, include permissions in the role object


int page, pagination page number

200 OK

Successful response

JSON
{
    "data": [
        {
            "id": 7,
            "name": "admin",
            "type": "admin",
            "type_pretty": "Administrator",
            "created_at": "2022-03-18 14:41:00",
            "updated_at": "2022-03-18 14:41:00"
        },
        {
            "id": 6,
            "name": "admin",
            "type": "admin",
            "type_pretty": "Administrator",
            "created_at": "2021-12-15 19:45:12",
            "updated_at": "2021-12-15 19:45:12"
        },
        {
            "id": 5,
            "name": "admin",
            "type": "admin",
            "type_pretty": "Administrator",
            "created_at": "2021-10-27 21:01:19",
            "updated_at": "2021-10-27 21:01:19"
        },
        {
            "id": 4,
            "name": "admin",
            "type": "admin",
            "type_pretty": "Administrator",
            "created_at": "2021-06-03 19:29:23",
            "updated_at": "2021-06-03 19:29:23"
        },
        {
            "id": 2,
            "name": "admin",
            "type": "admin",
            "type_pretty": "Administrator",
            "created_at": "2021-06-02 17:51:34",
            "updated_at": "2021-06-02 18:53:42"
        },
        {
            "id": 1,
            "name": "admin",
            "type": "admin",
            "type_pretty": "Administrator",
            "created_at": "2021-06-02 17:41:21",
            "updated_at": "2021-06-02 17:41:21"
        }
    ],
    "links": {
        "first": "https://vms.local/api/admin/v1/roles?type=admin&page=1",
        "last": "https://vms.local/api/admin/v1/roles?type=admin&page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "pagination.previous",
                "active": false
            },
            {
                "url": "https://vms.local/api/admin/v1/roles?type=admin&page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "pagination.next",
                "active": false
            }
        ],
        "path": "https://vms.local/api/admin/v1/roles",
        "per_page": 25,
        "to": 6,
        "total": 6
    }
}

401 Unauthorized

Authorization token is not provided or is invalid. Obtaining a token

cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/admin/v1/roles' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "per_page": 0,
    "type": "string",
    "exclude": 0,
    "permissions": true,
    "page": 0
}'
PHP
PHP
$data = array (
  'per_page' => 0,
  'type' => 'string',
  'exclude' => 0,
  'permissions' => true,
  'page' => 0,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'GET',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/admin/v1/roles', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.