Errors
Error responses
Every error response has the same shape:
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.
Failed jobs
A job or cohort can fail after it was accepted. Its status is then failed, with an error:
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:
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.

