Error Handling
Every error response follows a consistent JSON shape. Use the error field to branch your logic.
Response Shape #
All error responses return a JSON object with two fields:
The error field is always present and is a machine-readable snake_case code.
The message field is optional and may contain a human-readable explanation.
{
"error": "not_a_member",
"message": "Bot is not a member of this space."
} HTTP Status Codes #
render_unavailable). Nothing was changed; retry later. Common Error Codes #
These error codes appear across multiple endpoints. Each API reference page lists the specific errors that endpoint can return.
attach:// reference names no part of the request. Retry-After seconds; the body also carries retry_after. Sticker & Emoji Error Codes #
Returned by IExpressions and IFiles. What each means for a bot is in Stickers & Custom Emoji → Errors.
AddItem), or the file over the size its format allows. Retry-After: 60. See Rate Limits. AddItem with an animated file: the server cannot render it right now. Nothing was added; send the same request again later. Attachment & Reaction Error Codes #
Returned by IMessages/Send with attachments and by IFiles/Upload (see Files & Attachments), and by IReactions/AddCustom (see Reactions).
attach:// names no part, or an attach:// is in a JSON body. Send: no AttachFiles in the channel. AddCustom: no AddReactions, or an emoji of another space and the bot is not verified. Send: a fileId names no attachment upload of the bot — unknown, over 24 hours old, or uploaded for a sticker or emoji. AddCustom: the emoji does not exist or was deleted. Best Practices #
Match on error, not message —
the message text may change between versions. The error code is part of the stable contract.
Handle unknown error codes gracefully — new codes may be introduced in future versions. Fall back to the HTTP status code for unrecognized errors.
429 responses include rate limit info —
check Retry-After header for how long to wait before retrying.
See Rate Limits for details.