Errors
Every error is JSON with the same shape:
{
"error": {
"code": "bad_request",
"message": "Unknown field: `colour`."
}
} code is stable: branch on it. message is for people and may change. Errors never carry database text or stack traces.
An unknown path, a wrong method, a missing resource and a resource the token can't see all answer the same 404 not_found, so the API never confirms that something you can't read exists.
Codes
| Status | Code | When |
|---|---|---|
| 400 | bad_request | Bad input: unknown field, wrong type, too long. |
| 401 | unauthorized | Missing, malformed, expired or revoked token. |
| 403 | insufficient_scope | The token lacks the scope this endpoint needs. |
| 404 | not_found | No such resource, or the token cannot see it. |
| 413 | payload_too_large | Body over 16 KB. |
| 415 | unsupported_media_type | Body is not application/json. |
| 429 | rate_limited | Rate limited; see retry-after. |
| 500 | internal | Internal error. |
| 502 | upstream_error | The database failed. |
| 503 | unavailable | The API is not set up on this server. |
| 507 | storage_full | Storage limit reached: the account is over its sync quota. |
Retrying
Retry 429 after the retry-after seconds, and 502 / 503 with backoff. Don't retry 4xx otherwise: the same request will fail the same way.