Skip to main content

Errors

Formats​

ServiceFormat
Customers, Insights{ "error": "entity/not-found" }
Customers, Insights (validation){ "errors": [{ "message": "…", "path": "name" }] }
AuthPlain text body, e.g. oauth/invalid-client
Customers 401Empty body

Error codes follow scope/problem. The complete list, grouped by area, is on the SDK error reference.

Status codes​

StatusTypical reason
400Validation, unknown id, invalid argument
401No token, expired token, wrong token type
403Token valid but not allowed (source scope, grant not allowed)
404Unknown document or route
429Too many token requests
500Server error. Retry idempotent calls

Handling​

const call = async (url, options) => {
const response = await fetch(url, options)
const text = await response.text()
const body = text ? JSON.parse(text) : undefined
if (response.ok) return body
throw Object.assign(new Error(body?.error ?? `HTTP ${response.status}`), { status: response.status, body })
}

Note: the auth service answers with plain text. Parse defensively.