Webhook certificate too large · webhook.certificate_too_large
Stable ID: webhook.certificate_too_large · Evidence: source derived
The uploaded webhook certificate exceeds the server’s size limit.
The captured size describes the rejected upload; it is not the configured limit or a Telegram media limit.
When it matches
Section titled “When it matches”Every field in a rule must match. Alternative rules are joined with OR. Codes below are JSON response fields, not inferred HTTP statuses.
- JSON
error_code: 400.
Description template; literal text must match exactly:
Bad Request: certificate size is too big ({size_bytes} bytes)size_bytes: a positive safe integer, captured from the description.
See matching rules for parameter precedence and unknown or ambiguous results.
Illustrative methods: setWebhook.
Possible causes
Section titled “Possible causes”- The uploaded certificate file is larger than MAX_CERTIFICATE_FILE_SIZE.
Before deciding what to do
Section titled “Before deciding what to do”Application decision: correct webhook certificate file. Repeat request: after payload change.
- Verify that the uploaded file is the intended certificate and satisfies this server revision’s limit.
These are application choices. Errorgram does not retry, suppress the error, or change bot state.
Values extracted into result.facts:
size_bytes: a positive safe integer, fromdescription.
Version-specific metadata is available in result.entry under facts.
These values are catalogue metadata, not measurements from the response.
{ "verified_limit_bytes": 3145728, "limit_version_source": "server-10.3"}Example
Section titled “Example”Synthetic examples derived from the cited source.
API method: setWebhook.
{ "ok": false, "error_code": 400, "description": "Bad Request: certificate size is too big (4194304 bytes)"}Python
Section titled “Python”from errorgram import classify
response = { "ok": False, "error_code": 400, "description": "Bad Request: certificate size is too big (4194304 bytes)",}result = classify(response, method='setWebhook')
assert result.id == 'webhook.certificate_too_large'print(result.entry["summary"])JavaScript and TypeScript
Section titled “JavaScript and TypeScript”import { classify } from "errorgram";
const response = { "ok": false, "error_code": 400, "description": "Bad Request: certificate size is too big (4194304 bytes)"};const result = classify(response, { method: "setWebhook" });
if (result.status === "matched" && result.id === "webhook.certificate_too_large") { console.log(result.entry.summary);}Framework names
Section titled “Framework names”| Integration | Type or ID |
|---|---|
| Python | errorgram.WebhookCertificateTooLarge |
| aiogram | errorgram.aiogram.WebhookCertificateTooLarge extends TelegramBadRequest |
| grammY | EnrichedGrammyError with classification.id equal to webhook.certificate_too_large |
Enrichment is explicit and keeps framework catch compatibility. Follow the Python and aiogram guide or JavaScript, TypeScript, and grammY guide.
Evidence
Section titled “Evidence”- Bot API 10.3 · telegram-bot-api/Client.cpp:17261–17266. The description interpolates the actual file size; one literal string cannot represent all responses. Revision
e3e9dd8e5b3d7ab8537cd5a10dc31d5ffa8f82d1. - Bot API 10.3 · telegram-bot-api/Client.h:71. The constant is 3 << 20 bytes in this revision. Revision
e3e9dd8e5b3d7ab8537cd5a10dc31d5ffa8f82d1.
Source references identify the reviewed revision, not the first release that introduced this response.
Data and versions
Section titled “Data and versions”Catalogue 0.1.0 · schema 1.0.0 · reviewed 2026-09-15.
Markdown · Condition JSON · Full catalogue and sources · JSON Schema