Skip to content
TruCom Developers
REST API
DocumentationGuides
REST API · V1

Errors & troubleshooting

Understand failures and recover without losing the context of a request.

Read the error envelope

Every REST error uses error.code, error.message and error.details. Validation failures include details.fields with field-specific messages. Save the X-Request-Id response header when investigating a failed request; never log the Authorization header or identity token.

JSON
{
  "error": {
    "code": "validation_failed",
    "message": "Check the highlighted request fields.",
    "details": {
      "fields": {
        "email": [
          "The email field must be a valid email address."
        ]
      }
    }
  }
}

Common status codes

StatusMeaning / action
400Invalid JSON object or missing required Idempotency-Key.
401Missing, invalid, expired or revoked key; check the Bearer token and ownership.
403Required scope or current workspace permission is missing.
404Unknown endpoint or resource unavailable in this workspace.
405HTTP method is not supported.
409Idempotency mismatch, missing identity signing or subject bound to another customer.
413JSON body exceeds 64 KB.
415Use Content-Type: application/json for write requests.
422Invalid fields, duplicate identities, quota or other customer validation. Inspect details.fields.
429Per-key rate limit exceeded. Wait Retry-After seconds.
500Unexpected failure. Retry with backoff and the same write operation key.

Identity and retry conflict codes

CodeWhat to check
idempotency_key_requiredAdd a stable Idempotency-Key to the create or reply request.
idempotency_conflictUse the original request content or a new operation key.
identity_signing_not_configuredConfigure identity signing in Chat widget / Identity.
identity_subject_conflictResolve the correct customer for this subject; do not reassign someone else’s history.
insufficient_scopeGrant the exact scope named in error.details.required_scope.
invalid_api_keyUse an active server key whose creator still owns the workspace.

Keep requests predictable

Send JSON objects with application/json. Use ISO 8601 dates from responses and public ULIDs for resource IDs. An API key is permanently scoped to its workspace and widget; a workspace parameter cannot override it.

If the widget is hidden, REST access continues. If a key’s linked widget or workspace is deleted, that key no longer works. Use GET /me to verify a connection before syncing customer data.

TruCom DevelopersSupport that belongs in your product.

Search documentation