# List

## Get Roles

<mark style="color:blue;">`GET`</mark> `https://biometridon.polygon.pt/api/roles`

This endpoint allows you to get all existing roles.

#### Query Parameters

| Name   | Type   | Description                            |
| ------ | ------ | -------------------------------------- |
| search | string | Search field for name column           |
| sortBy | string | Pagination column order (default name) |
| order  | string | Pagination order (default asc)         |
| page   | string | Page number (default 1)                |
| limit  | string | Pagination limit (default 10)          |

#### Headers

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| Authorization | string | Authentication user token |

{% tabs %}
{% tab title="200 " %}

```bash
{
  "data": [
    {
      "name": "Admin",
      "permissions": [
        {
          "resource": "users",
          "read": true,
          "write": true,
          "delete": true
        },
        {
          "resource": "processes",
          "read": true,
          "write": true,
          "delete": true
        },
        {
          "resource": "client_settings",
          "read": true,
          "write": true,
          "delete": true
        },
        {
          "resource": "queues",
          "read": true,
          "write": true,
          "delete": true
        },
        {
          "resource": "clients",
          "read": true,
          "write": true,
          "delete": true
        },
        {
          "resource": "roles",
          "read": true,
          "write": true,
          "delete": true
        },
        {
          "resource": "steps",
          "read": true,
          "write": true,
          "delete": true
        },
        {
          "resource": "flows",
          "read": true,
          "write": true,
          "delete": true
        }
      ],
      "clientId": "5f06dd360d2a954da80c098f",
      "forAllClients": true,
      "active": true,
      "created_at": "2020-07-09T09:02:46.115Z",
      "updated_at": "2020-07-09T09:02:46.115Z",
      "id": "5f06dd360d2a954da80c0990"
    },
    {
      "name": "Agent",
      "permissions": [
        {
          "resource": "users",
          "read": false,
          "write": false,
          "delete": false
        },
        {
          "resource": "processes",
          "read": true,
          "write": true,
          "delete": false
        },
        {
          "resource": "client_settings",
          "read": true,
          "write": false,
          "delete": false
        },
        {
          "resource": "queues",
          "read": true,
          "write": true,
          "delete": false
        },
        {
          "resource": "clients",
          "read": false,
          "write": false,
          "delete": false
        },
        {
          "resource": "roles",
          "read": false,
          "write": false,
          "delete": false
        },
        {
          "resource": "steps",
          "read": true,
          "write": false,
          "delete": false
        },
        {
          "resource": "flows",
          "read": true,
          "write": false,
          "delete": false
        }
      ],
      "clientId": "5f06dd360d2a954da80c098f",
      "forAllClients": true,
      "active": true,
      "created_at": "2020-07-09T09:02:46.118Z",
      "updated_at": "2020-07-09T09:02:46.118Z",
      "id": "5f06dd360d2a954da80c0991"
    }
  ],
  "meta": {
    "message": "Success.",
    "pagination": {
      "total": 2,
      "limit": 10,
      "page": 1,
      "lastPage": 1,
      "sortBy": "id",
      "order": "asc"
    }
  },
  "status": true
}
```

{% endtab %}

{% tab title="401 " %}

```bash
{
  "data": {},
  "meta": {
    "message": "Invalid JWT signature",
    "code": "E_INVALID_JWT_TOKEN"
  },
  "status": false
}
```

{% endtab %}
{% endtabs %}
