Skip to content

IMessages

v1 stable

/IMessages/v1/

Send messages with text and files, and retrieve message history from channels.

Authentication required

All endpoints require Authorization: Bot <token> header. Get a token →

GET /IMessages/v1/History ReadHistory

Gets message history for a channel. Supports pagination via from (message ID) and limit (1–100, default 50).

Query Parameters

Field Type
channelId
uuid
from
int64 | null
limit
int32 | null

Response MessageHistoryResponse

Field Type
messages MessageDto[]
↳ messageId int64
↳ channelId uuid
↳ spaceId uuid
↳ text string
↳ creatorId uuid
↳ createdAt date-time
↳ replyTo int64 | null
↳ entities MessageEntityAttachment | MessageEntityBold | MessageEntityCapitalized | MessageEntityEmail | MessageEntityFraction | MessageEntityGif | MessageEntityHashTag | MessageEntityItalic | MessageEntityLinkPreview | MessageEntityMention | MessageEntityMentionEveryone | MessageEntityMentionRole | MessageEntityMonospace | MessageEntityOrdinal | MessageEntityQuote | MessageEntitySpoiler | MessageEntityStrikethrough | MessageEntitySystemCallEnded | MessageEntitySystemCallStarted | MessageEntitySystemCallTimeout | MessageEntitySystemUserJoined | MessageEntityUnderline | MessageEntityUrl[]
↳ controls ControlRowV1[] | null
↳ controls BotControlV1[]
↳ type ControlType
↳ variant any | ButtonVariant | null
↳ label string | null
↳ labelLocalizations object | null
↳ id string | null
↳ url string | null
↳ colour any | OklchColor | null
↳ disabled boolean | null
↳ customId string | null
↳ placeholder string | null
↳ minValues int32 | null
↳ maxValues int32 | null
↳ options SelectOptionV1[] | null
↳ label string
↳ value string
↳ description string | null
↳ default boolean | null
↳ requiredArchetypeId uuid | null
↳ reactions ReactionDto[] | null
↳ emoji string
↳ count int32
↳ userIds uuid[]
↳ customEmojiId uuid | null
↳ attachments BotAttachmentV1[] | null
↳ fileId uuid
↳ url string
↳ fileName string
↳ size int64
↳ contentType string
↳ width int32 | null
↳ height int32 | null

Example

curl -X GET \
     -H "Authorization: Bot YOUR_TOKEN" \
     "https://gateway.argon.zone/IMessages/v1/History?channelId=...&from=...&limit=..."
POST /IMessages/v1/Send SendMessages

Sends a message to a channel. Include a unique randomId for deduplication; reply to another message via replyTo. attachments (at most 10, AttachFiles) are fileIds from IFiles/Upload with purpose attachment, or, in a multipart request with the same fields, parts, attach://<part> references or parts named attachments; the parts of one request share its 10 MiB limit. The response describes the attachments. Bots cannot post in announcement channels.

Request Body SendMessageRequest JSON or multipart/form-data

Send the body as JSON, or as multipart/form-data with the same fields — each a text part, a list repeated once per value or given as one JSON array, and an object or a list of objects as its JSON. In JSON a file is the fileId of an IFiles/Upload; a form may also carry it as a part of the field's name or as attach://<part>. See Files & Attachments.

Field Type
channelId
uuid
text
string
randomId
int64
replyTo
int64 | null
entities
MessageEntityAttachment | MessageEntityBold | MessageEntityCapitalized | MessageEntityEmail | MessageEntityFraction | MessageEntityGif | MessageEntityHashTag | MessageEntityItalic | MessageEntityLinkPreview | MessageEntityMention | MessageEntityMentionEveryone | MessageEntityMentionRole | MessageEntityMonospace | MessageEntityOrdinal | MessageEntityQuote | MessageEntitySpoiler | MessageEntityStrikethrough | MessageEntitySystemCallEnded | MessageEntitySystemCallStarted | MessageEntitySystemCallTimeout | MessageEntitySystemUserJoined | MessageEntityUnderline | MessageEntityUrl[] | null
controls
ControlRowV1[] | null
↳ controls
BotControlV1[]
↳ type
ControlType
↳ variant
any | ButtonVariant | null
↳ label
string | null
↳ labelLocalizations
object | null
↳ id
string | null
↳ url
string | null
↳ colour
any | OklchColor | null
↳ disabled
boolean | null
↳ customId
string | null
↳ placeholder
string | null
↳ minValues
int32 | null
↳ maxValues
int32 | null
↳ options
SelectOptionV1[] | null
↳ label
string
↳ value
string
↳ description
string | null
↳ default
boolean | null
↳ requiredArchetypeId
uuid | null
attachments
file[] | null

A file: the part of this name itself, or a text field holding attach://<name> (another part of the request) or the fileId of an IFiles/Upload.

Response SendMessageResponse

Field Type
messageId int64
attachments BotAttachmentV1[] | null
↳ fileId uuid
↳ url string
↳ fileName string
↳ size int64
↳ contentType string
↳ width int32 | null
↳ height int32 | null

Errors

Status Code Description
400 invalid_format An attached file is empty.
400 invalid_request The form could not be read: a field is missing or malformed, or an attach:// reference names no part.
400 validation_error The message is not valid for this channel.
403 cannot_send Bot may not post this message in this channel.
403 insufficient_permissions Bot does not have AttachFiles permission in this channel.
404 not_found An attachment's fileId names no upload of this bot with purpose attachment, or one over 24 hours old.
413 too_large The request, or a file in it, is over the size limit.
429 slow_mode The channel is holding messages back; retry later.

Example

curl -X POST \
     -H "Authorization: Bot YOUR_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"channelId":"...","text":"...","randomId":"0","replyTo":null,"entities":null,"controls":null,"attachments":null}' \
     https://gateway.argon.zone/IMessages/v1/Send