Docs home
ChannelDesk docs

API errors

Validation, authorization, conflict, rate-limit, and provider failure handling.


API errors

Use the HTTP status for the error class and preserve per-network field errors for the mobile editor.

  • 400/422: correct input; do not retry unchanged content.
  • 401: refresh once, then return to login if refresh fails.
  • 403/404: do not reveal ownership of inaccessible resources.
  • 409: resource conflict or idempotency key reused with different input.
  • 429/5xx: bounded exponential backoff; keep the same key only for an identical publish request.

Standard error envelope

{
  "code": 422,
  "error": "validation_error",
  "message": "Validation failed.",
  "details": [
    {
      "field": "targets.0.content_type",
      "message": "Allowed values: post, reel, story, short."
    }
  ],
  "requestId": null
}

Mobile handling

  • Render details[].message next to details[].field.
  • Refresh once after 401; never create an infinite refresh loop.
  • Do not retry 400, 403, 404, or 422 without changing input or state.
  • Use bounded exponential backoff for 429 and transient 5xx.
  • Log requestId when supplied without exposing internal diagnostics to the user.