No codes match. Try a number like 4 or a word like timeout.
Continue
The server received the request headers; the client may send the body.
What a bot should do: Handled by your HTTP library; rarely seen in bot code.
Switching Protocols
The server agrees to switch protocols, typically to WebSocket.
What a bot should do: Expected when a gateway connection (Discord, Slack Socket Mode) upgrades to WebSocket.
OK
The request succeeded.
What a bot should do: Success. For webhooks, return 200 quickly so the platform does not retry.
Created
A new resource was created.
What a bot should do: Success; read the Location header or body for the new resource id.
Accepted
Accepted for processing, but not finished yet.
What a bot should do: Ideal webhook reply when you queue work for later. Poll or wait for a callback for the result.
No Content
Success with no response body.
What a bot should do: Success. Do not try to parse JSON from the empty body. Discord returns this for many actions.
Partial Content
Only part of the resource is returned, as requested by a Range header.
What a bot should do: Used when resuming large file downloads.
Moved Permanently
The resource has a new permanent URL.
What a bot should do: Update the URL in your config. Webhook senders usually do not follow redirects, so register the final URL.
Found
Temporary redirect to another URL.
What a bot should do: Follow it for GET requests if your client allows; do not rely on it for webhook endpoints.
Not Modified
The cached copy is still valid (conditional request).
What a bot should do: Good news for scrapers and feed readers: reuse your cached copy and save bandwidth.
Temporary Redirect
Temporary redirect that keeps the method and body.
What a bot should do: Safe to repeat the same POST at the new URL.
Permanent Redirect
Permanent redirect that keeps the method and body.
What a bot should do: Update stored URLs; repeat the request at the new location.
Bad Request
The request is malformed or has invalid parameters.
What a bot should do: Do not retry unchanged. Log the error description: Telegram and Discord explain exactly which field is wrong.
Unauthorized
Missing or invalid authentication.
What a bot should do: Check the token and header format (Bot, Bearer). Stop and alert: retrying will not help and may get the token flagged.
Forbidden
Authenticated, but not allowed to do this.
What a bot should do: Missing permissions or scopes, or the user blocked the bot. Do not retry; mark the chat as inactive if blocked.
Not Found
The resource or endpoint does not exist.
What a bot should do: Check the path, API version and ids. For a deleted message or channel, drop the job.
Method Not Allowed
The endpoint does not accept this HTTP method.
What a bot should do: Use the documented method (often POST). Your own webhook should return 405 for GET if it only accepts POST.
Not Acceptable
The server cannot produce the format requested in Accept.
What a bot should do: Send Accept: application/json or remove the header.
Request Timeout
The server gave up waiting for the request.
What a bot should do: Retry with backoff; check for slow uploads.
Conflict
The request conflicts with the current state.
What a bot should do: Telegram returns 409 when getUpdates runs while a webhook is set, or two pollers run at once. Fix the setup, do not retry.
Gone
The resource was removed permanently.
What a bot should do: Remove it from your database and stop requesting it.
Length Required
A Content-Length header is required.
What a bot should do: Send the body as a buffer or string so the client sets Content-Length.
Precondition Failed
A conditional header (If-Match) did not match.
What a bot should do: Someone else changed the resource; refetch and reapply.
Content Too Large
The request body is too large.
What a bot should do: Compress or split the file, or use the platform's upload endpoint and size limits.
URI Too Long
The URL is too long.
What a bot should do: Move parameters from the query string into a POST body.
Unsupported Media Type
The body format is not supported.
What a bot should do: Set the right Content-Type (application/json, multipart/form-data).
I'm a teapot
An April Fools' joke code from RFC 2324, sometimes used to refuse bots.
What a bot should do: Treat it like 403: the site does not want automated traffic.
Unprocessable Content
Well-formed request with semantic errors (validation failed).
What a bot should do: Fix the payload using the validation details; do not retry unchanged.
Too Early
The server will not process a request that might be replayed.
What a bot should do: Retry after the TLS handshake completes (avoid 0-RTT for non-idempotent calls).
Upgrade Required
The client must switch to another protocol.
What a bot should do: Upgrade TLS or HTTP version as indicated by the Upgrade header.
Precondition Required
The server requires a conditional request.
What a bot should do: Send If-Match with the current ETag.
Too Many Requests
Rate limit exceeded.
What a bot should do: Wait for Retry-After (Telegram: parameters.retry_after, Discord: retry_after in seconds) then retry with jittered backoff. Queue outgoing messages per chat.
Request Header Fields Too Large
Headers are too large.
What a bot should do: Trim cookies or oversized custom headers.
Unavailable For Legal Reasons
Blocked for legal reasons in this region.
What a bot should do: Do not try to bypass it; log and skip.
Internal Server Error
The server failed unexpectedly.
What a bot should do: Retry with exponential backoff and jitter, a few times at most. If your webhook returns 500, the platform will retry delivery.
Not Implemented
The server does not support this functionality.
What a bot should do: Do not retry; use a different method or endpoint.
Bad Gateway
A proxy or gateway got an invalid response upstream.
What a bot should do: Transient: retry with backoff. Telegram and Discord occasionally return it during incidents.
Service Unavailable
Overloaded or down for maintenance.
What a bot should do: Retry later, honoring Retry-After if present. Use a circuit breaker to avoid piling up requests.
Gateway Timeout
An upstream server did not respond in time.
What a bot should do: Retry idempotent requests. For non-idempotent ones, check whether the action happened first.
Insufficient Storage
The server cannot store what is needed.
What a bot should do: Retry much later or contact the provider.
Web Server Returned an Unknown Error
Cloudflare-specific: the origin returned an empty or unexpected response.
What a bot should do: If it is your origin, check its logs. If it is an API, retry with backoff.
Web Server Is Down
Cloudflare-specific: the origin refused the connection.
What a bot should do: Your server or tunnel is down; restart it.
Connection Timed Out
Cloudflare-specific: TCP connection to the origin timed out.
What a bot should do: Check firewall rules and that the origin is reachable.
A Timeout Occurred
Cloudflare-specific: the origin took longer than 100 seconds to respond.
What a bot should do: Move long work to a background job and return 202 quickly.
Retry or not: the short version
- Retry with backoff and jitter: 408, 429 (after Retry-After), 500, 502, 503, 504.
- Fix the request first: 400, 405, 413, 415, 422.
- Stop and alert or clean up: 401, 403, 404, 410.
Related: Backoff calculator, Reliability and rate limits guide.