post
/channels/{channel_id}/messagesSend a message
Sends a new message to a channel. Requires permission to send messages in the target channel. Supports text content, embeds, attachments (multipart), and mentions. Returns the created message object with full details.
send_message
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| channel_id* | path | SnowflakeType | The ID of the channel |
Request body
application/json
json
{
"type": "object",
"properties": {
"content": {
"anyOf": [
{
"$ref": "#/components/schemas/MessageContentRequest"
},
{
"type": "null"
}
]
},
"embeds": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RichEmbedRequest"
},
"description": "Array of embed objects to include in the message"
},
"attachments": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/ClientUploadedAttachmentRequest"
},
{
"$ref": "#/components/schemas/ClientAttachmentRequest"
}
]
},
"description": "Array of attachment objects"
},
"message_reference": {
"description": "Reference to another message (for replies or forwards)",
"anyOf": [
{
"$ref": "#/components/schemas/MessageReferenceRequest"
},
{
"type": "null"
}
]
},
"allowed_mentions": {
"description": "Controls which mentions trigger notifications",
"anyOf": [
{
"$ref": "#/components/schemas/AllowedMentionsRequest"
},
{
"type": "null"
}
]
},
"flags": {
"default": 0,
"$ref": "#/components/schemas/MessageFlags",
"description": "Message flags bitfield"
},
"nonce": {
"$ref": "#/components/schemas/MessageNonceRequest"
},
"favorite_meme_id": {
"description": "ID of a favorite meme to attach",
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeType"
},
{
"type": "null"
}
]
},
"sticker_ids": {
"description": "Array of sticker IDs to include (max 3)",
"anyOf": [
{
"maxItems": 3,
"type": "array",
"items": {
"$ref": "#/components/schemas/SnowflakeType"
}
},
{
"type": "null"
}
]
},
"tts": {
"description": "Whether this is a text-to-speech message",
"type": "boolean"
}
}
}Responses
200
Success
json
{
"type": "object",
"properties": {
"id": {
"description": "The unique identifier (snowflake) for this message",
"$ref": "#/components/schemas/SnowflakeStringType"
},
"channel_id": {
"description": "The ID of the channel this message was sent in",
"$ref": "#/components/schemas/SnowflakeStringType"
},
"author": {
"description": "The author of the message",
"$ref": "#/components/schemas/UserPartialResponse"
},
"webhook_id": {
"description": "The ID of the webhook that sent this message",
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeStringType"
},
{
"type": "null"
}
]
},
"type": {
"$ref": "#/components/schemas/MessageType"
},
"flags": {
"$ref": "#/components/schemas/MessageFlags",
"description": "The bitwise flags for this message"
},
"content": {
"type": "string",
"description": "The text content of the message"
},
"timestamp": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "The ISO 8601 timestamp of when the message was created"
},
"edited_timestamp": {
"description": "The ISO 8601 timestamp of when the message was last edited",
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"pinned": {
"type": "boolean",
"description": "Whether the message is pinned"
},
"mention_everyone": {
"type": "boolean",
"description": "Whether the message mentions @everyone"
},
"tts": {
"type": "boolean",
"description": "Whether the message was sent as text-to-speech"
},
"mentions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserPartialResponse"
},
"description": "The users mentioned in the message"
},
"mention_roles": {
"type": "array",
"items": {
"type": "string"
},
"description": "The role IDs mentioned in the message"
},
"mention_channels": {
"description": "Channels mentioned in the message that are visible to @everyone",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageChannelMentionResponse"
}
},
{
"type": "null"
}
]
},
"users": {
"description": "Users referenced from non-notifying content, embed, and snapshot text, included for client-side resolution",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/UserPartialResponse"
}
},
{
"type": "null"
}
]
},
"embeds": {
"description": "The embeds attached to the message",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageEmbedResponse"
}
},
{
"type": "null"
}
]
},
"attachments": {
"description": "The files attached to the message",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageAttachmentResponse"
}
},
{
"type": "null"
}
]
},
"stickers": {
"description": "The stickers sent with the message",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageStickerResponse"
}
},
{
"type": "null"
}
]
},
"reactions": {
"description": "The reactions on the message",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageReactionResponse"
}
},
{
"type": "null"
}
]
},
"message_reference": {
"description": "Reference data for replies or forwards",
"anyOf": [
{
"type": "object",
"properties": {
"channel_id": {
"description": "The ID of the channel containing the referenced message",
"$ref": "#/components/schemas/SnowflakeStringType"
},
"message_id": {
"description": "The ID of the referenced message, absent on a channel follow system message and on thread created messages that reference only a thread",
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeStringType"
},
{
"type": "null"
}
]
},
"guild_id": {
"description": "The ID of the guild containing the referenced message",
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeStringType"
},
{
"type": "null"
}
]
},
"type": {
"$ref": "#/components/schemas/MessageReferenceType"
}
},
"required": [
"channel_id",
"type"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"message_snapshots": {
"description": "Snapshots of forwarded messages",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageSnapshotResponse"
}
},
{
"type": "null"
}
]
},
"nonce": {
"description": "A client-provided value for message deduplication",
"type": [
"string",
"null"
]
},
"call": {
"description": "Call information if this message represents a call",
"anyOf": [
{
"type": "object",
"properties": {
"participants": {
"type": "array",
"items": {
"type": "string"
},
"description": "The user IDs of participants in the call"
},
"ended_timestamp": {
"description": "The ISO 8601 timestamp of when the call ended",
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
}
},
"required": [
"participants"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"thread": {
"description": "The thread started from this message, when the viewer can see threads",
"$ref": "#/components/schemas/ThreadChannelResponse"
},
"referenced_message": {
"description": "The reply target. Present and populated when the target resolved, present and null when the target is gone, absent when this message has no default reference. Clients must tell null apart from absent by key presence.",
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"description": "The unique identifier (snowflake) for this message",
"$ref": "#/components/schemas/SnowflakeStringType"
},
"channel_id": {
"description": "The ID of the channel this message was sent in",
"$ref": "#/components/schemas/SnowflakeStringType"
},
"author": {
"description": "The author of the message",
"$ref": "#/components/schemas/UserPartialResponse"
},
"webhook_id": {
"description": "The ID of the webhook that sent this message",
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeStringType"
},
{
"type": "null"
}
]
},
"type": {
"$ref": "#/components/schemas/MessageType"
},
"flags": {
"$ref": "#/components/schemas/MessageFlags",
"description": "The bitwise flags for this message"
},
"content": {
"type": "string",
"description": "The text content of the message"
},
"timestamp": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "The ISO 8601 timestamp of when the message was created"
},
"edited_timestamp": {
"description": "The ISO 8601 timestamp of when the message was last edited",
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"pinned": {
"type": "boolean",
"description": "Whether the message is pinned"
},
"mention_everyone": {
"type": "boolean",
"description": "Whether the message mentions @everyone"
},
"tts": {
"type": "boolean",
"description": "Whether the message was sent as text-to-speech"
},
"mentions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserPartialResponse"
},
"description": "The users mentioned in the message"
},
"mention_roles": {
"type": "array",
"items": {
"type": "string"
},
"description": "The role IDs mentioned in the message"
},
"mention_channels": {
"description": "Channels mentioned in the message that are visible to @everyone",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageChannelMentionResponse"
}
},
{
"type": "null"
}
]
},
"users": {
"description": "Users referenced from non-notifying content, embed, and snapshot text, included for client-side resolution",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/UserPartialResponse"
}
},
{
"type": "null"
}
]
},
"embeds": {
"description": "The embeds attached to the message",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageEmbedResponse"
}
},
{
"type": "null"
}
]
},
"attachments": {
"description": "The files attached to the message",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageAttachmentResponse"
}
},
{
"type": "null"
}
]
},
"stickers": {
"description": "The stickers sent with the message",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageStickerResponse"
}
},
{
"type": "null"
}
]
},
"reactions": {
"description": "The reactions on the message",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageReactionResponse"
}
},
{
"type": "null"
}
]
},
"message_reference": {
"description": "Reference data for replies or forwards",
"anyOf": [
{
"type": "object",
"properties": {
"channel_id": {
"description": "The ID of the channel containing the referenced message",
"$ref": "#/components/schemas/SnowflakeStringType"
},
"message_id": {
"description": "The ID of the referenced message, absent on a channel follow system message and on thread created messages that reference only a thread",
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeStringType"
},
{
"type": "null"
}
]
},
"guild_id": {
"description": "The ID of the guild containing the referenced message",
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeStringType"
},
{
"type": "null"
}
]
},
"type": {
"$ref": "#/components/schemas/MessageReferenceType"
}
},
"required": [
"channel_id",
"type"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"message_snapshots": {
"description": "Snapshots of forwarded messages",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageSnapshotResponse"
}
},
{
"type": "null"
}
]
},
"nonce": {
"description": "A client-provided value for message deduplication",
"type": [
"string",
"null"
]
},
"call": {
"description": "Call information if this message represents a call",
"anyOf": [
{
"type": "object",
"properties": {
"participants": {
"type": "array",
"items": {
"type": "string"
},
"description": "The user IDs of participants in the call"
},
"ended_timestamp": {
"description": "The ISO 8601 timestamp of when the call ended",
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
}
},
"required": [
"participants"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"thread": {
"description": "The thread started from this message, when the viewer can see threads",
"$ref": "#/components/schemas/ThreadChannelResponse"
}
},
"required": [
"id",
"channel_id",
"author",
"type",
"flags",
"content",
"timestamp",
"pinned",
"mention_everyone",
"tts",
"mentions",
"mention_roles"
],
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"channel_id",
"author",
"type",
"flags",
"content",
"timestamp",
"pinned",
"mention_everyone",
"tts",
"mentions",
"mention_roles"
],
"additionalProperties": false
}400
Bad Request - The request was malformed or contained invalid data
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}401
Unauthorized - Authentication is required or the token is invalid
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}403
Forbidden - You do not have permission to perform this action
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}429
Too Many Requests - You are being rate limited
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
},
"retry_after": {
"type": "number",
"description": "Seconds to wait before retrying"
},
"global": {
"type": "boolean",
"description": "Whether this is a global rate limit"
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}500
Internal Server Error - An unexpected error occurred
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}