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

# Get roles

`GET /api/roles`

Get roles with filters and pagination.

## Query parameters

- `excludeUserId` string
- `excludeApplicationId` string
- `type` 'User' | 'MachineToMachine'
- `page` integer
- `page_size` integer
- `search_params` object

## Response `200`

An array of roles matching the filters.

- object[]
  - `tenantId` string, required
  - `id` string, required
  - `name` string, required
  - `description` string, required
  - `type` 'User' | 'MachineToMachine', required
  - `isDefault` boolean, required
  - `usersCount` number, required
  - `featuredUsers` object[], required
    - `id` string, required
    - `avatar` string, nullable, required
    - `name` string, nullable, required
  - `applicationsCount` number, required
  - `featuredApplications` object[], required
    - `id` string, required
    - `name` string, required
    - `type` 'Native' | 'SPA' | 'Traditional' | 'MachineToMachine' | 'Protected' | 'SAML', required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/revisions/a163dc77d842/schema)
