Errors
Every Truto error comes back with the right HTTP status, a JSON body shaped the same way on every REST route, and — for Unified and Proxy APIs — extra fields that tell you whether the failure happened at Truto's edge or inside the provider you're calling.
Response shape
Successful responses are documented per endpoint. Error responses look like this:
{
"statusCode": 400,
"error": "Bad Request",
"message": "name is required"
}Exceptions: a path that matches no route returns 404 with a plain-text body (404 Not Found), so check Content-Type before you parse; the SCIM and OAuth endpoints use their protocols' error formats; and the MCP server endpoints answer in JSON-RPC, with a 405 and no JSON body for a GET.
Three fields are guaranteed:
statusCode— the same number as the HTTP status. Mirrors the response status line.error— the canonical name for that status, e.g.Bad Request,Unauthorized,Not Found,Too Many Requests,Internal Server Error.message— a human-readable description. For provider-originated errors this is extracted from the provider's body (see below).
Errors raised by Truto's own validation, auth, and routing layers (admin endpoints, Unified API parameter checks, missing integrated_account_id, malformed request bodies, etc.) usually stop here; a few refusals add a truto_error_code and a handful of named fields (see Refusals below).
Errors from the underlying provider — anything you hit through /unified/* or /proxy/* — carry several extra fields.
Distinguishing Truto errors from provider errors
When a Unified or Proxy API call fails because the underlying provider returned a non-2xx, the response gains:
truto_is_remote_error: true— set on every error that originated outside Truto. One refusal of Truto's own carries it too, because the fix is the same as for the provider's401: a call to a stale integrated account (see Refusals).raw_response— the provider's response body, parsed as JSON if possible, otherwise the raw text.- Rate-limit headers, when they apply:
ratelimit-limit,ratelimit-remainingandratelimit-resetif the integration defines how to read them from the provider's response, and, when the provider rate-limited the call,Retry-Afterif the provider sent one or the integration defines it. Other provider response headers are not forwarded on errors — see Rate limits.
{
"statusCode": 422,
"error": "Unprocessable Entity",
"message": "Email is invalid",
"truto_is_remote_error": true,
"raw_response": {
"errors": [
{
"field": "email",
"code": "invalid",
"message": "Email is invalid"
}
]
}
}The message is normalized by walking the provider body for the usual error fields (message, msg, errorMessage, description, detail, summary, error_description, and a long list of variants). When that lookup finds nothing, message is empty and you should fall back to raw_response.
If the field is missing, the error came from Truto itself — almost always a 4xx for input you sent (missing integrated_account_id, malformed body, expired token), or a 5xx that means we couldn't reach the provider at all.
Refusals — truto_error_code
Some errors raised by Truto itself carry a truto_error_code: a stable, machine-readable name for why the request was refused, so you can branch on it without parsing message. Codes are additive — a response either has one or has none — and the other fields stay as documented above.
{
"statusCode": 400,
"error": "Bad Request",
"message": "Google Sheets cannot be re-authorized: its OAuth 2.0 app credentials are no longer configured in this environment. Add them back in Integration Settings.",
"truto_error_code": "app_credentials_not_configured",
"integration": "googlesheets",
"environment_integration_id": "…",
"authentication_methods": ["oauth2"]
}The codes you can see:
app_credentials_not_configured— fromPOST /link-tokenwhen reauthorizing an account (integrated_account_id), or when a connection to one specific integration is started, and that integration has no usable authentication method left: every method it has is a bring-your-own-app one — OAuth 2.0 or AWS STS — with no app credentials configured in this environment.authentication_methodslists the methods that need them. Reauthorization may switch method, so an integration with a working API key beside an unconfigured OAuth app is not refused at this point. It is refused when the end user then starts sign-in with the unconfigured method itself. Add the credentials — the message calls this Integration Settings; in the dashboard it is the integration's Configuration tab, toggle Use your own OAuth settings for OAuth 2.0 or Use your own signing credentials for AWS STS — then retry. A token minted withtenant_idalone is never refused for this reason; the connect UI leaves such integrations out instead. See Reauthorizing connections.cron_triggers_would_stop— a 400 from editing a sync job or daemon job, or one of its cron triggers, when the change would make the job's cron triggers fail every run.cron_triggersnames the affected triggers. Change or delete the triggers first, then retry the edit.sync_job_run_not_completed— a 400 from starting a sync job run while an earlier run of the same job has not finished. For a run on an integrated account, it fires only when the unfinished run has the sameargs, andrunning_sync_job_runsis an array of those runs' IDs; send"force": trueto start the run anyway. For a job with a mutex key, it fires when a run with the same mutex key value is unfinished, andrunning_sync_job_runsholds that run as an object. It can also appear on a cron trigger's error when a scheduled run was skipped for this reason.sync_job_no_resources— a 400 from starting a run of a sync job that has no resources. Add at least one resource to the job.integrated_account_needs_reauth— a401for a call to a stale integrated account: one that has beenneeds_reauth, with no change, for 7 days. Truto has stopped calling the provider for it and answers in its place. Unified, Proxy and Custom API calls and batch requests get this401; a tool call on the account's MCP server returns a result withisError: trueand the message as its text. The body also carriestruto_is_remote_error: true, as the provider's own401does,integrated_account_id, andstale_since, when Truto found the account stale. It has noraw_response, since the provider was not called. Truto does not change the account or send a webhook for this refusal, and it does not count as an API call. Retrying does not help: reconnect the account. Thesync_job_run:failedevent of a run that ended failed because its accounts need reauthentication carries the same code.upstream_response_too_large— a502when the provider answered, but its response was too large for Truto to read and process. Unified, Proxy and Custom API calls get this502, for example on a large list page or an attachment download; a tool call on an MCP server returns a result withisError: trueand the error as its text, without the code. The body does not carrytruto_is_remote_error, since the provider did not fail. Retrying the same request does not help: it reads the same response again and fails the same way. Retry withtruto_response_format=streamto receive the response unprocessed (see Unified API parameters), or, for a list, with a smallerlimit. If it still fails, contactsupport@truto.one.
Insights — truto_error_insight
Unified API errors come with a truto_error_insight block that tells you, in machine-readable form, what to change. Each key is independent; you may see one, several, or none.
{
"statusCode": 400,
"error": "Bad Request",
"message": "name is required",
"truto_error_insight": {
"missing_required_body_fields": {
"description": "These body fields are required and are missing in the request",
"value": ["name"]
}
}
}Body-field hints are added only to Truto's own errors, such as a write sent with truto_enforce_write_schema=true. On a provider error (truto_is_remote_error: true) you get remote_error, plus missing_required_query_parameters when a required query parameter was missing, rate_limit_error on a 429 and forbidden_error on a 403.
The keys you can see:
-
missing_required_query_parameters—valueis an array of query parameter names you didn't send but the unified model requires. -
missing_required_body_fields— same, for body fields. -
conditionally_required_query_parameters—valueis an object keyed by parameter name, with the rule that triggers the requirement (e.g. "required whentypeislead"). -
conditionally_required_body_fields— same, for body fields. -
rate_limit_error— present on a 429 from the provider. Use theRetry-Afterheader when it's there; otherwise back off exponentially. -
remote_error— present on Unified API errors the provider returned. The hint is intentionally short — readraw_responseandmessagefor the actual content. The stale-account401carriestruto_is_remote_error: truebut notruto_error_insight, since Truto refuses it before calling the provider. -
forbidden_error— present on a 403 from the provider. Not every 403 is a scope problem, sovaluestates what Truto worked out and, where it could not work anything out, why not.value.refusal_basisis always present and states what Truto can say the refusal rests on. There are five values, and each one implies a different remedy — which is the point of reading it rather than reading a list of scopes:refusal_basisWill a reconnect help? What it means scopes_missingYes The scopes in value.missing_scopesare absent from the grant. Drive a re-consent flow.scopes_satisfiedNo Every declared scope is granted, so the refusal has another cause. Read what the provider said. non_scope_requirementNo The requirement is a role or an API-key permission, named in value.required_permissions, and granted inside the provider rather than by reconnecting.no_scope_conceptNo This connection authenticates with an API key or OAuth 1.0a, which have no scopes — there is nothing to grant. not_determinedMaybe No comparison ran and Truto cannot name a basis. Read descriptionfor which reason applied, andraw_responsefor the provider's own account.The fields, inside
valueunless the table says otherwise:Field When present What to do refusal_basisAlways Pick the remedy from the table above. missing_scopesOnly with scopes_missingandscopes_satisfiedThe declared scopes absent from the grant: reconnect and grant them. It can be empty, so read refusal_basisto learn whether anything is missing.missing_any_of_scopesWith scopes_missing, when the call needs any one of several scopes and the grant has none of themReconnect and grant one of them. required_permissionsWhen the resource and method declare permissions every call needs, except with no_scope_conceptpermission_vocabularysays where to grant them.required_any_of_permissionsWhen the resource and method declare permissions of which any one is enough, except with no_scope_conceptGrant one of them. permission_vocabularyWith required_permissionsorrequired_any_of_permissionsoauth_scope: reconnect and grant the scope.api_key_permissionorrole_label: grant it inside the provider.raw_response(top level)On every provider 403The provider's error body as it came, and the authoritative account of the refusal. Read it first. message(top level)On every provider 403Text taken from raw_response. For a plain-text or HTML body, it is the whole body.- Treat
refusal_basisas an open set: Truto can add values, so keep a default branch. - An absent
missing_scopesmeans no comparison ran. Don't read it as an empty list. not_determinedwithrequired_permissions(orrequired_any_of_permissions) means the provider's grant was unreadable or undisclosed. Without them, Truto has nothing recorded for that resource and method.- Only
oauth_scopeis fixed by reconnecting. messagehas no length limit, so cap it before you display it.- The integrated account's
last_forbidden_errorkeeps Truto's reading and araw_response_excerptcapped at 2,048 bytes, which may not parse as JSON. It doesn't keepmessage.
- Treat
Proxy API errors carry truto_is_remote_error, raw_response, forwarded headers, and — on 403s, including one an integration's own error_expression maps to 403 — a truto_error_insight.forbidden_error. The Proxy API has no unified schema to compare your request against, so the missing-parameter, rate-limit, and remote-error insights aren't added.
{
"statusCode": 403,
"error": "Forbidden",
"message": "Insufficient permissions",
"truto_is_remote_error": true,
"raw_response": {
"error": "insufficient_scope",
"error_description": "Token does not have crm.objects.contacts.write scope"
},
"truto_error_insight": {
"forbidden_error": {
"description": "Access forbidden. This connection does not hold every scope this resource and method requires — reconnect and grant the scopes listed alongside this error.",
"resource": "contacts",
"method": "create",
"value": {
"refusal_basis": "scopes_missing",
"missing_scopes": ["crm.objects.contacts.write"],
"required_permissions": ["crm.objects.contacts.write"],
"permission_vocabulary": "oauth_scope"
}
}
}
}Status codes
The numbers below are what you'll actually see; the meaning given is what they mean inside Truto.
2xx
200 OK— request succeeded. Body contains the requested resource.201 Created—POSTsucceeded and a new resource was created.204 No Content— request succeeded with no body. Common forDELETE.
4xx
400 Bad Request— Truto rejected the request before it left our edge. A Unifiedcreateorupdatesent withtruto_enforce_write_schema=truelands here when a required body field is missing, with the names intruto_error_insight.missing_required_body_fields. Without that flag Truto doesn't check the body, and the provider decides (Unified API parameters).401 Unauthorized— withouttruto_is_remote_error, your API token is missing, expired, or wrong. Withtruto_is_remote_error: true, the provider rejected the connection's credentials — Truto flips the integrated account toneeds_reauth, setslast_erroron it, and fires theintegrated_account:authentication_errorwebhook. The connection will keep returning 401 until the end user reconnects. If the account staysneeds_reauth, with no change, for 7 days, it becomes stale: Truto stops calling the provider and returns this401itself, withtruto_error_code: integrated_account_needs_reauth.403 Forbidden— the caller is authenticated but not allowed. On Unified and Proxy APIs readraw_responseandmessagefirst — the provider is the system that refused, so its own words are the authoritative account — thentruto_error_insight.forbidden_error.value.refusal_basisfor Truto's reading. Onlyrefusal_basis: "scopes_missing"means a reconnect with the right scopes will fix it.non_scope_requirementpoints at a role or API-key permission granted inside the provider, and the rest are licensing, plan, admin-permission or configuration problems that a re-consent flow will not touch.404 Not Found— the resource doesn't exist, or the integrated account / environment isn't visible to your token.405 Method Not Allowed— the MCP server endpoints, for an integrated account's MCP server and for the Platform MCP server, take onlyPOST. AGET(and, on the Platform MCP server, aDELETE) returns405without a JSON body.409 Conflict— withtruto_is_remote_error: true, the provider rejected a create or update because of a uniqueness constraint; checkraw_responsefor the specific field. Without it, Truto refused the request itself: for example, creating a tenant whose ID already exists in the environment, deleting a tenant that still has integrated accounts, or connecting an integration the tenant has already connected.422 Unprocessable Entity— payload is well-formed but the provider rejected it (validation error inside the provider).429 Too Many Requests— one of Truto's limits, the provider's limit, or Truto briefly overloaded, in which caseRetry-Afteris between 30 and 90 seconds; back off and retry. Who sent the 429? shows how to tell them apart.503 Service Unavailable— the integrated account has been blocked (contactsupport@truto.one), the database is switching over (Retry-After: 2; retry after a few seconds), or the endpoint is paused for scheduled maintenance.
5xx
500 Internal Server Error— Truto failed to process the request. Retry with backoff; if it persists, contact support with therequest_idfrom the body.502 Bad Gateway/504 Gateway Timeout— Truto reached the provider but the provider didn't respond cleanly. Safe to retry for reads; for writes, see Retry strategy. A502withtruto_error_code: upstream_response_too_largeis different: the response was too large to process, so change the request instead (see Refusals).
Check status.truto.one for an ongoing incident before you contact support about a 5xx.
Rate limits
Truto's own limits, the provider limits it passes on, and how to tell which one sent a 429 are on Rate limits.
Retry strategy
- Retry on: 429 (after
Retry-After, or with exponential backoff when it's missing), 502 (not withtruto_error_code: upstream_response_too_large), 503 (not when the integrated account is blocked), 504 — for writes, see Writes below — and 5xx that don't carrytruto_is_remote_error(exceptupstream_response_too_large). - Don't retry on: 400, 401, 403, 404, 409, 422 — fix the request, the token, or the connection first. A 502 with
truto_error_code: upstream_response_too_largefails the same way every time: retry withtruto_response_format=stream, or with a smallerlimiton a list, instead. - Watch
truto_is_remote_error: a 5xx withtruto_is_remote_error: trueis the provider failing, not Truto. Retry policy should be the same as for any flaky upstream — exponential backoff, capped attempts. - Writes. A 502, 504 or timeout on a create or update doesn't tell you whether the provider acted. Read the record back before you retry. If you sent an
Idempotency-Key, retry with a new key: the same key returns the stored error. - SDKs. The TypeScript, Go, Java and Rust SDKs retry 408, 409, 425, 429, 502, 503 and 504 for you, writes included. Turn retries off for writes you need to check first (see the retry options on the TypeScript, Go, Java and Rust SDK pages). The Python SDK doesn't retry.