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

# List roles

`GET /api/roles`

Retrieves a paginated list of roles in the organisation with optional search filtering.

## Query parameters

- `search` string
- `page` number
- `perPage` number

## Response `200`

Paginated list of roles

- object — Paginated list of roles
  - `results` object[], required — List of roles
    - `id` string, uuid, required — Unique identifier of the role
    - `name` string, required — Name of the role
    - `description` string, nullable — Description of the role
    - `idpGroups` string[], nullable — Identity provider groups mapped to this role
    - `allProjects` boolean, required — Whether this role applies to all projects
    - `projectPermissions` string[], nullable — List of project-level permissions granted by this role
    - `projectFilePermissions` object[], nullable — File-level permissions granted by this role
      - `id` string, nullable — Unique identifier of the file permission
      - `effect` 'allow' | 'deny', required — Permission effect (allow or deny)
      - `actions` string[], nullable — List of actions this permission applies to
      - `patterns` string, nullable — File path patterns this permission applies to
    - `groups` object[] — Groups associated with this role
      - `id` string, uuid, required — Unique identifier of the group
      - `name` string, required — Name of the group
      - `description` string, nullable — Description of the group
      - `projectId` string, uuid, required — ID of the project this group belongs to
      - `project` object — Project this group belongs to
        - `name` string — Name of the project
      - `roleId` string, uuid, nullable — ID of the role this group is associated with
    - `users` object[] — Users assigned to this role
      - `id` string, uuid, required — Unique identifier of the user
      - `email` string, email, required — Email address of the user
      - `firstName` string, nullable — First name of the user
      - `lastName` string, nullable — Last name of the user
    - `organisationId` string, uuid, required — ID of the organisation this role belongs to
    - `organisation` object — Organisation this role belongs to
      - `id` string, uuid, required — Unique identifier of the organisation
      - `name` string, required — Name of the organisation
    - `createdAt` string, required — Timestamp when the role was created
    - `updatedAt` string, required — Timestamp when the role was last updated
  - `paginate` object, required — Pagination metadata
    - `current` number, required — Current page number
    - `from` number, required — Starting record number
    - `to` number, required — Ending record number
    - `total` number, required — Total number of records
    - `pageSize` number, required — Number of records per page

---

[API](https://skmtc.dev/gorules/apis/gorules-agent-api.md) · [All operations](https://skmtc.dev/gorules/apis/gorules-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gorules/gorules-agent-api/revisions/52c0773fcd80/schema)
