Skip to navigation

Errors

Error responses, failed jobs, and retrying

Error responses

Every error response has the same shape:

{
"error": {
"code": "invalid_credentials",
"message": "invalid credentials",
"request_id": "req_3b1f0c9e8d7a6b5c4d3e"
}
}

Branch on code, which is stable. message is for people and may change. The request_id is also returned in the X-Request-Id header; quote it when contacting support.

HTTPcodeMeaning and what to do
400invalid_idempotency_keyThe Idempotency-Key header is not 1 to 128 of A-Z a-z 0-9 _ . : -
401invalid_credentialsThe key is missing, unknown, expired or revoked, or lacks the synth:process scope
402organization_suspendedThe organization is suspended. See Billing
402insufficient_creditNot enough credit for the most this request can produce. Nothing was queued. See Billing
404not_foundNo such job or cohort for your organization, or a result that wasn’t requested
409idempotency_conflictThat Idempotency-Key was already used with a different body
409not_readyA result was requested before the job finished
409no_resultThe job failed or was canceled, so it has no results
410result_expiredThe result was already downloaded, or was not downloaded within 24 hours
422request_validationA field has the wrong type or value, or is not recognised. The message names the fields
422too_many_documents, cohort_too_largeOver a limit
429rate_limitedOver a rate or concurrency limit. Wait for the Retry-After seconds
500internal_errorA problem on our side. Retry, and contact support if it persists
503temporarily_unavailableRetry with backoff

Failed jobs

A job or cohort can fail after it was accepted. Its status is then failed, with an error:

{ "id": "…", "status": "failed",
"error": { "code": "generation_failed",
"message": "this patient could not be generated; resubmit, or contact support if it persists" }, … }
error.codeMeaning and what to do
invalid_requestThe request cannot be generated as asked, for example a birth date after the start of the timeline. The message says why. Change the request
generation_failedThe patient (or the cohort’s health system) could not be generated. Resubmit; if it keeps failing, contact support with the job id
temporarily_unavailableGeneration was interrupted on our side. Resubmit
processing_interruptedProcessing was interrupted on our side. Resubmit
all_patients_failedEvery patient in a cohort failed. Each patient’s error is in the cohort’s result

A job we cancel ourselves, for operational reasons, has status canceled and the code canceled_by_operator. Resubmit it.

A cohort in which some patients failed still succeeds: those patients are listed in summary.failures, each with its error, and are not billed.

New codes may be added. Treat an unrecognised code as a problem on our side.

Retrying safely

Send an Idempotency-Key header, of your choosing, with every submission:

Idempotency-Key: order-1234

Resubmitting with the same key and the same body returns the original job or cohort, with 200 rather than 202, instead of creating, and charging for, a second one. The same key with a different body is rejected with 409 idempotency_conflict. Keys are scoped to your organization and remembered for 24 hours.

Retry 429 responses after the Retry-After seconds. Retry 503 and 500 responses, and network errors, with exponential backoff. Do not retry other 4xx responses unchanged: they will fail the same way.