AstralAPI Docs
Resources

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

EndpointPurpose
GET /channels/:channel_id/messagesList messages in a channel
GET /channels/:channel_id/messages/:message_idFetch one message
POST /channels/:channel_id/messagesSend a message
PATCH /channels/:channel_id/messages/:message_idEdit a message
DELETE /channels/:channel_id/messages/:message_idDelete a message
DELETE /channels/:channel_id/messages/bulk-deleteBulk delete messages
POST /channels/:channel_id/typingTrigger typing indicator
GET /channels/:channel_id/messages/pinsList pinned messages
PUT /channels/:channel_id/pins/:message_idPin a message
DELETE /channels/:channel_id/pins/:message_idUnpin a message

Reaction routes:

  • GET /channels/:channel_id/messages/:message_id/reactions/:emoji
  • PUT /channels/:channel_id/messages/:message_id/reactions/:emoji/@me
  • DELETE /channels/:channel_id/messages/:message_id/reactions/:emoji/@me
  • DELETE /channels/:channel_id/messages/:message_id/reactions/:emoji/:target_id
  • DELETE /channels/:channel_id/messages/:message_id/reactions/:emoji
  • DELETE /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:

  • limit
  • before
  • after
  • around

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>/messages

Typical fields bots use in the request body:

  • content
  • embeds
  • attachments
  • nonce
  • flags — 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:

BitValueNameEffect
1 << 24SUPPRESS_EMBEDSDo not unfurl links / render URL embeds
1 << 664EPHEMERALMessage 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 << 124096SUPPRESS_NOTIFICATIONSSilent 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/@me

Example: 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/@me

Pins

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>/typing

Use typing sparingly. It is a UX hint, not a durable state.

On this page

Astral API Docs | Message