Understanding responses, error handling, and status codes for every Partner API endpoint. Designed for easy parsing by OpenClaw agents, Claude Code, and any programmatic integration.
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 by create-style endpoints such as POST /posts, POST /slideshows/generate, POST /packs, POST /packs/:pack_id/images, POST /templates, POST /templates/from-slideshow/:slideshow_id, and POST /slideshows/:slideshow_id/duplicate. |
202 | Accepted | Returned for async-start endpoints such as POST /studio/videos/generate. |
400 | Bad Request | Missing/invalid parameters, unreachable media URLs, etc. |
401 | Unauthorized | API key missing, malformed, or revoked. |
402 | Subscription Required | Active Creator, Professional, or Business subscription is required. |
403 | Forbidden | Tier or scope denied (e.g., tier_not_allowed for Scheduler). |
404 | Not Found | Resource doesn’t exist in the authenticated key scope. |
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. |
Handling 422 invalid_payload
When payload validation fails, Partner API returns 422 with field-level details.
- Detect
code === 422anderror_code === "invalid_payload". - Read
issues.fieldErrors. - Fix field shape/data and retry.
- Do not retry unchanged payloads.
