---
title: "Returns a list of all roles"
method: GET
path: "/roles"
tags: ["roles"]
---

# Returns a list of all roles

`GET /roles`

## Request

- Base URL: `/v1` (relative, and the document’s source URL is not known)
- URL: `/v1/roles`
- Auth: API key in header `Authorization`

Returns a paginated list of all roles. By default all roles are returned, but a subset can be returned by providing offset and limit query parameters.

## Query parameters

- `limit` integer
- `offset` integer

## Response `200`

Successfully returned a json object containing a list of all roles

- object
  - `count` integer: The number of roles returned
  - `total_count` integer: The total number of roles
  - `offset` integer: The first row of resources to retrieve, starting at 0. Use this parameter as a pagination mechanism along with the limit parameter
  - `limit` integer: The number of items returned per request
  - `items` Role[]: A list of roles
    - `id` string: Unique id for a role
    - `role` string: Name of role
    - `permissions` PermissionString[]: A list of permissions associated with this role

## Other responses

- `400`: Invalid request, reasons can be one of the following: * query parameters incorrect offset provided * query parameters incorrect limit provided
- `403`: Unauthorised request, reason is: * Requestor does not have necessary permissions to access this resource
- `500`: Failed to process the request due to an internal error

---

[API](https://skmtc.dev/office-of-national-statistics/apis/permissions-api.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/permissions-api/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/permissions-api/revisions/c0050251683f?raw)
