---
title: "List Discord guild roles"
method: GET
path: "/v1/discord/guilds/{guildId}/roles"
tags: ["Discord"]
---

# List Discord guild roles

`GET /v1/discord/guilds/{guildId}/roles`

Returns all roles in a Discord guild. Useful for building role-mention
pickers, role-permission UIs, or finding the role ID before calling
the role-assign endpoint.

Roles are returned unordered. Sort client-side by `position` if you
need Discord's UI ordering.

Caller must pass `accountId` of a Discord SocialAccount bound to this
guild (route verifies team access + guild match).

## Path parameters

- `guildId` string, required

## Query parameters

- `accountId` string, required

## Response `200`

List of guild roles.

- object
  - `data` object[]
    - `id` string — Role snowflake ID
    - `name` string
    - `color` integer — Decimal color (0 = no color). Convert to hex via .toString(16).
    - `position` integer — Position in role hierarchy (higher = more authority)
    - `permissions` string — Permissions bitfield as a stringified integer
    - `managed` boolean — True for integration-managed roles (bot roles)
    - `mentionable` boolean
    - `hoist` boolean — True if role is displayed separately in member list

## Other responses

- `400` — Invalid accountId or guildId format.
- `401` — Unauthorized
- `403` — Discord refused the request (bot lacks View Channels permission in the guild).
- `404` — Discord account not found, not accessible, or not bound to this guild.
- `502` — Discord was unreachable or returned an unclassified error.

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) · [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/1c23a639830f?raw)
