Overview
TheSendMessage request allows you to send messages to any chat type (users, groups, channels, or saved messages). Messages can include text content, media attachments, reply references, and formatting entities.
Proto Definition
Request Fields
The target chat where the message will be sent. Can be a user (DM), channel, group, or self (saved messages). See ChatRef types for details.
The text content of the message. Can be empty if media is attached. Supports formatting through entities.
The message ID to reply to. Creates a reply reference in the UI. Must be a valid message ID in the same chat.Type: Snowflake ID representing a Message
Array of media attachments to include with the message. Can contain uploaded files or embed URLs.Each
MediaRef can be:uploaded- A file that was uploaded using the media upload APIembed- An embed URL that will be previewed
Formatting entities that apply styles to portions of the message text. Includes bold, italic, mentions, links, code blocks, and more.See Message Entities for the complete list of supported entities.
Response
The snowflake ID of the newly created message. Use this ID for editing, deleting, or replying to the message.
Examples
Send a Simple Text Message
Send a Message with Reply
Send a Formatted Message
Send a Message with Media
Send to Saved Messages
Media Attachments
When including media, you can attach either uploaded files or embeds:Uploaded File
Embed URL
Notes
- The
messagefield can be empty if you’re sending media-only messages - Entity indices are 0-based and measured in Unicode code points
- Multiple entities can overlap (e.g., bold + italic)
- The server assigns the message ID and returns it in the response
- Messages are delivered in real-time to all participants in the chat