Bot API guide

Bot API reference

Every endpoint a bot can talk to: path, parameters, body and response. The structure is generated from the backend’s OpenAPI document; the prose is written by hand.

31 endpoints, generated from the backend’s OpenAPI document.

Back to the docs

Identity

Confirm which bot the token belongs to.

GET/api/bot/v1/users/@me

Returns the bot the token belongs to.

Use it as the first call after connecting; an invalid token answers 401.

Responses

Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/users/@me' \
  -H 'Authorization: Bot <token>'

Servers and channels

Installed servers, channels, the emoji catalogue and voice state.

GET/api/bot/v1/servers

Servers the bot is installed in.

Only installed servers appear; installation is performed by a user from the portal.

Responses

Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/servers' \
  -H 'Authorization: Bot <token>'
GET/api/bot/v1/servers/{serverId}/channels

Channels in a server.

Channels the bot cannot see are omitted — channel permission overrides apply here too.

Parameters

serverIdstring<uuid>pathrequired

Responses

Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/servers/<serverId>/channels' \
  -H 'Authorization: Bot <token>'
GET/api/bot/v1/servers/{serverId}/emojis

The server’s custom emoji catalogue.

The `customEmojiId` used when reacting comes from this list.

Parameters

serverIdstring<uuid>pathrequired

Responses

Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/servers/<serverId>/emojis' \
  -H 'Authorization: Bot <token>'

Messages

Reading, sending, editing, deleting and the typing indicator.

GET/api/bot/v1/channels/{channelId}/messages

Reads channel messages, paginated.

Page backwards with `before`; `limit` defaults to 50.

Parameters

channelIdstring<uuid>pathrequired
beforestring<uuid>queryoptional
limitinteger<int32>querydefault: 50

Responses

Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages' \
  -H 'Authorization: Bot <token>'
POST/api/bot/v1/channels/{channelId}/messages

Sends a message to a channel.

To attach files, open an upload session first and pass the returned keys in `attachments`.

Parameters

channelIdstring<uuid>pathrequired

Request body CreateBotMessageRequest

contentstringrequired
replyToMessageIdstring<uuid>?optional
attachmentsMessageAttachmentDraftRequest[]?optional

Responses

Example request
curl -X POST 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages' \
  -H 'Authorization: Bot <token>' \
  -H 'Content-Type: application/json' \
  -d '{"content":"<string>"}'
DELETE/api/bot/v1/channels/{channelId}/messages/{messageId}

Deletes a message.

Fine for its own message; deleting someone else’s needs the ManageMessages permission.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired

Responses

  • 200no body
Example request
curl -X DELETE 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>' \
  -H 'Authorization: Bot <token>'
GET/api/bot/v1/channels/{channelId}/messages/{messageId}

Fetches a single message.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired

Responses

Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>' \
  -H 'Authorization: Bot <token>'
PATCH/api/bot/v1/channels/{channelId}/messages/{messageId}

Edits the bot’s own message.

Only messages the bot wrote can be edited; anything else answers 403.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired

Request body EditMessageRequest

contentstringrequired
suppressLinkPreviewbooleanoptional

Responses

Example request
curl -X PATCH 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>' \
  -H 'Authorization: Bot <token>' \
  -H 'Content-Type: application/json' \
  -d '{"content":"<string>"}'
GET/api/bot/v1/channels/{channelId}/messages/{messageId}/context

Fetches the messages around one message.

For building context behind a notification or reply; size the window with `before` and `after`.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired
beforeinteger<int32>querydefault: 25
afterinteger<int32>querydefault: 25

Responses

Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>/context' \
  -H 'Authorization: Bot <token>'
POST/api/bot/v1/channels/{channelId}/typing

Shows the typing indicator in a channel.

The indicator fades after a few seconds; call again during long work.

Parameters

channelIdstring<uuid>pathrequired

Responses

  • 200no body
Example request
curl -X POST 'https://api.talkith.com/api/bot/v1/channels/<channelId>/typing' \
  -H 'Authorization: Bot <token>'

Reactions

React as the bot, remove someone else’s, or clear them all.

DELETE/api/bot/v1/channels/{channelId}/messages/{messageId}/reactions

Clears every reaction on a message.

Requires ManageReactions or ManageMessages.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired
Example request
curl -X DELETE 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>/reactions' \
  -H 'Authorization: Bot <token>'
GET/api/bot/v1/channels/{channelId}/messages/{messageId}/reactions

