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:
| Code | HTTP | Meaning |
|---|---|---|
| invalid_credentials | 401 | Email/password or API key is invalid. |
| second_factor_required | 403 | Action requires step-up MFA verification. |
| forbidden | 403 | Caller lacks the required workspace role. |
| not_found | 404 | Requested resource does not exist in this workspace. |
| approval_content_mismatch | 409 | Variant content was modified after the approval token was issued. |
| kill_switch_active | 409 | Publishing is paused by a workspace, group, or account kill switch. |
| password_breached | 422 | Chosen password appears in known breach corpora. |
| validation_error | 422 | One or more request fields failed schema validation (see field_errors). |
| rate_limited | 429 | Too many requests; inspect the Retry-After header. |