Every Clarky API error — whether it’s an authentication failure, a validation problem, or an internal error — comes back in the same envelope. This makes it easy to write a single error handler that works across every endpoint.Documentation Index
Fetch the complete documentation index at: https://docs.clarky.ai/llms.txt
Use this file to discover all available pages before exploring further.
Error envelope
A short machine-readable identifier for the failure. Use this for branching logic — never the message.
A human-readable description of what went wrong. Safe to surface to developers, but not generally suitable for end users.
Optional structured context. The shape depends on the error code — for
validation_error this often includes the offending field name, expected type, etc.Error codes
| Code | HTTP | Meaning |
|---|---|---|
unauthorized | 401 | Missing, malformed, or revoked API key |
forbidden | 403 | Authenticated, but the key doesn’t have permission for this action |
not_found | 404 | The resource doesn’t exist or isn’t visible to your workspace |
bad_request | 400 | The request was malformed (bad JSON, unsupported parameter, etc.) |
validation_error | 422 | The request was well-formed but a field failed validation |
conflict | 409 | The request conflicts with the current state of a resource |
rate_limited | 429 | Too many requests — see Rate Limits |
internal_error | 500 | Something went wrong on our end. Retry with backoff |
Examples
unauthorized (401)
Returned when the Authorization header is missing, the key has been revoked, or the key format is invalid.
forbidden (403)
Returned when the key is valid but doesn’t have permission for the action — for example, a read-only key trying to POST.
not_found (404)
Returned when the resource doesn’t exist, or exists in a different workspace than the one your key belongs to.
bad_request (400)
Returned for malformed requests — invalid JSON, unsupported query parameters, missing Content-Type, etc.
validation_error (422)
Returned when the request is structurally valid but at least one field failed validation. The details object identifies the offending field.
conflict (409)
Returned when the request would violate a uniqueness constraint or otherwise conflict with the current state.
rate_limited (429)
Returned when you exceed the per-key request budget. The response includes Retry-After and X-RateLimit-* headers — see Rate Limits.

