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
| Name | Type | Required | Rules |
|---|---|---|---|
| chat_id | string | Yes | must be a dev_bot_threads id belonging to this bot AND this env |
| text | string | Yes | trimmed; must not be empty; at most 4096 characters |
| parse_mode | string | No | allowed values: HTML, Markdown, MarkdownV2; accepted but ignored in rendering (v1 renders plain text) |
| reply_to_message_id | string | No | must be an existing message id in the same thread (chat_id) |
| reply_markup | object | No | v1 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
| Status | Error | When |
|---|---|---|
| 429 | rate limit exceeded: 30 messages/sec per bot | more than 30 calls in 1 second |
| 400 | chat_id is required | missing or empty chat_id |
| 400 | text must not be empty | text is empty or whitespace |
| 400 | text must be at most 4096 characters | text longer than 4096 chars |
| 400 | unsupported parse_mode (HTML, Markdown, MarkdownV2) | parse_mode not in the allowed list |
| 400 | chat not found | no thread with that id for this bot+env |
| 403 | bot was blocked by the user | DM recipient blocked the bot (group threads unaffected) |
| 400 | reply_to_message_id not found in this chat | reply target not in the same thread |
| 400 | reply_markup must be an object | reply_markup is not an object |
| 400 | only inline_keyboard markup is supported in v1 | markup object without inline_keyboard |
| 400 | inline_keyboard must have 1-10 rows | row count out of range |
| 400 | each keyboard row must have 1-8 buttons | button count out of range |
| 400 | each button must be an object | a button is not an object |
| 400 | button text must be 1-64 characters | button text empty or longer than 64 |
| 400 | each button needs exactly one of callback_data or url | button has both or neither |
| 400 | callback_data max 64 characters | callback_data longer than 64 |
| 400 | button url must be https | button url not https |
| 500 | could not send message | DB insert failed |