---
title: "Create a Discord guild role"
method: POST
path: "/v1/discord/guilds/{guildId}/roles"
tags: ["Discord"]
---

# Create a Discord guild role

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

Creates a new role in the guild.

Requires the bot to hold the Manage Roles permission. Guilds that added the Zernio bot
before role management shipped must re-invite it, because Discord applies the
permission set at invite time.

Discord's role hierarchy applies: the bot cannot create a role positioned at or above
its own highest role, and cannot grant permissions it does not itself hold. Either
attempt returns a 403 carrying Discord's own error.

## Path parameters

- `guildId` string, required

## Query parameters

- `accountId` string, required

## Request body

- object
  - `name` string, required
  - `color` integer — Decimal color (0 = no color). 0xFF0000 red is 16711680.
  - `hoist` boolean — Display members with this role separately in the member list
  - `mentionable` boolean — Allow anyone to @mention this role
  - `permissions` string — Permissions bitfield as a stringified integer

## Response `201`

Role created.

- object
  - `data` DiscordRole — A Discord guild role, returned verbatim from Discord's API.
    - `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, guildId, or role body.
- `401` — Unauthorized
- `403` — Discord refused the action (bot lacks Manage Roles, or the new role would sit at or above the bot's highest role).
- `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)
