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 from the uploaded files and stop at a preview. Requires at least one uploaded file.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.execute runs the recipe behind the current
preview; update/clarify act on it.
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
| Status | Meaning |
|---|---|
400 | kind missing or invalid; generate with no files uploaded; update/clarify with no message. |
401 | API key missing or invalid. |
404 | No migration with that {migration_id} in your account. |
409 | A run is already in progress (the body includes the active run_id); the migration has no target templates; update/clarify/execute with no current preview to act on. |
429 | Rate limit hit — back off and retry. |
500 | Server error. |
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.