Bot API · Bot token
editMessage
Edit a message the bot sent
Edits the text of a message previously sent by the bot. Only the bot's own messages (sender_kind='bot') in its own threads can be edited. The edit stamps edited_at and is delivered to the user over realtime; the user sees an 'edited' label.
Request
curl https://api.sprintelex.com/editMessage \
-H "Authorization: Bearer <bot-token>" \
-H "Content-Type: application/json" \
-d '{"chat_id":"<chat-id-from-update>","message_id":"<message-id>","text":"Hello from my bot"}'Parameters
| Name | Type | Required | Rules |
|---|---|---|---|
| chat_id | string (UUID) | Yes | must be a thread of this bot+env |
| message_id | string (UUID) | Yes | must be a bot-sent message in chat_id |
| text | string | Yes | 1-4096 chars, must not be empty |
Response
{ ok: true, result: { message_id, date (unix seconds), edit_date (unix seconds) } }Rate limit: 30 calls per 1-second window per bot+env
Errors
| Status | Error | When |
|---|---|---|
| 400 | chat_id is required | missing chat_id |
| 400 | message_id is required | missing message_id |
| 400 | text must not be empty | text empty/whitespace |
| 400 | text must be at most 4096 characters | text too long |
| 400 | chat not found | no thread with that id for this bot+env |
| 400 | message not found | no message with that id in the chat |
| 400 | only the bot's own messages can be edited | message sender_kind is not 'bot' |
| 429 | rate limit exceeded: 30 messages/sec per bot | more than 30 calls in 1 second |
| 500 | could not edit message | DB update failed |