Skip to main content

API Errors

Purpose

API clients should treat response status, hasErrors, and validation messages as part of the same error-handling model.

Response Handling

  1. Read the HTTP status code.
  2. Parse the response body as JSON.
  3. Check hasErrors when present.
  4. Read data, meta, and error messages according to the endpoint.
  5. Log enough context for support without exposing secrets or full document content.
caution

Some xTrakt backend responses are returned with Content-Type: text/plain while the body contains JSON. API clients should parse the response body as JSON even when the content type is not application/json.

Common Conditions

ConditionLikely CauseAction
401 UnauthorizedMissing, expired, or invalid credentialRefresh token or rotate API key
403 ForbiddenCredential lacks tenant, role, or subscription accessConfirm entitlement and permissions
Validation errorRequest body is incomplete or invalidCorrect required fields and retry
Processing errorDocument, provider, or service failureRetry with known-good input and check logs