---
title: "List roles"
method: GET
path: "/api/v2/roles"
tags: ["Roles"]
---

# List roles

`GET /api/v2/roles`

Returns all roles, including their names and their unique identifiers.

## Query parameters

- `page[size]` integer
- `page[number]` integer
- `sort` 'name' | '-name' | 'modified_at' | '-modified_at' | 'user_count' | '-user_count' — Sorting options for roles.
- `filter` string
- `filter[id]` string

## Response `200`

OK

- RolesResponse — Response containing information about multiple roles.
  - `data` Role[] — Array of returned roles.
    - `attributes` RoleAttributes — Attributes of the role.
      - `created_at` string, date-time — Creation time of the role.
      - `modified_at` string, date-time — Time of last role modification.
      - `name` string — The name of the role. The name is neither unique nor a stable identifier of the role.
      - `receives_permissions_from` string[] — The managed role from which this role automatically inherits new permissions. Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role". If empty or not specified, the role does not automatically inherit permissions from any managed role.
      - `user_count` integer — Number of users with that role.
    - `id` string — The unique identifier of the role.
    - `relationships` RoleResponseRelationships — Relationships of the role object returned by the API.
      - `permissions` RelationshipToPermissions — Relationship to multiple permissions objects.
        - `data` RelationshipToPermissionData[] — Relationships to permission objects.
          - `id` string — ID of the permission.
          - `type` 'permissions' — Permissions resource type.
    - `type` 'roles', required — Roles type.
  - `meta` ResponseMetaAttributes — Object describing meta attributes of response.
    - `page` Pagination — Pagination object.
      - `total_count` integer — Total count.
      - `total_filtered_count` integer — Total count of elements matched by the filter.

## Other responses

- `403` — Authentication error
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/versions/da68bf029e4c/schema)
