Telegram error 400: Bad Request: message is too long
Last verified against Telegram Bot API reference
Bad Request: message is too longWhat error 400 means
The text of a sendMessage or editMessageText call exceeds 4,096 characters after entity parsing. Telegram refuses the entire message; it does not truncate or split for you. Captions have a separate, lower limit of 1,024 characters and fail with a caption-specific description, but the text limit is by far the one people hit.
The limit is in characters, not bytes, and it is measured after parsing, so markup characters in MarkdownV2 or HTML do not count but the visible text does. Emoji and non-Latin scripts count as one character each even though they are multiple bytes.
This is the classic failure mode for bots that relay AI output, long help texts, or log dumps. It is deterministic: any message over the limit fails every time, and any message under it succeeds, regardless of what else is happening.
What it looks like
{"ok":false,"error_code":400,"description":"Bad Request: message is too long"}Why it happens
- AI-generated or templated replies with no length cap.
- Concatenating a list (orders, search results, logs) into one message.
- Pasting a long FAQ or terms text into a single /help response.
- Counting bytes instead of characters and assuming there is headroom.
How to fix Telegram error 400
- 1Split on paragraph or sentence boundaries into chunks of at most 4,096 characters and send sequentially.
- 2Cap generated text at the source (max tokens, or a post-processing trim) and append a 'more' button that loads the rest.
- 3For lists, paginate with an inline keyboard rather than one giant message.
- 4For very long content, send a document instead of text.
How to stop it recurring
Enforce the 4,096-character limit in a shared send helper that chunks automatically, with a short delay between chunks to respect the roughly one message per second per chat guidance. Keep captions under 1,024 characters with the same helper. See the full list of values on the Telegram limits page.
If the oversized text also carries formatting, fix chunking before formatting: cutting MarkdownV2 mid-entity produces can't parse entities on the retry. Chunked sends should also respect the per-chat pacing under rate limits or a long answer can trade a 400 for a 429.
Official reference: Telegram Bot API reference. See all Telegram error codes or the Telegram limits and quotas.
Related codes
Error 400 - quick answers
What does Telegram error 400 mean?
The text of a sendMessage or editMessageText call exceeds 4,096 characters after entity parsing. Telegram refuses the entire message; it does not truncate or split for you. Captions have a separate, lower limit of 1,024 characters and fail with a caption-specific description, but the text limit is by far the one people hit.
How do I fix Telegram error 400?
1. Split on paragraph or sentence boundaries into chunks of at most 4,096 characters and send sequentially. 2. Cap generated text at the source (max tokens, or a post-processing trim) and append a 'more' button that loads the rest. 3. For lists, paginate with an inline keyboard rather than one giant message. 4. For very long content, send a document instead of text.
Should I retry after error 400?
No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.
Stop debugging Telegram by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.