API reference
Messages
Reading, sending, editing and deleting messages.
Get Channel Messages
/channels/{channel.id}/messagesPeople and botsA page of messages, newest first. Page with before, after or around.
Without Read Message History the list is empty ([]), as on Discord. A bot gets the text of only the messages its server lets it read (Privacy for bots); in the others content, embeds and attachments are empty.
Permissions needed
READ_MESSAGE_HISTORYbit 65536- Read message history
Path parameters
channel.id- A snowflake id.
Query string
beforestring- Messages before this id.
afterstring- Messages after this id.
aroundstring- Messages around this id.
limitinteger · 1 to 100 · default 50- 1 to 100, default 50.
Response
200 a list of APIMessage
[
{
"id": "107441200000000100",
"channel_id": "107441200000000010",
"guild_id": "107441200000000001",
"author": {
"id": "107441200000000200",
"username": "josh",
"discriminator": "0",
"global_name": "Josh",
"avatar": "3f2a9c1e5b7d4a608c1e2f3a4b5c6d7e",
"banner": null,
"accent_color": null,
"bot": false,
"public_flags": 0
},
"content": "Hello, world",
"timestamp": "2026-10-22T10:00:00.000Z",
"edited_timestamp": null,
"tts": false,
"mention_everyone": false,
"mentions": [],
"mention_roles": [],
"attachments": [],
"embeds": [],
"pinned": false,
"flags": 0,
"type": 0
}
]
Errors
UNKNOWN_CHANNEL10003 · HTTP 404- The channel does not exist, or you are not in its server.
MISSING_ACCESS50001 · HTTP 403- You are in the server but cannot see the channel (VIEW_CHANNEL).
INVALID_FORM_BODY50035 · HTTP 400- More than one of
before,after,around.
Discord
The same as Discord’s Get Channel Messages.
Create Message
/channels/{channel.id}/messagesPeople and botsSend a message. JSON, or multipart/form-data with files, as discord.py and discord.js send them.
A message needs text, an embed, a file, a sticker or a poll. A bot may send embeds (up to 10, 6000 characters of text in all) and components (up to 5 rows of buttons or one menu each); a person's request ignores both. Fields tether does not know are ignored and null counts as absent.
For files, send multipart/form-data with the message as payload_json and the files as files[0], files[1]…; attachments: [{id: 0, filename: "a.png"}] in the JSON names files[0]. See Files. The size and type limits are checked as the bytes arrive, after the permission and rate-limit checks, so a refused upload costs nothing.
Permissions needed
SEND_MESSAGESbit 2048- Send messages
Path parameters
channel.id- A snowflake id.
Body
application/json, multipart/form-data
contentstring | null · max 4000 characters- The text, up to 4000 characters (Discord's limit is 2000).
attachmentsarray of object · max 10 items- Files already uploaded (two-step flow), or names for the
files[n]of a multipart body. attachments[].idstring | integer · max 32 charactersattachments[].uploaded_filenamestring · 1 to 512 charactersrequiredattachments[].filenamestring · 1 to 255 charactersattachments[].duration_secsnumber · max 305attachments[].waveformstring · max 344 charactersnoncestring | integer · max 25 characters- Echoed in the answer and in
MESSAGE_CREATE. message_referenceobject- Reply to a message in this channel:
{message_id}. message_reference.message_idstringrequiredsticker_idsarray of string · max 3 items- Up to 3 sticker ids (Stickers). A sticker from any server you are in works; the message then carries them in
sticker_items. Not with a poll, a rich post or a voice message. pollobject- A poll (Discord's poll create request).
poll.questionobjectrequiredpoll.question.textstring · 1 to 300 charactersrequiredpoll.answersarray of object · 1 to 10 itemsrequiredpoll.answers[].poll_mediaobjectrequiredpoll.durationinteger · 1 to 768 · default 24poll.allow_multiselectboolean · default falsepoll.layout_type1 · default 1gifobjectgif.idstringrequiredgif.titlestring · max 200 characters · default ""gif.widthinteger · 1 to 8192requiredgif.heightinteger · 1 to 8192requiredgif.preview_urlstring · 1 to 2048 charactersrequiredgif.preview_widthinteger · 1 to 8192gif.preview_heightinteger · 1 to 8192gif.video_urlstring · 1 to 2048 charactersrequiredgif.thumb_urlstring · 1 to 2048 charactersrequiredflagsintegerSUPPRESS_EMBEDS(4);SUPPRESS_NOTIFICATIONS(4096) is accepted and ignored;IS_VOICE_MESSAGE(8192).embedsarray of object · max 10 items- Bots only. Rich embeds.
embeds[].type"rich"embeds[].titlestring · 1 to 256 charactersembeds[].descriptionstring · 1 to 4096 charactersembeds[].urlstring · max 2048 charactersembeds[].colorinteger · 0 to 16777215embeds[].timestampstringembeds[].fieldsarray of object · max 25 itemsembeds[].fields[].namestring · 1 to 256 charactersrequiredembeds[].fields[].valuestring · 1 to 1024 charactersrequiredembeds[].fields[].inlinebooleanembeds[].authorobjectembeds[].author.namestring · 1 to 256 charactersrequiredembeds[].author.urlstring · max 2048 charactersembeds[].author.icon_urlstring · max 2048 charactersembeds[].thumbnailobject- https address or attachment://name
embeds[].imageobject- https address or attachment://name
embeds[].footerobjectembeds[].footer.textstring · 1 to 2048 charactersrequiredembeds[].footer.icon_urlstring · max 2048 characterscomponentsarray of object · max 5 items- Bots only. Action rows of buttons or a string menu.
components[].type1requiredcomponents[].componentsarray of object · 1 to 5 itemsrequired
Unknown keys (tts, allowed_mentions…) are dropped, not refused.
Example request
{
"content": "Hello, world"
}
Response
200 APIMessage
{
"id": "107441200000000101",
"channel_id": "107441200000000010",
"guild_id": "107441200000000001",
"author": {
"id": "107441200000000300",
"username": "groove",
"discriminator": "0",
"global_name": null,
"avatar": "3f2a9c1e5b7d4a608c1e2f3a4b5c6d7e",
"banner": null,
"accent_color": null,
"bot": true,
"public_flags": 0
},
"content": "Pong!",
"timestamp": "2026-10-22T10:00:00.000Z",
"edited_timestamp": null,
"tts": false,
"mention_everyone": false,
"mentions": [],
"mention_roles": [],
"attachments": [],
"embeds": [],
"pinned": false,
"flags": 0,
"type": 0,
"nonce": "1"
}
Errors
UNKNOWN_CHANNEL10003 · HTTP 404- The channel does not exist, or you are not in its server.
MISSING_ACCESS50001 · HTTP 403- You are in the server but cannot see the channel (VIEW_CHANNEL).
MISSING_PERMISSIONS50013 · HTTP 403- You lack Send Messages here (and Attach Files when you send a file).
CANNOT_SEND_EMPTY_MESSAGE50006 · HTTP 400- There is no text, embed, file or poll.
INVALID_FORM_BODY50035 · HTTP 400- A field is outside its limits (4000 characters of text, 10 embeds, 5 rows of buttons…).
SLOWMODE_RATE_LIMIT20016 · HTTP 429- The channel has slow mode and its wait is not over (
retry_after). People who manage the channel skip it. CHANNEL_LOCKED90170 · HTTP 403- A moderator locked the channel.
AUTOMOD_MESSAGE_BLOCKED200000 · HTTP 400- Auto-mod blocked the message (
automodin the body says which rule). LINK_BLOCKED90261 · HTTP 400- The message has a link that is known to be harmful and was not sent.
blocked_messagein the body is the message as its writer sees it (not_sent: "harmful_link"). SENDING_PAUSED90262 · HTTP 429- A new account that sent the same text, mentions or invite links to many places is paused from sending for a few minutes (
retry_after). THREAD_ARCHIVED50083 · HTTP 400- The thread is archived and locked.
REQUEST_ENTITY_TOO_LARGE40005 · HTTP 413- A file (or all files together) is over the limit; nothing is kept.
UNSUPPORTED_FILE_TYPE90005 · HTTP 400- A file is an executable or another type tether refuses.
Rate limits
messageCreatePerUserChannelbucket 2152fc9b- 10 per 5 seconds, counted per user. See Rate limits.
Gateway events it causes
Discord
Like Discord’s Create Message, with differences.
Up to 4000 characters. No tts or allowed_mentions. sticker_ids take any server sticker you can see, not only the one of the channel. Embeds and buttons are bots-only. Files are multipart/form-data as Discord sends them, with the same limits as any upload (25 MiB per file by default).
Search Guild Messages
/guilds/{guild.id}/messages/searchPeople onlySearch the messages of every channel you can read. People only: a bot gets 403 20001.
Discord's query names. Lists repeat the key (has=link&has=file). To search by date pass a snowflake made from the date as min_id or max_id. Matching is Postgres full-text search: whole words, no stemming, case-insensitive; "quoted phrases", -excluded and or work. Each inner list of messages holds only the hit, marked hit: true. Not supported: author_type, slop, include_nsfw, has=sticker. The query is never logged.
Path parameters
guild.id- A snowflake id.
Query string
contentstring · 1 to 1024 charactersauthor_idarray of string · max 20 itemschannel_idarray of string · max 20 itemsmentionsarray of string · max 20 itemshasarray of "link" | "embed" | "file" | "image" | "video" | "sound" · max 6 itemsmin_idstringmax_idstringpinned"true" | "false"mention_everyone"true" | "false"sort_by"timestamp" | "relevance" · default "timestamp"sort_order"asc" | "desc" · default "desc"offsetinteger · 0 to 9975 · default 0limitinteger · 1 to 25 · default 25
Response
200 APISearchResults
{
"total_results": 1,
"messages": [
[
{
"id": "107441200000000100",
"channel_id": "107441200000000010",
"guild_id": "107441200000000001",
"author": {
"id": "107441200000000200",
"username": "josh",
"discriminator": "0",
"global_name": "Josh",
"avatar": "3f2a9c1e5b7d4a608c1e2f3a4b5c6d7e",
"banner": null,
"accent_color": null,
"bot": false,
"public_flags": 0
},
"content": "Hello, world",
"timestamp": "2026-10-22T10:00:00.000Z",
"edited_timestamp": null,
"tts": false,
"mention_everyone": false,
"mentions": [],
"mention_roles": [],
"attachments": [],
"embeds": [],
"pinned": false,
"flags": 0,
"type": 0,
"hit": true
}
]
]
}
Errors
UNKNOWN_GUILD10004 · HTTP 404- The server does not exist, or you are not in it.
BOTS_CANNOT_USE_ENDPOINT20001 · HTTP 403- A bot token was used on a route for people.
INVALID_FORM_BODY50035 · HTTP 400- A field is missing, the wrong type or outside its limits.
Rate limits
searchPerUserbucket 8cabd33b- 20 per 10 seconds, counted per user. See Rate limits.
Discord
Like Discord’s Search Guild Messages, with differences.
No context messages around a hit; people only.
Search Channel Messages
/channels/{channel.id}/messages/searchPeople onlySearch one channel, a DM or a group DM too. People only.
Permissions needed
READ_MESSAGE_HISTORYbit 65536- Read message history
Path parameters
channel.id- A snowflake id.
Query string
contentstring · 1 to 1024 charactersauthor_idarray of string · max 20 itemschannel_idarray of string · max 20 itemsmentionsarray of string · max 20 itemshasarray of "link" | "embed" | "file" | "image" | "video" | "sound" · max 6 itemsmin_idstringmax_idstringpinned"true" | "false"mention_everyone"true" | "false"sort_by"timestamp" | "relevance" · default "timestamp"sort_order"asc" | "desc" · default "desc"offsetinteger · 0 to 9975 · default 0limitinteger · 1 to 25 · default 25
Response
200 APISearchResults
{
"total_results": 1,
"messages": [
[
{
"id": "107441200000000100",
"channel_id": "107441200000000010",
"guild_id": "107441200000000001",
"author": {
"id": "107441200000000200",
"username": "josh",
"discriminator": "0",
"global_name": "Josh",
"avatar": "3f2a9c1e5b7d4a608c1e2f3a4b5c6d7e",
"banner": null,
"accent_color": null,
"bot": false,
"public_flags": 0
},
"content": "Hello, world",
"timestamp": "2026-10-22T10:00:00.000Z",
"edited_timestamp": null,
"tts": false,
"mention_everyone": false,
"mentions": [],
"mention_roles": [],
"attachments": [],
"embeds": [],
"pinned": false,
"flags": 0,
"type": 0,
"hit": true
}
]
]
}
Errors
UNKNOWN_CHANNEL10003 · HTTP 404- The channel does not exist, or you are not in its server.
MISSING_ACCESS50001 · HTTP 403- You are in the server but cannot see the channel (VIEW_CHANNEL).
MISSING_PERMISSIONS50013 · HTTP 403- You lack a permission the route needs.
BOTS_CANNOT_USE_ENDPOINT20001 · HTTP 403- A bot token was used on a route for people.
INVALID_FORM_BODY50035 · HTTP 400- A field is missing, the wrong type or outside its limits.
Rate limits
searchPerUserbucket 8cabd33b- 20 per 10 seconds, counted per user. See Rate limits.
Discord
Like Discord’s Search Guild Messages, with differences.
Discord has no per-channel search route; channel_id is not read here.
Get Channel Message
/channels/{channel.id}/messages/{message.id}People and botsOne message.
Permissions needed
READ_MESSAGE_HISTORYbit 65536- Read message history
Path parameters
channel.id- A snowflake id.
message.id- A snowflake id.
Response
200 APIMessage
{
"id": "107441200000000100",
"channel_id": "107441200000000010",
"guild_id": "107441200000000001",
"author": {
"id": "107441200000000200",
"username": "josh",
"discriminator": "0",
"global_name": "Josh",
"avatar": "3f2a9c1e5b7d4a608c1e2f3a4b5c6d7e",
"banner": null,
"accent_color": null,
"bot": false,
"public_flags": 0
},
"content": "Hello, world",
"timestamp": "2026-10-22T10:00:00.000Z",
"edited_timestamp": null,
"tts": false,
"mention_everyone": false,
"mentions": [],
"mention_roles": [],
"attachments": [],
"embeds": [],
"pinned": false,
"flags": 0,
"type": 0
}
Errors
UNKNOWN_CHANNEL10003 · HTTP 404- The channel does not exist, or you are not in its server.
MISSING_ACCESS50001 · HTTP 403- You are in the server but cannot see the channel (VIEW_CHANNEL).
MISSING_PERMISSIONS50013 · HTTP 403- You lack a permission the route needs.
UNKNOWN_MESSAGE10008 · HTTP 404- There is no such message in that channel.
Discord
The same as Discord’s Get Channel Message.
Edit Message
/channels/{channel.id}/messages/{message.id}People and botsChange a message's text, embeds, buttons or files. Also multipart/form-data.
Only the author changes content. Anyone with Manage Messages (and the author) may set SUPPRESS_EMBEDS (flags). components: [] or embeds: [] removes them (for example to disable a button after use); an edit that only changes components is not marked as edited. attachments lists the files to keep by id ([{id: "<attachment id>"}]); the others are removed, new files in files[n] are added, leaving it out leaves the files as they are and [] removes all. A message cannot end up empty.
Path parameters
channel.id- A snowflake id.
message.id- A snowflake id.
Body
application/json, multipart/form-data
contentstring | null · max 4000 charactersflagsintegerembedsarray of object · max 10 itemsembeds[].type"rich"embeds[].titlestring · 1 to 256 charactersembeds[].descriptionstring · 1 to 4096 charactersembeds[].urlstring · max 2048 charactersembeds[].colorinteger · 0 to 16777215embeds[].timestampstringembeds[].fieldsarray of object · max 25 itemsembeds[].fields[].namestring · 1 to 256 charactersrequiredembeds[].fields[].valuestring · 1 to 1024 charactersrequiredembeds[].fields[].inlinebooleanembeds[].authorobjectembeds[].author.namestring · 1 to 256 charactersrequiredembeds[].author.urlstring · max 2048 charactersembeds[].author.icon_urlstring · max 2048 charactersembeds[].thumbnailobject- https address or attachment://name
embeds[].imageobject- https address or attachment://name
embeds[].footerobjectembeds[].footer.textstring · 1 to 2048 charactersrequiredembeds[].footer.icon_urlstring · max 2048 characterscomponentsarray of object · max 5 itemscomponents[].type1requiredcomponents[].componentsarray of object · 1 to 5 itemsrequiredattachmentsarray of any · max 20 items
Example request
{
"content": "Edited"
}
Response
200 APIMessage
{
"id": "107441200000000101",
"channel_id": "107441200000000010",
"guild_id": "107441200000000001",
"author": {
"id": "107441200000000300",
"username": "groove",
"discriminator": "0",
"global_name": null,
"avatar": "3f2a9c1e5b7d4a608c1e2f3a4b5c6d7e",
"banner": null,
"accent_color": null,
"bot": true,
"public_flags": 0
},
"content": "Pong, edited",
"timestamp": "2026-10-22T10:00:00.000Z",
"edited_timestamp": "2026-10-22T10:05:00.000Z",
"tts": false,
"mention_everyone": false,
"mentions": [],
"mention_roles": [],
"attachments": [],
"embeds": [],
"pinned": false,
"flags": 0,
"type": 0
}
Errors
UNKNOWN_CHANNEL10003 · HTTP 404- The channel does not exist, or you are not in its server.
MISSING_ACCESS50001 · HTTP 403- You are in the server but cannot see the channel (VIEW_CHANNEL).
UNKNOWN_MESSAGE10008 · HTTP 404- There is no such message in that channel.
CANNOT_EDIT_OTHERS_MESSAGE50005 · HTTP 403- You are not the author and tried to change content.
CANNOT_SEND_EMPTY_MESSAGE50006 · HTTP 400- The edit would leave nothing in the message.
CANNOT_EDIT_A_POLL_MESSAGE520006 · HTTP 400- You tried to change the text of a poll.
THREAD_ARCHIVED50083 · HTTP 400- The message is in an archived thread.
Gateway events it causes
Discord
Like Discord’s Edit Message, with differences.
Files can be kept, added and removed in one edit (attachments).
Delete Message
/channels/{channel.id}/messages/{message.id}People and botsDelete a message. Your own, or anyone's with Manage Messages.
Path parameters
channel.id- A snowflake id.
message.id- A snowflake id.
Response
204 no body
Errors
UNKNOWN_CHANNEL10003 · HTTP 404- The channel does not exist, or you are not in its server.
MISSING_ACCESS50001 · HTTP 403- You are in the server but cannot see the channel (VIEW_CHANNEL).
UNKNOWN_MESSAGE10008 · HTTP 404- There is no such message in that channel.
MISSING_PERMISSIONS50013 · HTTP 403- It is not your message and you lack Manage Messages.
Gateway events it causes
Discord
The same as Discord’s Delete Message.
Bulk Delete Messages
/channels/{channel.id}/messages/bulk-deletePeople and botsDelete 2 to 100 messages at once.
Permissions needed
MANAGE_MESSAGESbit 8192- Delete others’ messages
Path parameters
channel.id- A snowflake id.
Body
application/json
messagesarray of string · 2 to 100 itemsrequired
Example request
{
"messages": [
"107441200000000100",
"107441200000000101"
]
}
Response
204 no body
Errors
UNKNOWN_CHANNEL10003 · HTTP 404- The channel does not exist, or you are not in its server.
MISSING_ACCESS50001 · HTTP 403- You are in the server but cannot see the channel (VIEW_CHANNEL).
MISSING_PERMISSIONS50013 · HTTP 403- You lack a permission the route needs.
INVALID_FORM_BODY50035 · HTTP 400- A field is missing, the wrong type or outside its limits.
Gateway events it causes
Discord
Like Discord’s Bulk Delete Messages, with differences.
Messages of any age can be deleted (Discord stops at two weeks).
Trigger Typing Indicator
/channels/{channel.id}/typingPeople and botsShow "is typing…" for a few seconds.
Permissions needed
SEND_MESSAGESbit 2048- Send messages
Path parameters
channel.id- A snowflake id.
Response
204 no body
Errors
UNKNOWN_CHANNEL10003 · HTTP 404- The channel does not exist, or you are not in its server.
MISSING_ACCESS50001 · HTTP 403- You are in the server but cannot see the channel (VIEW_CHANNEL).
MISSING_PERMISSIONS50013 · HTTP 403- You lack a permission the route needs.
Rate limits
typingPerUserChannelbucket 7c8461d5- 2 per 5 seconds, counted per user. See Rate limits.
Gateway events it causes
Discord
The same as Discord’s Trigger Typing Indicator.