API Reference

Error Reference

Every non-2xx API response returns a single, predictable JSON error envelope with stable machine-readable codes.

The error envelope

Every error response from /api/v1 follows the same schema. Clients should branch on error.code rather than parsing human-readable error.message strings.

error-envelope.json
{
  "error": {
    "code": "approval_content_mismatch",
    "message": "The post content changed after approval was signed.",
    "detail": null,
    "field_errors": [],
    "request_id": "req_01J...",
    "docs_url": "https://sparlby.com/docs/errors/approval_content_mismatch"
  }
}

Common error codes

Standard error codes returned across authentication, validation, approval verification, and publishing:

CodeHTTPMeaning
invalid_credentials401Email/password or API key is invalid.
second_factor_required403Action requires step-up MFA verification.
forbidden403Caller lacks the required workspace role.
not_found404Requested resource does not exist in this workspace.
approval_content_mismatch409Variant content was modified after the approval token was issued.
kill_switch_active409Publishing is paused by a workspace, group, or account kill switch.
password_breached422Chosen password appears in known breach corpora.
validation_error422One or more request fields failed schema validation (see field_errors).
rate_limited429Too many requests; inspect the Retry-After header.