Export a spec
Apiome reconstructs the full OpenAPI 3.1 document (or Arazzo workflow document, or JSON Schema) for a published version on demand. You can download it from the CLI or fetch it directly over REST in JSON or YAML.
Those three have dedicated endpoints, but they are not the whole export surface: Apiome emits 44 formats — AsyncAPI, GraphQL, Proto3, Avro, Thrift, Smithy, TypeSpec, WSDL, XSD, OData, EDI X12, HL7 v2, FHIR, COBOL copybooks and more — through the export-target registry. The full list, and which formats round-trip (import and export) versus export only, is generated at Supported formats.
Run apiome export targets to see the same list for a specific version, and
apiome export evidence --target <format> to see what a given conversion preserves before you
generate it.
With the CLI
# OpenAPI (default), JSON, to a file
apiome spec export --project <id-or-slug> --version <id-or-label> --output petstore.json
# YAML
apiome spec export --project <id-or-slug> --version <id-or-label> --yaml -o petstore.yaml
# Exporting to another format (AsyncAPI, GraphQL, Proto3, Avro, …)? Check what will be
# preserved — and why anything changes — before you generate:
apiome export targets --project <id-or-slug> --version <id-or-label>
apiome export evidence --project <id-or-slug> --version <id-or-label> --target avro
# Arazzo workflow document instead of OpenAPI
apiome spec export --project <id-or-slug> --version <id-or-label> --format arazzo -o flows.json
Use -o - to stream to stdout. --format accepts openapi (default) or arazzo.
With the REST API
GET /v1/schema/{tenant_slug}/{project_slug}/{version_slug}
Accept: application/json # default; use application/yaml for YAML
Other representations of the same version:
| Format | Route |
|---|---|
| OpenAPI | GET /v1/schema/{tenant}/{project}/{version} |
| Arazzo | GET /v1/arazzo/{tenant}/{project}/{version} |
| JSON Schema | GET /v1/json/{tenant}/{project}/{version} |
For private versions, pass an in-scope API key via the X-API-Key header (or the api_key query
parameter).
Verify
The exported document is valid OpenAPI and contains the classes and paths you edited. The
Golden Path does exactly this — it exports via the real CLI and re-validates the
downloaded document with openapi-spec-validator.
Test-drive it
For OpenAPI targets, the Export studio's Review step can turn the artifact you just generated into
a live mock for a few minutes — one click, a base URL you can curl, responses generated from
the document's own response schemas, and a log of everything it served. It is the strongest check
available: a document that cannot answer its own operations is a finding no static validation would
surface.
POST /v1/export/{tenant_slug}/mock
{ "artifact": "<project-id>", "version": "1.0.0", "target": "openapi" }
The mock expires by itself, and servers without the Mock Server deployed report the capability as unavailable rather than offering a button that cannot work. See export_mock_test_drive.md for the endpoints, the lifetime rules and the configuration, and Mock try-out for the panel.
Related
- Supported formats — every format Apiome imports and exports, generated from the registries
- Understand export fidelity — cross-format exports: what is preserved, what is lost and why, and the risk acknowledgement
- Browse published specs — view the same spec rendered
- CLI quick-start — full CLI reference