Errors & Idempotency

Shared JSON error envelope, HTTP status codes, entitlement and quota failures, and safe retry semantics across the Shots API.

Every failing request across Shots' editor utilities, /api/v1 workspace routes, and MCP tools returns JSON with the same envelope. Branch programmatically on code, which is stable; error and message carry human-readable text, and hint explains how to recover.

{
  "error": "URL is required",
  "code": "invalid_request",
  "message": "URL is required",
  "hint": "Send a JSON body with a \"url\" string, for example {\"url\": \"https://example.com\"}.",
  "status": 400,
  "documentation": "https://shots.playbookmedia.io/docs#errors"
}

Standard Error Codes

CodeHTTP StatusMeaning
invalid_request400A required field is missing or failed Zod schema validation
invalid_url400The URL is not a valid absolute http or https address
unsupported_value400A field was set outside its allowed enum values
unauthorized401No valid signed-in session or workspace API key was provided
forbidden_domain403The requested host is not on the media proxy allowlist
workspace_feature_not_entitled403The workspace lacks an active paid plan or the plan does not include the requested feature (currentPlan, feature, and requiredPlan are included)
not_found404No endpoint or workspace-scoped resource matches the request
method_not_allowed405The endpoint does not accept this HTTP method (check the Allow header)
upstream_timeout408The target page or upstream capture took too long to load
rate_limited429Rate limit or monthly quota exceeded; wait for Retry-After before retrying
internal_error500Unexpected server-side failure
upstream_failed502The upstream host refused or failed the request
upstream_unavailable503The upstream capture or provider service is temporarily unreachable

Safe Retries & Idempotency

  • Send an Idempotency-Key header on release creation and mutation endpoints that support it so network retries never create duplicate records.
  • Do not blindly retry ambiguous publish requests: Shots tracks delivery state durably and moves uncertain platform responses to UNKNOWN_DELIVERY for human review so a post is never published twice.
  • Honor Retry-After on every 429 response.