Skip to main content

Errors

Every error response uses the same envelope:

{
"error": {
"code": "company_not_found",
"message": "company not found",
"request_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
}
  • code — a stable, machine-readable identifier. Match against this in your retry and alerting logic, not the human-readable message.
  • message — a description suitable for logs or developer-facing error surfaces. Wording may change between releases.
  • request_id — a UUID identifying the request. Echo it back to Sarucci support when filing a bug.

Every response (success or error) also carries the same value in an X-Request-Id header, so you can correlate logs even when no body is returned (e.g. a 504 from a load balancer). If you send your own X-Request-Id (a valid UUID) on the request, the API echoes it back.

HTTP status codes

StatusMeaningTypical cause
200OKSuccess
201CreatedResource created (e.g. a company)
401UnauthorizedMissing, malformed, expired, or invalid bearer token
403ForbiddenToken type cannot use this endpoint
404Not foundUnknown/unowned company_id, or no run at the requested offset
409ConflictState changed under you (e.g. the model id you approved is stale)
422Unprocessable entityRequest body/params failed validation
500Server errorTransient; retry with backoff

Error codes

A non-exhaustive list — the full set is documented per-endpoint in the API Reference.

CodeWhen it fires
missing_bearerNo Authorization: Bearer header was sent
invalid_tokenThe bearer token is malformed or missing required claims
invalid_credentialsToken (or the keys behind it) is invalid or expired
partner_token_requiredA non-partner token was used on a partner endpoint
validation_errorRequest body or query params failed schema validation; see message
company_not_foundThe company_id is unknown or not mapped to your partner account
no_run_at_offsetNo persisted V2 run exists at the requested runs_ago offset
no_trained_artifactV2 training/approval requested but no trained artifact exists
model_id_staleThe model_id you tried to approve is no longer the latest artifact
internal_errorUnhandled server-side failure; safe to retry
  • 4xx — do not retry (other than re-exchanging a token on a 401 and retrying once). The request will keep failing until the input or state changes.
  • 5xx — retry with exponential backoff (suggested: 0.5s, 1s, 2s, 4s, then give up).
  • Always log request_id alongside your own correlation IDs.