Skip to main content

Errors

All errors return application/problem+json (RFC 9457 Problem Details) with a consistent shape.

{
"type": "https://docs.xavigate.com/errors/insufficient_scope",
"title": "API key lacks required scope",
"status": 403,
"detail": "This action requires the 'nature:write' scope.",
"request_id": "req_abc123",
"error_code": "insufficient_scope",
"error_type": "authorization_error",
"docs_url": "https://docs.xavigate.com/errors/insufficient_scope"
}

Error object fields

FieldTypeDescription
typeURIUnique error type URL — links to this page
titlestringHuman-readable error summary
statusintegerHTTP status code
detailstringSpecific detail about this instance of the error
request_idstringUnique request identifier — include in support requests
error_codestringMachine-readable code for your error handling
error_typestringBroad category (see below)
docs_urlURIDirect link to error documentation
errorsarrayValidation errors (present on 400 responses with field failures)

Error types

error_typeMeaning
authentication_errorKey missing, malformed, revoked, or not found
authorization_errorKey valid but insufficient scope for this operation
consent_errorSubject lacks consent for the requested product
invalid_requestRequest body or parameters are invalid
rate_limit_errorToo many requests; back off and retry
service_errorUnexpected server error; Xavigate is investigating

Error codes

CodeStatusDescription
unauthenticated401No valid API key provided
insufficient_scope403Key lacks required scope
insufficient_consent403Subject has not consented to this product
not_found404Resource does not exist in your account
invalid_request400Request body or parameters are invalid
idempotency_key_in_use409A request with this key is already processing
rate_limit_exceeded429Too many requests — see Retry-After header
internal_error500Unexpected server error

Validation errors

400 responses include a top-level errors array when multiple fields failed validation:

{
"type": "https://docs.xavigate.com/errors/invalid_request",
"title": "The request was invalid",
"status": 400,
"request_id": "req_def456",
"error_code": "invalid_request",
"error_type": "invalid_request",
"errors": [
{ "field": "consent_artifact.consented_at", "code": "required", "detail": "This field is required" },
{ "field": "consent_artifact.ui_snapshot_hash", "code": "required", "detail": "This field is required" }
]
}

Handling errors in code

import { XavigateError } from '@xavigate/node';

try {
const subject = await client.nature.subjects.create({ ... });
} catch (err) {
if (err instanceof XavigateError) {
console.error(err.error_code); // 'insufficient_scope'
console.error(err.request_id); // 'req_abc123' — use in support requests
console.error(err.status); // 403
}
}
from xavigate import XavigateError

try:
subject = client.nature.subjects.create(...)
except XavigateError as e:
print(e.error_code) # 'insufficient_scope'
print(e.request_id) # 'req_abc123' — use in support requests
print(e.status) # 403
Always log request_id

Every error includes a request_id. Log it and include it in any support request. It's the fastest way to diagnose a problem.