post
/webhooks/{webhook_id}/{token}Execute webhook
Executes the webhook by sending a message to its configured channel. If the wait query parameter is true, returns the created message object; otherwise returns a 204 status with no content.
execute_webhook
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| webhook_id* | path | SnowflakeType | The ID of the webhook |
| token* | path | string | The token |
| wait | query | string |
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": {
"type": "object",
"properties": {
"id": {
"oneOf": [
{
"$ref": "#/components/schemas/SnowflakeType"
},
{
"$ref": "#/components/schemas/Int32Type"
}
],
"description": "Attachment ID for referencing uploaded files"
},
"filename": {
"type": "string",
"description": "Name of the file (1-1024 characters)"
},
"description": {
"type": "string",
"description": "Description for the attachment (max 4096 characters)"
},
"content_type": {
"type": "string",
"description": "MIME type of the file"
},
"size": {
"$ref": "#/components/schemas/NonNegativeSafeIntegerType"
},
"url": {
"type": "string",
"description": "URL of the attachment"
},
"proxy_url": {
"type": "string",
"description": "Proxied URL of the attachment"
},
"height": {
"type": "integer",
"format": "int53",
"description": "Height of the image/video in pixels"
},
"width": {
"type": "integer",
"format": "int53",
"description": "Width of the image/video in pixels"
},
"ephemeral": {
"type": "boolean",
"description": "Whether this attachment is ephemeral"
},
"duration": {
"type": "number",
"description": "Duration of audio file in seconds"
},
"waveform": {
"type": "string",
"description": "Base64-encoded bytearray of audio waveform"
},
"flags": {
"$ref": "#/components/schemas/MessageAttachmentFlags"
}
}
},
"description": "Array of attachment objects"
},
"message_reference": {
"anyOf": [
{
"$ref": "#/components/schemas/MessageReferenceRequest"
},
{
"type": "null"
}
],
"description": "Reference to another message (for replies or forwards)"
},
"allowed_mentions": {
"anyOf": [
{
"$ref": "#/components/schemas/AllowedMentionsRequest"
},
{
"type": "null"
}
],
"description": "Controls which mentions trigger notifications"
},
"flags": {
"$ref": "#/components/schemas/MessageFlags"
},
"nonce": {
"$ref": "#/components/schemas/MessageNonceRequest"
},
"favorite_meme_id": {
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeType"
},
{
"type": "null"
}
],
"description": "ID of a favorite meme to attach"
},
"sticker_ids": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/SnowflakeType"
},
"maxItems": 3
},
{
"type": "null"
}
],
"description": "Array of sticker IDs to include (max 3)"
},
"tts": {
"type": "boolean",
"description": "Whether this is a text-to-speech message"
},
"username": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Override the default username of the webhook for this message"
},
"avatar_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Override the default avatar URL of the webhook for this message"
}
}
}Responses
200
Success
json
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"description": "The unique identifier (snowflake) for this message"
},
"channel_id": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"description": "The ID of the channel this message was sent in"
},
"author": {
"$ref": "#/components/schemas/UserPartialResponse"
},
"webhook_id": {
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeType"
},
{
"type": "null"
}
],
"description": "The ID of the webhook that sent this message"
},
"type": {
"type": "integer",
"format": "int32",
"enum": [
0,
1,
2,
3,
4,
5,
6,
7,
19
],
"x-enumNames": [
"DEFAULT",
"RECIPIENT_ADD",
"RECIPIENT_REMOVE",
"CALL",
"CHANNEL_NAME_CHANGE",
"CHANNEL_ICON_CHANGE",
"CHANNEL_PINNED_MESSAGE",
"USER_JOIN",
"REPLY"
],
"x-enumDescriptions": [
"A regular message",
"A system message indicating a user was added to the conversation",
"A system message indicating a user was removed from the conversation",
"A message representing a call",
"A system message indicating the channel name changed",
"A system message indicating the channel icon changed",
"A system message indicating a message was pinned",
"A system message indicating a user joined",
"A reply message"
],
"description": "The type of message"
},
"flags": {
"$ref": "#/components/schemas/MessageFlags"
},
"content": {
"type": "string",
"description": "The text content of the message"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "The ISO 8601 timestamp of when the message was created"
},
"edited_timestamp": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"description": "The ISO 8601 timestamp of when the message was last edited"
},
"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": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageChannelMentionResponse"
}
},
{
"type": "null"
}
],
"description": "Channels mentioned in the message that are visible to @everyone"
},
"users": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/UserPartialResponse"
}
},
{
"type": "null"
}
],
"description": "Users referenced from non-notifying content, embed, and snapshot text, included for client-side resolution"
},
"embeds": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageEmbedResponse"
}
},
{
"type": "null"
}
],
"description": "The embeds attached to the message"
},
"attachments": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageAttachmentResponse"
}
},
{
"type": "null"
}
],
"description": "The files attached to the message"
},
"stickers": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageStickerResponse"
}
},
{
"type": "null"
}
],
"description": "The stickers sent with the message"
},
"nsfw_emojis": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SnowflakeType"
},
"description": "IDs of custom emojis in this message that are classified as NSFW"
},
"reactions": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageReactionResponse"
}
},
{
"type": "null"
}
],
"description": "The reactions on the message"
},
"message_reference": {
"anyOf": [
{
"type": "object",
"properties": {
"channel_id": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"description": "The ID of the channel containing the referenced message"
},
"message_id": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"description": "The ID of the referenced message"
},
"guild_id": {
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeType"
},
{
"type": "null"
}
],
"description": "The ID of the guild containing the referenced message"
},
"type": {
"$ref": "#/components/schemas/MessageReferenceType"
}
},
"required": [
"channel_id",
"message_id",
"type"
]
},
{
"type": "null"
}
],
"description": "Reference data for replies or forwards"
},
"message_snapshots": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageSnapshotResponse"
}
},
{
"type": "null"
}
],
"description": "Snapshots of forwarded messages"
},
"nonce": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "A client-provided value for message deduplication"
},
"call": {
"anyOf": [
{
"type": "object",
"properties": {
"participants": {
"type": "array",
"items": {
"type": "string"
},
"description": "The user IDs of participants in the call"
},
"ended_timestamp": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"description": "The ISO 8601 timestamp of when the call ended"
}
},
"required": [
"participants"
]
},
{
"type": "null"
}
],
"description": "Call information if this message represents a call"
},
"referenced_message": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"description": "The unique identifier (snowflake) for this message"
},
"channel_id": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"description": "The ID of the channel this message was sent in"
},
"author": {
"$ref": "#/components/schemas/UserPartialResponse"
},
"webhook_id": {
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeType"
},
{
"type": "null"
}
],
"description": "The ID of the webhook that sent this message"
},
"type": {
"type": "integer",
"format": "int32",
"enum": [
0,
1,
2,
3,
4,
5,
6,
7,
19
],
"x-enumNames": [
"DEFAULT",
"RECIPIENT_ADD",
"RECIPIENT_REMOVE",
"CALL",
"CHANNEL_NAME_CHANGE",
"CHANNEL_ICON_CHANGE",
"CHANNEL_PINNED_MESSAGE",
"USER_JOIN",
"REPLY"
],
"x-enumDescriptions": [
"A regular message",
"A system message indicating a user was added to the conversation",
"A system message indicating a user was removed from the conversation",
"A message representing a call",
"A system message indicating the channel name changed",
"A system message indicating the channel icon changed",
"A system message indicating a message was pinned",
"A system message indicating a user joined",
"A reply message"
],
"description": "The type of message"
},
"flags": {
"$ref": "#/components/schemas/MessageFlags"
},
"content": {
"type": "string",
"description": "The text content of the message"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "The ISO 8601 timestamp of when the message was created"
},
"edited_timestamp": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"description": "The ISO 8601 timestamp of when the message was last edited"
},
"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": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageChannelMentionResponse"
}
},
{
"type": "null"
}
],
"description": "Channels mentioned in the message that are visible to @everyone"
},
"users": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/UserPartialResponse"
}
},
{
"type": "null"
}
],
"description": "Users referenced from non-notifying content, embed, and snapshot text, included for client-side resolution"
},
"embeds": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageEmbedResponse"
}
},
{
"type": "null"
}
],
"description": "The embeds attached to the message"
},
"attachments": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageAttachmentResponse"
}
},
{
"type": "null"
}
],
"description": "The files attached to the message"
},
"stickers": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageStickerResponse"
}
},
{
"type": "null"
}
],
"description": "The stickers sent with the message"
},
"nsfw_emojis": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SnowflakeType"
},
"description": "IDs of custom emojis in this message that are classified as NSFW"
},
"reactions": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageReactionResponse"
}
},
{
"type": "null"
}
],
"description": "The reactions on the message"
},
"message_reference": {
"anyOf": [
{
"type": "object",
"properties": {
"channel_id": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"description": "The ID of the channel containing the referenced message"
},
"message_id": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$",
"description": "The ID of the referenced message"
},
"guild_id": {
"anyOf": [
{
"$ref": "#/components/schemas/SnowflakeType"
},
{
"type": "null"
}
],
"description": "The ID of the guild containing the referenced message"
},
"type": {
"$ref": "#/components/schemas/MessageReferenceType"
}
},
"required": [
"channel_id",
"message_id",
"type"
]
},
{
"type": "null"
}
],
"description": "Reference data for replies or forwards"
},
"message_snapshots": {
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/MessageSnapshotResponse"
}
},
{
"type": "null"
}
],
"description": "Snapshots of forwarded messages"
},
"nonce": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "A client-provided value for message deduplication"
},
"call": {
"anyOf": [
{
"type": "object",
"properties": {
"participants": {
"type": "array",
"items": {
"type": "string"
},
"description": "The user IDs of participants in the call"
},
"ended_timestamp": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"description": "The ISO 8601 timestamp of when the call ended"
}
},
"required": [
"participants"
]
},
{
"type": "null"
}
],
"description": "Call information if this message represents a call"
}
},
"required": [
"id",
"channel_id",
"author",
"type",
"flags",
"content",
"timestamp",
"pinned",
"mention_everyone",
"tts",
"mentions",
"mention_roles"
]
},
{
"type": "null"
}
],
"description": "The message that this message is replying to or forwarding"
}
},
"required": [
"id",
"channel_id",
"author",
"type",
"flags",
"content",
"timestamp",
"pinned",
"mention_everyone",
"tts",
"mentions",
"mention_roles"
]
}400
Bad Request - The request was malformed or contained invalid data
json
{
"type": "object",
"properties": {
"code": {
"$ref": "#/components/schemas/APIErrorCode"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"type": "array",
"description": "Field-specific validation errors",
"items": {
"$ref": "#/components/schemas/ValidationErrorItem"
}
}
},
"required": [
"code",
"message"
]
}429
Too Many Requests - You are being rate limited
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"RATE_LIMITED"
]
},
"message": {
"type": "string"
},
"retry_after": {
"type": "number",
"description": "Seconds to wait before retrying"
},
"global": {
"type": "boolean",
"description": "Whether this is a global rate limit"
}
},
"required": [
"code",
"message",
"retry_after"
]
}500
Internal Server Error - An unexpected error occurred
json
{
"type": "object",
"properties": {
"code": {
"$ref": "#/components/schemas/APIErrorCode"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"type": "array",
"description": "Field-specific validation errors",
"items": {
"$ref": "#/components/schemas/ValidationErrorItem"
}
}
},
"required": [
"code",
"message"
]
}