Understanding responses, error handling, and status codes for every Partner API endpoint.
Envelope Structure
All endpoints return the same typed envelope so you can branch onok once and stay type-safe everywhere else.
Indicates success (
true) or failure (false).Mirrors the HTTP status code returned by the endpoint.
Human-readable context for logs or UI surfaces.
Present only when
ok is true. Contains the payload documented for each
endpoint.Optional machine-friendly identifier for failures (e.g.,
invalid_token,
subscription_required).When
ok is true, data is guaranteed to exist. When ok is false,
data is omitted, so you can rely on that distinction for strict typing in
TypeScript, Swift, or Go clients.Sample Handling
Common Status Codes
| Code | Meaning | Notes |
|---|---|---|
200 | Success | Returned for GET/PATCH requests and POST /posts/retry. |
201 | Created | Returned only by POST /posts when a post is successfully queued. |
400 | Bad Request | Missing/invalid parameters, unreachable media URLs, etc. |
401 | Unauthorized | API key missing, malformed, or revoked. |
402 | Subscription Required | Workspace does not have an active plan for Partner API usage. |
404 | Not Found | Resource doesn’t exist inside the current workspace context. |
422 | Unprocessable Entity | JSON body parsed but failed schema validation (invalid payload). |
429 | Too Many Requests | Back off—respect concurrency guidance (3–10 requests at a time). |
500 | Internal Server Error | Rare; retry with exponential backoff and contact support if needed. |
