Skip to main content
POST
Submit an answer and get the next question

Authorizations

Authorization
string
header
required

Per-client API key (M2M). Presented as Authorization: Bearer <key>.

Headers

X-Correlation-Id
string

An optional id you send to tie this request to your own logs. Send one and it is echoed back unchanged; omit it and one is assigned for you. Either way the id is returned in the X-Correlation-Id response header on every response, including errors, so you can match a response to the request that produced it.

Maximum string length: 128
Pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
X-Brand-Id
string
required

Your brand id (brd_...). It must be one of the brands your API key's account owns; with a publishable key it must be the one brand the key was issued for. A missing or malformed value is refused with 400, and an unknown or foreign brand with 404.

Pattern: ^brd_[A-Za-z0-9][A-Za-z0-9_-]*$

Body

application/json

An answer for the question the session is currently on. Send node_id (recommended) to KEY the answer to the node it was collected for so a server-side skip or a restart can never land it on the wrong node.

session_id
string
required
answer
object

A patient's answer for the current question, interpreted per its control type. Coded controls carry codes; scalar controls carry value; a number pair carries pair; a pre-filled-value confirmation carries confirmed; the address control carries address; a video capture carries media (an opaque upload reference + descriptor) and consent.

node_id
string

The id of the node this answer was collected for (echo the served node.node_id). Optional, and recommended on every submit. When present the server binds the answer to that node instead of blindly to the current question: if it matches the current node the submit proceeds; if it names a node ALREADY PASSED (a stale replay after a serve-time skip or a restart) the server re-serves the current node unchanged (idempotent resync — no misbind, no write); if it names a node the session has not reached (or an unknown node) the submit fails closed with a renderer.node_mismatch issue (422), the current node re-presented. When absent, the answer is applied to whatever node the session is on — which is why a client that omits it can lose step after the server skips a question.

Response

the next node, or completion

The result of a resolve, next, or abandon call — the session identity, the current question (or null when finished), the status, any flags (e.g. ship_state_mismatch), and any validation issues. On completion it may carry the entry-link hand-off.

journey_id
string
required
Pattern: ^jny_[A-Za-z0-9][A-Za-z0-9_-]*$
session_id
string
required
status
enum<string>
required

active (a node is presented), complete (server-authoritative completion), abandoned (patient drop-off), or blocked — a terminal, server-authoritative refusal to proceed (a required consent was declined or could not be affirmed). On blocked, node is null and blocked carries the honest stop-screen outcome.

Available options:
active,
complete,
abandoned,
blocked
blocked
object

The honest stop-screen outcome. Present only when status is blocked. Carries the machine-readable reason, the node at which the block occurred, the consent scopes that were not granted (codes, never patient data), and a support-routing hint. The stop-screen copy is a presentation concern (the intake kit renders it); no patient data ever rides here. No order lock ever forms without a positive affirmation where one is required.

destination_capability
string

Present ONLY on the response to the call whose answer completed the questionnaire, and only when that questionnaire was started by your server with your secret key and no enrollment id (a fresh start, not a resume). It is a short-lived credential (about 10 minutes) that proves this browser's patient walked this enrollment. Never put it in a URL, never send it to browser JavaScript, and never log it. Hand the patient to checkout with a top-level form POST to https://member.<your brand domain>/api/checkout/door, with this value in the capability field of the request body and your offering_ref beside it. The form must be submitted from a page on one of your brand's registered browser origins (the browser's Origin header must match one exactly); any other origin is refused. If it has expired, the patient restarts the questionnaire; it is never reissued from the enrollment id. A repeated call on an already-complete session does not carry it again.

flags
string[]
handoff
object

Post-completion hand-off carried when a session that began from an entry link completes. Present only when status is complete and the session carried a validated entry context. redirect holds a brand-allowlisted https URL; promo is an opaque pass-through token validated downstream; test is the per-client test-mode flag. Never carries patient data.

issues
object[]
node
object | null

A node as presented to the client — PRESENTATION ONLY. The client never owns the sequence, controls, or option order (those come from the compiled bundle; a brand theme cannot alter them). Brand theme/copy, when applied, ride alongside as presentation overlay.

patient_readiness
object

Present on a resolve: whether your brand is ready for patients, and what is still missing if not. The questionnaire is served either way.

progress
object

Server-computed progress metadata, present on every resolve/next step: computed from the live effective plan — never client-guessed. position_estimate is the honest fraction of the plan completed (0..1); display nodes participate in the fraction. Whether and how it renders (thin persistent bar, step ring, interstitial pacing, none) is brand-theme presentation.