run_id you poll to a terminal state. Only one run
runs at a time per migration — starting a second while one is in flight returns
409.
{migration_id} is the id from
creating a migration.
Authentication
Requires anx-api-key header. See Authentication.
Request body
Which phase to run:
generate— author the mapping recipe and stop at a preview. Needs a data source: at least one uploaded file, a connected live source, or both.update— edit the current recipe permessage, producing a new preview that replaces the current one. Requires an existing preview.clarify— ask a read-only question about the current preview. Returns an answer in the run thread and changes nothing. Requires an existing preview.execute— run the approved preview’s recipe as the real import. Requires a ready preview.
Required for
update and clarify — your instruction or question in plain
language (e.g. "Use the company domain for any missing Email, don't drop the row."). Ignored for generate and execute.generate only. Explicitly controls live API extraction from a
connected source:true— extract via the connection (alongside any uploaded files).false— file-only; never extract via API, even with no files.- omitted — the default: extract via API only when no files were uploaded and a connection exists.
update, clarify, and execute. Must be a boolean.execute runs the recipe behind the
current preview; update/clarify act on it.
generate opens a preview run; update, clarify, and execute resume that
same run, so the run_id stays stable from preview all the way through the
real import. A resuming call comes back with status: "running" rather than
queued.Response
201 Created
poll_url until the run is terminal for its phase:
generate/update→awaiting_approval(a preview is ready), orblockedif the agent has a question.clarify→completed(read the answer from the thread).execute→completedwith areport, orfailed.
generate/update
produced.
The typical loop
generateonce, after uploading files.- Review the preview. Refine with
update(changes the recipe) or ask viaclarify(read-only) as many times as you need — eachupdateyields a fresh preview. executewhen you’re happy. Thereporttells you what landed.
Errors
A
409 from an in-flight run is how you recover a run you lost track of — the
response carries its run_id:
Examples
Next
- Poll a run — track the run, read the report, cancel it.
- Get the preview — read the generated output.
- Answer the agent — resume a
blockedrun. - Connect a live source — extract via API with
extract_via_api.