The async model
POST /v1/search returns 202 Accepted right away with a parent job. The parent fans out into one child per surface × region — that’s the unit of work that actually runs a capture and produces an Envelope.
202 response names the parent and lists its children — here, 2 surfaces × 2 regions = 4 children:
The response also carries a
Location header pointing at the parent job, and an X-AISearch-Version header. For a single surface where you’d rather block and get the result inline, use ?mode=sync (or the Prefer: wait header) — see Sync vs async.Parent vs child ids
The shape of a job id tells you what you’ll get back when you read it.Resolves to the fan-out summary:
{ job, children[] }. Use it to see overall status and enumerate children.Shaped
job_<id>.<surface>.<region>. Resolves to the canonical Envelope — the answer plus the structured evidence — for exactly one surface in one region.GET /v1/jobs/:id. The id you pass decides which shape comes back.
Lifecycle states
| State | Kind | Meaning |
|---|---|---|
queued | Active | Accepted, waiting to run. |
processing | Active | A capture is running (or children are still in flight). |
completed | Terminal | Finished successfully. |
partial | Terminal | Parent only — some children completed, some failed. |
failed | Terminal | Did not produce a result. |
canceled | Terminal | Stopped before completion. |
expired | Terminal | Aged out before running. |
Parent rollup rules
A parent’s status is derived from its children:completed— every child completed.failed— every child failed.partial— a mix of completed and failed children.
queued or processing, the parent stays processing.
A child can complete even when the surface returned nothing. In that case the Envelope has
provenance.surfacePresent: false, an empty answer, and a surface_absent warning — the job is still completed, and an empty capture is not charged. See The Envelope.How to read results
You have two ways to collect results after the202.
Poll the parent for status
GET /v1/jobs/job_8t2q returns the current parent status and every child’s status. Stop as soon as the parent reaches a terminal state.GET looks like this:
A minimal poll loop
Node
The Envelope
The canonical shape a child job resolves to.
Webhooks
Get pushed each child’s result instead of polling.