Returns the reaction summary for a message.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired
unicodeEmojistringqueryoptional
customEmojiIdstring<uuid>queryoptional
Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>/reactions' \
  -H 'Authorization: Bot <token>'
GET/api/bot/v1/channels/{channelId}/messages/{messageId}/reactions/details

Returns reactions along with the users who added them.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired
unicodeEmojistringqueryoptional
customEmojiIdstring<uuid>queryoptional
Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>/reactions/details' \
  -H 'Authorization: Bot <token>'
DELETE/api/bot/v1/channels/{channelId}/messages/{messageId}/reactions/me

Removes the bot’s own reaction.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired

Request body ReactionMutationRequest

unicodeEmojistring?required
customEmojiIdstring<uuid>?required
Example request
curl -X DELETE 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>/reactions/me' \
  -H 'Authorization: Bot <token>' \
  -H 'Content-Type: application/json' \
  -d '{"unicodeEmoji":"<string?>","customEmojiId":"<string<uuid>?>"}'
PUT/api/bot/v1/channels/{channelId}/messages/{messageId}/reactions/me

Adds a reaction as the bot.

Send either `unicodeEmoji` or `customEmojiId` in the body, never both.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired

Request body ReactionMutationRequest

unicodeEmojistring?required
customEmojiIdstring<uuid>?required
Example request
curl -X PUT 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>/reactions/me' \
  -H 'Authorization: Bot <token>' \
  -H 'Content-Type: application/json' \
  -d '{"unicodeEmoji":"<string?>","customEmojiId":"<string<uuid>?>"}'
DELETE/api/bot/v1/channels/{channelId}/messages/{messageId}/reactions/users/{userId}

Removes another user’s reaction.

Requires the ManageReactions permission.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired
userIdstring<uuid>pathrequired

Request body ReactionMutationRequest

unicodeEmojistring?required
customEmojiIdstring<uuid>?required
Example request
curl -X DELETE 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>/reactions/users/<userId>' \
  -H 'Authorization: Bot <token>' \
  -H 'Content-Type: application/json' \
  -d '{"unicodeEmoji":"<string?>","customEmojiId":"<string<uuid>?>"}'

Attachments

Signed upload sessions and time-limited download URLs.

GET/api/bot/v1/channels/{channelId}/messages/{messageId}/attachments/{attachmentId}/access-url

Mints a time-limited download URL for an attachment.

The URL is short lived; mint one when you need it rather than storing it.

Parameters

channelIdstring<uuid>pathrequired
messageIdstring<uuid>pathrequired
attachmentIdstring<uuid>pathrequired
Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/<messageId>/attachments/<attachmentId>/access-url' \
  -H 'Authorization: Bot <token>'
POST/api/bot/v1/channels/{channelId}/messages/attachments/upload-session

Opens a signed upload session for an attachment.

Upload the file straight to the returned address, then send the message with `attachments`.

Parameters

channelIdstring<uuid>pathrequired

Request body CreateMessageAttachmentUploadSessionRequest

fileNamestringrequired
contentTypestringrequired
sizeinteger<int64>required
Example request
curl -X POST 'https://api.talkith.com/api/bot/v1/channels/<channelId>/messages/attachments/upload-session' \
  -H 'Authorization: Bot <token>' \
  -H 'Content-Type: application/json' \
  -d '{"fileName":"<string>","contentType":"<string>","size":"<integer<int64>>"}'

Voice and WHIP

Join and leave voice channels, and open ingress for music streaming.

DELETE/api/bot/v1/channels/{channelId}/voice/ingress

Closes the WHIP ingress session.

Always call it when the stream ends; a session left open leaves a silent participant behind.

Parameters

channelIdstring<uuid>pathrequired

Responses

  • 200no body
Example request
curl -X DELETE 'https://api.talkith.com/api/bot/v1/channels/<channelId>/voice/ingress' \
  -H 'Authorization: Bot <token>'
POST/api/bot/v1/channels/{channelId}/voice/ingress

Opens an ingress session for a WHIP stream.

Music bots publish stereo Opus through this, connecting as a WebRTC publisher.

Parameters

channelIdstring<uuid>pathrequired
Example request
curl -X POST 'https://api.talkith.com/api/bot/v1/channels/<channelId>/voice/ingress' \
  -H 'Authorization: Bot <token>'
POST/api/bot/v1/channels/{channelId}/voice/join

Connects the bot to a voice channel and returns a LiveKit token.

Connect to LiveKit directly with the token; the server is not a relay.

Parameters

