Bot API · Bot token

sendMessage

Send a text message into one of the bot's chats

Sends a text message from the bot into one of its threads. chat_id is the dev_bot_threads UUID (per-bot, per-env opaque id); raw user UUIDs are never exposed. A live token can never write into a test thread or another bot's thread. parse_mode is accepted for forward compatibility but v1 renders plain text client-side. DM threads trigger a push notification via send-push; group-thread messages are realtime-only in v1 (no push fan-out).

Request

curl https://api.sprintelex.com/sendMessage \
  -H "Authorization: Bearer <bot-token>" \
  -H "Content-Type: application/json" \
  -d '{"chat_id":"<chat-id-from-update>","text":"Hello from my bot"}'

Parameters

NameTypeRequiredRules
chat_idstringYesmust be a dev_bot_threads id belonging to this bot AND this env
textstringYestrimmed; must not be empty; at most 4096 characters
parse_modestringNoallowed values: HTML, Markdown, MarkdownV2; accepted but ignored in rendering (v1 renders plain text)
reply_to_message_idstringNomust be an existing message id in the same thread (chat_id)
reply_markupobjectNov1 supports inline keyboards only. inline_keyboard: 1-10 rows; each row 1-8 buttons; button text 1-64 chars; each button needs exactly one of callback_data (max 64 chars) or url (must be https)

Response

{ ok: true, result: { message_id, date (unix seconds) } }

Rate limit: 30 calls per 1-second window per bot+env

Errors

StatusErrorWhen
429rate limit exceeded: 30 messages/sec per botmore than 30 calls in 1 second
400chat_id is requiredmissing or empty chat_id
400text must not be emptytext is empty or whitespace
400text must be at most 4096 characterstext longer than 4096 chars
400unsupported parse_mode (HTML, Markdown, MarkdownV2)parse_mode not in the allowed list
400chat not foundno thread with that id for this bot+env
403bot was blocked by the userDM recipient blocked the bot (group threads unaffected)
400reply_to_message_id not found in this chatreply target not in the same thread
400reply_markup must be an objectreply_markup is not an object
400only inline_keyboard markup is supported in v1markup object without inline_keyboard
400inline_keyboard must have 1-10 rowsrow count out of range
400each keyboard row must have 1-8 buttonsbutton count out of range
400each button must be an objecta button is not an object
400button text must be 1-64 charactersbutton text empty or longer than 64
400each button needs exactly one of callback_data or urlbutton has both or neither
400callback_data max 64 characterscallback_data longer than 64
400button url must be httpsbutton url not https
500could not send messageDB insert failed