Skip to navigation

Errors

Every error has the same shape, and its retry action tells you what to do next.
View as Markdown

When a request fails, the body tells you what went wrong, which fields caused it, and what to do about it. Branch your code on error.code and error.retry_action.type. The message is written for a person.

The error envelope

{
"error": {
"code": "needs_information",
"message": "The quote request needs more information.",
"field_errors": [
{
"path": "application.applicant.email",
"message": "This fact is required."
}
],
"retry_action": {
"type": "supply_facts",
"summary": "Supply the missing facts and send the request again."
},
"doc_url": "https://docs.truvo.com/v1/errors/needs_information"
},
"request_id": "req_..."
}
FieldWhat it holds
error.codeOne of the codes in the table below.
error.messageA short explanation for a person.
error.field_errorsA list of fields, each with a path and a message, or null.
error.retry_actionWhat to do next, as a type and a summary.
error.doc_urlA link for the code, in the form https://docs.truvo.com/v1/errors/<code>. Each link opens the code table on this page.
request_idThe ID of this response. It starts with req_. Include it when you contact Truvo support.

Every answer, success or error, carries its ID in a Request-Id header, and an error body repeats it as request_id.

Error codes

CodeHTTPWhat it means
invalid_json400The request body isn’t valid JSON.
invalid_cursor400The cursor isn’t one that this list or feed returned. It applies to every paged read: GET /v1/quote-requests, GET /v1/requests, GET /v1/event-subscriptions, and the event feed, GET /v1/events. Send a next_cursor from an earlier page of the same read, or leave the cursor out to start again.
authentication_failed401The key is missing or isn’t valid.
forbidden403The key doesn’t have authority for this action.
not_found404The resource doesn’t exist, or it’s outside your authority.
conflict409A request key conflict or a version conflict.
quote_expired409The quote has expired.
price_changed409The quote has a newer version with a different price.
purchase_not_supported409The quote has no purchase through the API.
event_cursor_expired410The event feed, GET /v1/events, keeps events for 30 days. It can’t resume from this cursor because retention deleted an event after it, or a sandbox reset voided it. Read each resource you track, then read the feed again without a cursor.
request_too_large413The request body is too large.
invalid_input422The input isn’t valid. field_errors lists the fields.
needs_information422Required facts are missing. Truvo returns this before it asks any carrier.
rate_limited429The key or its organization reached a rate limit, per minute or, in the sandbox, per day. The message names the limit.
internal_error500Something went wrong inside Truvo.
service_unavailable503A service that Truvo needs is down. Try the request again later, after the seconds in the Retry-After header.

Only the purchase operations return quote_expired, price_changed, and purchase_not_supported. The API doesn’t have those operations yet.

Retry actions

TypeWhat to do
noneDon’t send the request again.
retryTry the request again later.
correct_inputFix the fields in field_errors, then send the request again.
supply_factsAdd the missing facts in field_errors, then send the request again.
read_statusRead the resource again.
use_new_request_keySend the request with a new Idempotency-Key.
waitWait, then send the request again.
contact_supportContact Truvo support with the request_id.