Message
Message
Messages are the core write/read surface for most bots.
Use message routes to:
- read channel history
- fetch one message
- send a message
- edit a message
- delete a message
- manage reactions and pins
Common public endpoints
| Endpoint | Purpose |
|---|---|
GET /channels/:channel_id/messages | List messages in a channel |
GET /channels/:channel_id/messages/:message_id | Fetch one message |
POST /channels/:channel_id/messages | Send a message |
PATCH /channels/:channel_id/messages/:message_id | Edit a message |
DELETE /channels/:channel_id/messages/:message_id | Delete a message |
DELETE /channels/:channel_id/messages/bulk-delete | Bulk delete messages |
POST /channels/:channel_id/typing | Trigger typing indicator |
GET /channels/:channel_id/messages/pins | List pinned messages |
PUT /channels/:channel_id/pins/:message_id | Pin a message |
DELETE /channels/:channel_id/pins/:message_id | Unpin a message |
Reaction routes:
GET /channels/:channel_id/messages/:message_id/reactions/:emojiPUT /channels/:channel_id/messages/:message_id/reactions/:emoji/@meDELETE /channels/:channel_id/messages/:message_id/reactions/:emoji/@meDELETE /channels/:channel_id/messages/:message_id/reactions/:emoji/:target_idDELETE /channels/:channel_id/messages/:message_id/reactions/:emojiDELETE /channels/:channel_id/messages/:message_id/reactions
Fetch channel history
curl -s \
-H "Authorization: Bot $TOKEN" \
"https://astraof.com/api/v1/channels/<CHANNEL_ID>/messages?limit=50"Supported pagination parameters:
limitbeforeafteraround
Send a message
curl -X POST \
-H "Authorization: Bot $TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"Hello from Astral"}' \
https://astraof.com/api/v1/channels/<CHANNEL_ID>/messagesTypical fields bots use in the request body:
contentembedsattachmentsnonceflags— bitfield (see below)components— action rows containing buttons or select menus (only accepted from webhooks / bot accounts; ignored on user-session sends). See Interactions for the full component schema and click-delivery flow.
For file uploads and attachment rules, see API Reference.
Message flags
flags is a bitfield. Recognised bits:
| Bit | Value | Name | Effect |
|---|---|---|---|
| 1 << 2 | 4 | SUPPRESS_EMBEDS | Do not unfurl links / render URL embeds |
| 1 << 6 | 64 | EPHEMERAL | Message is a private reply — clients hide it from everyone except the author and explicit mentions. Typically set by bots on interaction responses. See ephemeral messages. |
| 1 << 12 | 4096 | SUPPRESS_NOTIFICATIONS | Silent send — users mentioned are not pinged |
Unknown bits are preserved server-side but have no UI effect.
Edit a message
curl -X PATCH \
-H "Authorization: Bot $TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"Edited content"}' \
https://astraof.com/api/v1/channels/<CHANNEL_ID>/messages/<MESSAGE_ID>Delete a message
curl -X DELETE \
-H "Authorization: Bot $TOKEN" \
https://astraof.com/api/v1/channels/<CHANNEL_ID>/messages/<MESSAGE_ID>Reactions
Example: add a reaction for the current bot user.
curl -X PUT \
-H "Authorization: Bot $TOKEN" \
https://astraof.com/api/v1/channels/<CHANNEL_ID>/messages/<MESSAGE_ID>/reactions/%F0%9F%91%8D/@meExample: remove that reaction.
curl -X DELETE \
-H "Authorization: Bot $TOKEN" \
https://astraof.com/api/v1/channels/<CHANNEL_ID>/messages/<MESSAGE_ID>/reactions/%F0%9F%91%8D/@mePins
Pin:
curl -X PUT \
-H "Authorization: Bot $TOKEN" \
https://astraof.com/api/v1/channels/<CHANNEL_ID>/pins/<MESSAGE_ID>Unpin:
curl -X DELETE \
-H "Authorization: Bot $TOKEN" \
https://astraof.com/api/v1/channels/<CHANNEL_ID>/pins/<MESSAGE_ID>Typing indicator
curl -X POST \
-H "Authorization: Bot $TOKEN" \
https://astraof.com/api/v1/channels/<CHANNEL_ID>/typingUse typing sparingly. It is a UX hint, not a durable state.
Invite
Invites are the public join and access mechanism for guilds, channels, and some pack-style resources in Astral, a Discord-compatible platform. This documentation provides a comprehensive reference for working with invites, including endpoint details, field descriptions, JSON examples, and rate limits.
OAuth2
Authenticate users and access the API on their behalf