channelIdstring<uuid>pathrequired
Example request
curl -X POST 'https://api.talkith.com/api/bot/v1/channels/<channelId>/voice/join' \
  -H 'Authorization: Bot <token>'
POST/api/bot/v1/channels/{channelId}/voice/leave

Disconnects the bot from the voice channel.

Parameters

channelIdstring<uuid>pathrequired

Responses

  • 200no body
Example request
curl -X POST 'https://api.talkith.com/api/bot/v1/channels/<channelId>/voice/leave' \
  -H 'Authorization: Bot <token>'
GET/api/bot/v1/servers/{serverId}/voice-state

Current participants of the server’s voice channels.

This is a snapshot; follow changes through the gateway’s VoiceStateChanged event.

Parameters

serverIdstring<uuid>pathrequired
Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/servers/<serverId>/voice-state' \
  -H 'Authorization: Bot <token>'

Commands

List slash commands and sync the whole set at once.

GET/api/bot/v1/commands

Slash commands registered by the application.

Responses

Example request
curl -X GET 'https://api.talkith.com/api/bot/v1/commands' \
  -H 'Authorization: Bot <token>'
PUT/api/bot/v1/commands

Replaces the whole command list.

Commands you leave out are deleted — this is a full sync, not a merge.

Request body SyncBotCommandsRequest

commandsSyncBotCommandItemDto[]required

Responses

Example request
curl -X PUT 'https://api.talkith.com/api/bot/v1/commands' \
  -H 'Authorization: Bot <token>' \
  -H 'Content-Type: application/json' \
  -d '{"commands":"<SyncBotCommandItemDto[]>"}'

Interactions

Acknowledge, defer and answer the interaction a command produces.

POST/api/bot/v1/interactions/{interactionId}/ack

Acknowledges the interaction.

A command must be answered quickly after the user runs it, or the interaction expires.

Parameters

interactionIdstring<uuid>pathrequired

Responses

  • 200no body
Example request
curl -X POST 'https://api.talkith.com/api/bot/v1/interactions/<interactionId>/ack' \
  -H 'Authorization: Bot <token>'
POST/api/bot/v1/interactions/{interactionId}/defer

Defers the answer and shows a thinking state.

For slow work, defer first and fill in the response when the work finishes.

Parameters

interactionIdstring<uuid>pathrequired

Responses

  • 200no body
Example request
curl -X POST 'https://api.talkith.com/api/bot/v1/interactions/<interactionId>/defer' \
  -H 'Authorization: Bot <token>'
POST/api/bot/v1/interactions/{interactionId}/follow-ups

Sends an extra message after the response.

Parameters

interactionIdstring<uuid>pathrequired

Request body CreateBotInteractionResponseRequest

contentstring?required
replyToMessageIdstring<uuid>?optional
attachmentsMessageAttachmentDraftRequest[]?optional
ephemeralbooleanoptional

Responses

Example request
curl -X POST 'https://api.talkith.com/api/bot/v1/interactions/<interactionId>/follow-ups' \
  -H 'Authorization: Bot <token>' \
  -H 'Content-Type: application/json' \
  -d '{"content":"<string?>"}'
PATCH/api/bot/v1/interactions/{interactionId}/response

Updates a response that was already sent.

Parameters

interactionIdstring<uuid>pathrequired

Request body EditMessageRequest

contentstringrequired
suppressLinkPreviewbooleanoptional

Responses

Example request
curl -X PATCH 'https://api.talkith.com/api/bot/v1/interactions/<interactionId>/response' \
  -H 'Authorization: Bot <token>' \
  -H 'Content-Type: application/json' \
  -d '{"content":"<string>"}'
POST/api/bot/v1/interactions/{interactionId}/response

Sends the response to an interaction.

Parameters

interactionIdstring<uuid>pathrequired

Request body CreateBotInteractionResponseRequest

contentstring?required
replyToMessageIdstring<uuid>?optional
attachmentsMessageAttachmentDraftRequest[]?optional
ephemeralbooleanoptional

Responses

Example request
curl -X POST 'https://api.talkith.com/api/bot/v1/interactions/<interactionId>/response' \
  -H 'Authorization: Bot <token>' \
  -H 'Content-Type: application/json' \
  -d '{"content":"<string?>"}'

Schemas

The fields of the bodies endpoints return and expect. This list is generated from the OpenAPI document too.

