Channels
List a server's channels, read recent messages and send a message to a channel, with a project API key.
Discord channel listing, message history, and message sending - project API key
Create a Discord category channel
/api/servers/{serverId}/categoriesCreates a category channel in the Discord server. Requires the manage_channels scope on the server. The Idempotency-Key header is required: retrying with the same key returns the cached response instead of creating it again.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
serverId | path | string | yes | Discord server ID |
Idempotency-Key | header | string | yes | Required idempotency key (up to 128 characters). A retry with the same key returns the cached response instead of creating the resource again. |
Request body (JSON, required): CreateCategoryDto schema.
Responses
| Status | Description | Body |
|---|---|---|
201 | Category created successfully. | CategoryResponseDto |
400 | Invalid category payload or missing Idempotency-Key header. | |
401 | Missing or invalid API key. | |
403 | Project does not have the manage_channels scope on this server. | |
404 | The project is not mapped to this server, the server does not exist, or the bot cannot reach it. | |
409 | Idempotency conflict: a request with this key is currently in progress, or the key was reused with a different payload. | |
429 | Rate limit exceeded. | |
502 | Discord rejected the request or bot lacks permissions. |
Open in Swagger (opens in a new tab)
List all channels in a server
/api/servers/{serverId}/channelsReturns all channels the bot can access in the server, with categories.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
serverId | path | string | yes | Discord server ID |
type | query | "all" or "text" or "voice" or "announcement" or "category" | no | Filter by channel type |
categoryId | query | string | no | Filter by parent category ID |
Responses
| Status | Description | Body |
|---|---|---|
200 | List of channels and categories. | ChannelListResponseDto |
400 | Invalid query parameters. | |
401 | Missing or invalid API key. | |
403 | Project does not have READ access to this server. | |
404 | Server not found or bot not connected. |
Open in Swagger (opens in a new tab)
Create a Discord channel
/api/servers/{serverId}/channelsCreates a text or voice channel in the Discord server, optionally under a parent category. Requires the manage_channels scope on the server. The Idempotency-Key header is required: retrying with the same key returns the cached response instead of creating it again.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
serverId | path | string | yes | Discord server ID |
Idempotency-Key | header | string | yes | Required idempotency key (up to 128 characters). A retry with the same key returns the cached response instead of creating the resource again. |
Request body (JSON, required): CreateChannelDto schema.
Responses
| Status | Description | Body |
|---|---|---|
201 | Channel created successfully. | CreateChannelResponseDto |
400 | Invalid channel payload, parent is not a category, or missing Idempotency-Key header. | |
401 | Missing or invalid API key. | |
403 | Project does not have the manage_channels scope on this server. | |
404 | The project is not mapped to this server, the server does not exist, or the parent category is not in it. | |
409 | Idempotency conflict: a request with this key is currently in progress, or the key was reused with a different payload. | |
429 | Rate limit exceeded. | |
502 | Discord rejected the request or bot lacks permissions. |
Open in Swagger (opens in a new tab)
Get channel details
/api/servers/{serverId}/channels/{channelId}Returns detailed information about a specific channel.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
serverId | path | string | yes | Discord server ID |
channelId | path | string | yes | Discord channel ID |
Responses
| Status | Description | Body |
|---|---|---|
200 | Channel details. | ChannelDetailResponseDto |
400 | Invalid channel ID format. | |
401 | Missing or invalid API key. | |
403 | Project does not have READ access to this server. | |
404 | Channel does not exist or bot lacks access. |
Open in Swagger (opens in a new tab)
Create a channel invite
/api/servers/{serverId}/channels/{channelId}/invitesCreates a Discord invite for a channel of a server the project may access. Retrying with the same Idempotency-Key returns the cached invite instead of creating another one.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
serverId | path | string | yes | Discord server ID |
channelId | path | string | yes | Discord channel ID |
Idempotency-Key | header | string | no | Optional idempotency key (up to 128 characters). A retry with the same key returns the cached response. |
Request body (JSON, required): CreateInviteDto schema.
Responses
| Status | Description | Body |
|---|---|---|
201 | Invite created. | InviteResponseDto |
400 | Invalid invite options. | |
401 | Missing or invalid API key. | |
403 | Project lacks the manage_channels scope on this server. | |
404 | Channel does not exist in this server or bot lacks access. | |
409 | Idempotency conflict: a request with this key is currently in progress, or the key was reused with a different payload. | |
429 | Rate limit exceeded. 5 invites per minute per project. | |
502 | Discord rejected the request or the bot lacks permission. |
Open in Swagger (opens in a new tab)
Get recent messages from a channel
/api/servers/{serverId}/channels/{channelId}/messagesRetrieves message history from a text channel. Supports pagination and author filtering.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
serverId | path | string | yes | Discord server ID |
channelId | path | string | yes | Discord channel ID |
limit | query | number | no | Max number of messages (1-100) Default: 50. |
before | query | string | no | Get messages before this Discord snowflake ID |
after | query | string | no | Get messages after this Discord snowflake ID |
authorId | query | string | no | Filter by author Discord ID |
Responses
| Status | Description | Body |
|---|---|---|
200 | List of messages. | GetMessagesResponseDto |
400 | Invalid query parameters. | |
401 | Missing or invalid API key. | |
403 | Project does not have READ access to this server. | |
404 | Channel does not exist or bot lacks access. | |
429 | Rate limit exceeded. 10 requests per minute per project. |
Open in Swagger (opens in a new tab)
Send a message to a Discord channel
/api/servers/{serverId}/channels/{channelId}/messagesSends a message with optional embeds and mention configuration.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
serverId | path | string | yes | Discord server ID |
channelId | path | string | yes | Discord channel ID |
Request body (JSON, required): SendMessageDto schema.
Responses
| Status | Description | Body |
|---|---|---|
201 | Message sent successfully. | SendMessageResponseDto |
400 | Invalid message content or embed validation failed. | |
401 | Missing or invalid API key. | |
403 | Project does not have SEND_MESSAGES operation on this server. | |
404 | Channel does not exist or bot lacks access. | |
429 | Rate limit exceeded. 5 messages per minute per project. |
Open in Swagger (opens in a new tab)
Schemas
AllowedMentionsDto schema
| Field | Type | Required | Description |
|---|---|---|---|
parse | array of "everyone" or "roles" or "users" | no | Types of mentions allowed |
roles | array of string | no | Discord role IDs to allow mentioning |
users | array of string | no | Discord user IDs to allow mentioning |
CategoryResponseDto schema
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Discord snowflake ID of the created category |
name | string | yes | Name of the category |
ChannelCategoryDto schema
| Field | Type | Required | Description |
|---|---|---|---|
children | array of string | yes | Child channel IDs |
id | string | yes | Category ID |
name | string | yes | Category name |
position | number | yes | Position |
ChannelDetailResponseDto schema
| Field | Type | Required | Description |
|---|---|---|---|
createdAt | string | yes | ISO 8601 creation timestamp |
id | string | yes | Discord channel ID |
lastMessageId | string or null | yes | Last message ID |
name | string | yes | Channel name |
nsfw | boolean | yes | Whether the channel is NSFW |
overwrites | array of ChannelPermissionOverwriteDto | yes | Per-target permission overwrites configured on the channel |
parentId | string or null | yes | Parent category ID |
permissionOverwrites | boolean | yes | Whether the channel has any permission overwrites |
position | number | yes | Position |
topic | string or null | yes | Channel topic |
type | string | yes | Channel type |
ChannelListResponseDto schema
| Field | Type | Required | Description |
|---|---|---|---|
categories | array of ChannelCategoryDto | yes | |
channels | array of ChannelResponseDto | yes |
ChannelPermissionOverwriteDto schema
| Field | Type | Required | Description |
|---|---|---|---|
allow | string | yes | Allowed permission bits (Discord bitfield as a string) |
deny | string | yes | Denied permission bits (Discord bitfield as a string) |
id | string | yes | Role or member ID the overwrite targets |
type | "role" or "member" | yes | Whether the overwrite targets a role or a member |
ChannelResponseDto schema
| Field | Type | Required | Description |
|---|---|---|---|
createdAt | string | no | ISO 8601 creation timestamp |
id | string | yes | Discord channel ID |
lastMessageId | string or null | no | Last message ID |
name | string | yes | Channel name |
nsfw | boolean | yes | Whether the channel is NSFW |
parentId | string or null | yes | Parent category ID |
permissionOverwrites | boolean | yes | Whether the channel has permission overwrites |
position | number | yes | Position in the channel list |
topic | string or null | yes | Channel topic |
type | "text" or "voice" or "announcement" or "category" | yes | Channel type |
CreateCategoryDto schema
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Name of the Discord category |
CreateChannelDto schema
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Name of the Discord channel |
parentId | string | no | Discord snowflake ID of the parent category |
type | "text" or "voice" | yes | Type of the channel (text or voice) |
CreateChannelResponseDto schema
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Discord snowflake ID of the created channel |
name | string | yes | Name of the channel |
parentId | string or null | yes | Discord snowflake ID of the parent category, or null if root level |
type | "text" or "voice" | yes | Type of the channel |
CreateInviteDto schema
| Field | Type | Required | Description |
|---|---|---|---|
maxAgeSeconds | number | no | Seconds until the invite expires (0 = never). Discord default when omitted: 86400 (24 hours). |
maxUses | number | no | Maximum number of uses (0 = unlimited, the Discord default when omitted). |
EmbedAuthorDto schema
| Field | Type | Required | Description |
|---|---|---|---|
icon_url | string (uri) | no | Author icon URL |
name | string | yes | Author name |
url | string (uri) | no | Author URL |
EmbedDto schema
| Field | Type | Required | Description |
|---|---|---|---|
author | EmbedAuthorDto | no | Embed author |
color | number | no | Color as decimal integer (0-16777215) |
description | string | no | Embed description |
footer | EmbedFooterDto | no | Embed footer |
image | EmbedImageDto | no | Embed image |
thumbnail | EmbedThumbnailDto | no | Embed thumbnail |
title | string | no | Embed title |
url | string (uri) | no | Embed URL |
EmbedFooterDto schema
| Field | Type | Required | Description |
|---|---|---|---|
icon_url | string (uri) | no | Footer icon URL |
text | string | yes | Footer text |
EmbedImageDto schema
| Field | Type | Required | Description |
|---|---|---|---|
url | string (uri) | yes | URL of the image |
EmbedThumbnailDto schema
| Field | Type | Required | Description |
|---|---|---|---|
url | string (uri) | yes | URL of the thumbnail |
GetMessagesResponseDto schema
| Field | Type | Required | Description |
|---|---|---|---|
hasMore | boolean | yes | Whether there are more messages available |
messages | array of MessageDto | yes |
InviteResponseDto schema
| Field | Type | Required | Description |
|---|---|---|---|
code | string | yes | Invite code |
expiresAt | string or null | yes | Expiry (ISO 8601), null when the invite never expires |
url | string | yes | Invite URL |
MentionDto schema
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Mentioned user/role ID |
name | string or null | no | Mentioned user name |
MessageAttachmentDto schema
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | yes | File name |
id | string | yes | Attachment ID |
size | number | yes | File size in bytes |
url | string | yes | Attachment URL |
MessageAuthorDto schema
| Field | Type | Required | Description |
|---|---|---|---|
avatar | string or null | no | Avatar hash or URL |
id | string | yes | Discord user ID |
username | string | yes | Discord username |
MessageDto schema
| Field | Type | Required | Description |
|---|---|---|---|
attachments | array of MessageAttachmentDto | yes | |
author | MessageAuthorDto | yes | |
content | string | yes | Message content |
embeds | array of MessageEmbedDto | yes | |
id | string | yes | Discord message ID |
mentions | array of MentionDto | yes | |
timestamp | string | yes | ISO 8601 timestamp |
MessageEmbedDto schema
| Field | Type | Required | Description |
|---|---|---|---|
color | number or null | no | Color in decimal |
description | string or null | no | Embed description |
title | string or null | no | Embed title |
type | string or null | no | Embed type |
url | string or null | no | Embed URL |
SendMessageDto schema
| Field | Type | Required | Description |
|---|---|---|---|
allowed_mentions | AllowedMentionsDto | no | Allowed mentions configuration |
content | string | no | Message content (max 2000 chars, optional if embeds provided) |
embeds | array of EmbedDto | no | Embed objects (max 10) |
tts | boolean | no | Whether the message is text-to-speech Default: false. |
SendMessageResponseDto schema
| Field | Type | Required | Description |
|---|---|---|---|
author | MessageAuthorDto | yes | |
channelId | string | yes | Discord channel ID |
content | string | yes | Message content |
id | string | yes | Discord message ID |
timestamp | string | yes | ISO 8601 timestamp |
Source: apps/api/openapi.json.