Errors
Error response format and HTTP status codes.
Errors return a consistent JSON body:
{
"error": "insufficient_scope",
"error_description": "The token is missing a required scope."
}Status codes
| Status | Meaning |
|---|---|
200 |
Success |
201 |
Created |
204 |
Success, no body (e.g. delete) |
400 |
Malformed request — bad parameter or value |
401 |
Missing, invalid, expired, or revoked token |
403 |
Authenticated but not allowed (insufficient_scope, forbidden) |
404 |
Resource not found |
422 |
Unprocessable — validation failed or actor_self_required |
429 |
Rate limited — back off and retry |
Common error codes
| Code | When |
|---|---|
invalid_token |
Token is invalid, expired, or revoked |
insufficient_scope |
Token lacks a scope the endpoint requires |
actor_self_required |
Operation needs an actor=self token (see Authentication) |
forbidden |
Acting user isn't permitted (e.g. editing another user's message) |
invalid_request |
A required parameter is missing or invalid |
Note — On
429, back off exponentially before retrying.