api-docs-icon

Errors & Retries

Turnqey APIs use standard HTTP status codes with JSON responses.

Clients should separate permanent request errors from temporary failures.

Common status codes

StatusMeaningRetry?Client action
200SuccessNoUse the response.
400Bad request or missing parameterNoFix the request before trying again.
401Token missing, expired, or invalidOnceRequest a new token and retry once.
403Partner, IP, or permission not allowedNoContact Turnqey support.
404Resource not foundNoCheck the ID, collection, source, or endpoint.
422Request understood but cannot be processedNoShow a support path with the request details.
429Rate limitedYesBack off and retry after the limit window.
500 / 502 / 503 / 504Server or upstream failureYesRetry with backoff and jitter, then fail gracefully.

Retry guidance

Use retries only for temporary failures.

Recommended pattern:

  1. Retry 429 and 5xx responses with exponential backoff and jitter.
  2. Retry 401 once after requesting a new token.
  3. Do not retry 400, 403, 404, or 422 without changing the request.
  4. Cap retries. Three attempts is usually enough.
  5. Log request context for support.

What to log

Log enough context to investigate without exposing secrets.

Include:

  • Endpoint
  • HTTP method
  • Timestamp
  • Account ID, collection ID, or identity when available
  • Request ID or correlation ID when available
  • Status code
  • Error message

Do not log:

  • Client secrets
  • Bearer tokens
  • API keys
  • OAuth authorization codes
  • Seed phrases or private keys

Reconnect-required cases

Some errors mean the user must reconnect the source account.

Examples:

  • OAuth refresh token revoked
  • Source authorization expired
  • User removed Turnqey access at the source platform
  • Platform requires renewed consent

In these cases, show a clear reconnect action instead of retrying in the background.

Support

For integration support, contact: