Errors
Every error has the same shape.
{ "error": { "code": "VERSION_CONFLICT", "message": "The link changed. Fetch it again before editing." }, "requestId": "a4b804977e4b8dd8"}Branch on error.code, not on message, which may change. Every response, including errors, has an X-Request-Id header with the same value as requestId.
| Status | Code | Meaning and what to do |
|---|---|---|
| 400 | INVALID_JSON | The body isn't valid UTF-8 JSON. |
| 400 | INVALID_CURSOR | Bad, expired or mismatched cursor. Start the list again. |
| 400 | INVALID_PRECONDITION | If-Match isn't an ETag. Send it exactly as received. |
| 401 | INVALID_API_TOKEN | Missing, wrong, revoked or replaced token. Copy the current one from the API page. |
| 403 | API_UNAVAILABLE | The API isn't enabled for your account. |
| 403 | CREATOR_NOT_ELIGIBLE | Your account can't publish right now, for example while it's under review. Check the dashboard or contact support. |
| 403 | ORIGIN_NOT_ALLOWED | The request came from a web page. Call the API from your server. |
| 404 | LINK_NOT_FOUND | The link doesn't exist or isn't yours. |
| 409 | IDEMPOTENCY_CONFLICT | This key was used for a different request. Use a new key. |
| 409 | LINK_NOT_EDITABLE | Revoked, under review, or destination temporarily locked. See Update a link. |
| 409 | LEGACY_SHARED_CONTENT_UNSUPPORTED | Content shared with another link or widget. Edit it in the dashboard. |
| 412 | VERSION_CONFLICT | The link changed. Read it again and resend. |
| 413 | PAYLOAD_TOO_LARGE | Body over 16 KiB. |
| 415 | UNSUPPORTED_MEDIA_TYPE | Send Content-Type: application/json. |
| 422 | INVALID_LINK | A field is missing, invalid or unknown. Check the rules for each field. |
| 422 | INVALID_IDEMPOTENCY_KEY | Key must be 16 to 128 visible ASCII characters. |
| 428 | PRECONDITION_REQUIRED | Send If-Match with the link's ETag. |
| 429 | RATE_LIMITED | Too many requests. Wait for Retry-After. |
| 429 | DAILY_QUOTA_EXCEEDED | Daily creation limit reached. Wait for Retry-After (00:00 UTC). |
| 503 | API_UNAVAILABLE | The API is temporarily turned off. Try again later. |
| 503 | DEPENDENCY_UNAVAILABLE | Temporary problem on our side. Retry with backoff; for writes, reuse the same Idempotency-Key. |