Bot API · Bot token
deleteMessage
Delete a message the bot sent
Deletes a message previously sent by the bot. Only the bot's own messages in its own threads can be deleted. The deletion is delivered to the user over realtime; the message vanishes. Replies to the deleted message survive (reply_to set null).
Request
curl https://api.sprintelex.com/deleteMessage \
-H "Authorization: Bearer <bot-token>" \
-H "Content-Type: application/json" \
-d '{"chat_id":"<chat-id-from-update>","message_id":"<message-id>"}'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 |
Response
{ ok: true, result: true }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 | 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 deleted | 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 delete message | DB delete failed |