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
Handling 422 invalid_payload
When payload validation fails at the schema/shape layer, Partner API returns 422 with schema-level and field-level details. Account-aware rules that require resolved account metadata (for example a caption that is valid for Facebook but too long for a selected Pinterest account, or a text-only post sent to TikTok) surface later as 400 validation_failed. Unknown provider keys under settings are rejected here because Partner API fails closed on unrecognized platform settings.
- Detect
code === 422anderror_code === "invalid_payload". - Read both
issues.formErrorsandissues.fieldErrors. - Fix field shape/data and retry.
- Do not retry unchanged payloads.
