How an export runs
Every export in Apiome — from the Export dialog, the Export studio, the CLI or the REST API — runs the same pipeline as an export job. It is the reverse of an import: instead of reading a file into a version, it reads a version and writes a file in the format you pick. Any format Apiome reads can be exported to any format it writes.
The pipeline
- Pick a version and a target. The source is one version of an item (the latest when you name
none). The target is the format to write, such as
openapi,protobuforavro, with its options. - Preview the fidelity. Before anything is written, Apiome predicts what the target keeps, changes and drops, and grades it lossless, lossy or types-only — see Understand export fidelity. A dry run stops here.
- Guard the conversion. The conversion is classed by how much of the source survives:
- clean — nothing is lost;
- lossy — some detail is lost, but the operations survive; the fidelity report lists it;
- near-empty — the target is types-only, so only the schemas export and every operation is left out (for example an OpenAPI item exported to Avro); the export warns that only schemas export;
- severe — the target cannot represent what the source is about (an event-only API exported to gRPC, or a critical loss such as a union with no form in the target, or an MCP descriptor or A2A card with more tools or skills than a model can take — the grouping guard). A severe export needs your confirmation; without it the job fails before anything is written.
- Emit. The target's emitter writes the files.
- Validate. Each export is checked before you can download it — re-imported, or checked with the format's own tool where the server has it (see Exports checked with the format's own tool). An export that fails its check is never delivered — see How an export is checked. A format whose checker is not installed is reported as not re-validated, not as failed.
- Decide delivery. The check's verdict, the source's lint grade, the predicted fidelity and the workspace's export quality policy are folded into one decision: deliver, deliver with a warning (logged on the job), or block.
- Package and deliver. One file is delivered as itself; several files (a multi-file target,
several formats or several items in one job) as one
.zipwith a manifest. What you get, how long it is kept and every way to send it on are summed up on Get an export out.
Job states
A job is queued, running, completed, failed or canceled. While it runs it reports a percentage and a log of events. A finished job describes itself:
- completed — its result holds the fidelity report, the files written and the path to download them from;
- failed — its error names a code, a message and the context to act on. The codes you are most likely to see:
| Code | Why the job failed | What to do |
|---|---|---|
TRANSCODE_CONFIRMATION_REQUIRED | The conversion is severe and was not confirmed. | Read the warning, then start the job again with confirm. |
STALE_PREVIEW | The preview you acknowledged no longer describes the export: the version, the options or the emitter changed since. | Preview again, then export. |
EMITTED_ARTIFACT_INVALID | The written export failed its check. | The error lists each problem with its file and place; report it, since the emitter wrote it. |
EXPORT_DELIVERY_BLOCKED | The delivery decision blocked it: the source's lint grade or the predicted fidelity falls below the workspace's export quality policy. | The error gives each reason; fix the source, pick another target, or ask an admin about the policy. |
You can cancel a queued or running job. A workspace runs up to five export jobs at a time; see Limits.
Where you start a job
| Surface | How |
|---|---|
| Export dialog | Pick a target card, check the Fidelity step, then export. A severe conversion asks you to confirm first. |
| Export studio | Follow a conversion step by step, and watch, download or cancel its job. |
| CLI | apiome export <format> <item> --out <file> polls the job for you. A lossy or types-only export exits non-zero unless you add --force. |
| REST API | POST /v1/export/{tenant_slug}/jobs, then poll the status_path it returns. |
With the REST API
POST /v1/export/{tenant_slug}/jobs
Content-Type: application/json
{
"artifact": "<project id>",
"version": "1.0.0",
"target": "protobuf",
"options": {},
"confirm": false
}
- The
202response carries thejob_idand astatus_path. - Poll
GET /v1/export/{tenant_slug}/jobs/{job_id}untilstateiscompleted,failedorcanceled. - Download the result from
GET /v1/export/{tenant_slug}/jobs/{job_id}/download, or deliver it: to a GitHub repository as a pull request or a commit withPOST /v1/export/{tenant_slug}/jobs/{job_id}/deliveries/git(see Deliver an export to a git repository), or push it to a pipeline as a signed webhook withPOST /v1/export/{tenant_slug}/jobs/{job_id}/deliveries/webhook(see Deliver an export to a webhook), or upload it to an S3-compatible bucket withPOST /v1/export/{tenant_slug}/jobs/{job_id}/deliveries/object-storage(see Deliver an export to object storage). To reuse a destination, save it as a profile and deliver withPOST /v1/export/{tenant_slug}/jobs/{job_id}/deliveries(see Reuse a delivery destination with a profile).
To export several formats, items or versions in one job, see
Export several at once. To reuse targets, options and delivery, name a
saved preset with "preset"
instead of target, targets and options.
Set "dry_run": true to stop after the fidelity report, and "confirm": true to run a severe
conversion. Pass the preview's snapshot hash as acknowledged_snapshot to make sure the export is the
one you previewed. DELETE /v1/export/{tenant_slug}/jobs/{job_id} cancels a job, and
GET /v1/export/{tenant_slug}/jobs lists the workspace's jobs. To export several formats, several
versions or several items in one job, see
Export to several formats in one job. Every
route and field is in the export jobs reference.