---
title: "Get roles"
method: GET
path: "/v1/{organization}/role/"
tags: ["Role"]
---

# Get roles

`GET /v1/{organization}/role/`

Return a list of roles in this organization.

#### Permissions
This endpoint may be impacted by the following permissions:
* Only roles that the authenticated user has the `Role:GetRole` permission on will be returned.

## Path parameters

- `organization` string, required

## Query parameters

- `return_permission_grants` boolean — Whether to return permission grants.
- `id` string[] — The IDs of the roles to retrieve.
- `name` string[] — The names of the roles to retrieve.

## Headers

- `x-mongo-cluster-name` string, nullable — The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
- `Sec-WebSocket-Protocol` string[]

## Response `200`

Succeeded

- SrcAppEndpointsRoleGetRolesResponse
  - `roles` RoleInstance[], required — A list of roles in this organization.
    - `id` string, required — The ID of the role.
    - `name` string, required — The name of the role.
    - `description` string, required — A description of the role.
    - `frontend_view` 'client' | 'admin', required
    - `permission_grants` PermissionGrantOutput[], required — The permission grants given to the role. Only returned if the `return_permission_grants` query parameter is True.
      - `permission_name` string, required — The name of the permission.
      - `conditions` object, required — A dictionary of attribute name to condition that must be met for this grant to be applicable.

## Other responses

- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — Specified organization is not found.
- `422` — Invalid request path parameter or request query parameter failed validation.
- `429` — The user has exceeded the rate limit of 20 requests per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

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