BotMeDto
applicationIdstring<uuid>required
botUserIdstring<uuid>required
usernamestringrequired
displayNamestringrequired
BotServerDto
idstring<uuid>required
namestringrequired
memberCountinteger<int32>required
BotChannelDto
idstring<uuid>required
serverIdstring<uuid>required
namestringrequired
typestringrequired
positioninteger<int32>required
topicstring?required
BotCommandDto
idstring<uuid>required
namestringrequired
descriptionstringrequired
optionsBotCommandOptionDto[]required
createdAtstring<date-time>required
CustomEmojiDto
idstring<uuid>required
namestringrequired
imageUrlstringrequired
sourceServerIdstring<uuid>required
sourceServerNamestringrequired
isExternalbooleanrequired
isAnimatedbooleanrequired
MessagePageDto
messagesMessageDto[]required
hasMorebooleanrequired
oldestIdstring<uuid>?required
MessageDto
idstring<uuid>required
channelIdstring<uuid>required
authorIdstring<uuid>required
authorUsernamestringrequired
authorDisplayNamestringrequired
authorAvatarUrlstring?required
replyToobjectrequired
contentstringrequired
attachmentsMessageAttachmentDto[]required
linkPreviewobjectrequired
reactionsReactionSummaryDto[]required
pollobjectrequired
forwardedFromobjectrequired
editedAtstring<date-time>?required
pinnedAtstring<date-time>?required
pinnedByUserIdstring<uuid>?required
isDeletedbooleanrequired
createdAtstring<date-time>required
EditMessageRequest
contentstringrequired
suppressLinkPreviewbooleanoptional
MessageContextDto
serverIdstring<uuid>required
channelIdstring<uuid>required
messageIdstring<uuid>required
messagesMessageDto[]required
hasOlderbooleanrequired
hasNewerbooleanrequired
CreateMessageAttachmentUploadSessionRequest
fileNamestringrequired
contentTypestringrequired
sizeinteger<int64>required
MessageAttachmentUploadSessionDto
uploadUrlstringrequired
objectKeystringrequired
publicUrlstringrequired
fieldsobjectrequired
expiresAtstring<date-time>required
maxBytesinteger<int64>required
MessageAttachmentAccessUrlDto
attachmentIdstring<uuid>required
urlstringrequired
expiresAtstring<date-time>required
ReactionMutationRequest
unicodeEmojistring?required
customEmojiIdstring<uuid>?required
MessageReactionUpdateDto
channelIdstring<uuid>required
messageIdstring<uuid>required
reactionsReactionSummaryDto[]required
MessageReactionDetailsDto
channelIdstring<uuid>required
messageIdstring<uuid>required
reactionsReactionUsersGroupDto[]required
BotVoiceJoinResponseDto
tokenstringrequired
urlstringrequired
channelIdstring<uuid>required
participantsVoiceParticipantDto[]required
BotVoiceIngressResponseDto
ingressIdstringrequired
urlstringrequired
streamKeystringrequired
channelIdstring<uuid>required
participantsVoiceParticipantDto[]required
CreateBotInteractionResponseRequest
contentstring?required
replyToMessageIdstring<uuid>?optional
attachmentsMessageAttachmentDraftRequest[]?optional
ephemeralbooleanoptional

Event gateway

REST endpoints run when you start the request; the gateway tells you what happened. The WebSocket opens with HELLO, authenticates with IDENTIFY, and declares which events it wants through intents.

Connection frames

HELLOfrom serverArrives from the server as soon as the socket opens, carrying the heartbeat interval.
IDENTIFYfrom botSends the bot token and the list of intents it wants.
READYfrom serverIdentity accepted; the bot will now receive events.
HEARTBEATfrom botSent on the interval given in HELLO.
HEARTBEAT_ACKfrom serverThe reply to each heartbeat; its absence means the connection is gone.
DISPATCHfrom serverEvery event travels inside this envelope, with the event name in a field.

SERVER_MESSAGES

Message events in servers where the bot is installed.

  • MESSAGE_CREATEA new message landed in a channel.
  • MESSAGE_UPDATEAn existing message was edited.
  • MESSAGE_DELETEA message was deleted; the body carries identifiers only.

MESSAGE_REACTIONS

Reactions added to and removed from messages.

  • MESSAGE_REACTION_ADDA reaction was added to a message.
  • MESSAGE_REACTION_REMOVEA reaction was removed.

SERVER_VOICE

Joining and leaving voice channels.

  • VOICE_STATE_UPDATESomeone joined or left a voice channel.

APPLICATION_COMMANDS

The interaction produced when a user runs a slash command.

  • APPLICATION_COMMANDA slash command ran and must be answered through the interaction endpoints.