Skip to Main Content
How to

Import and export

Use the right format for the job: workspace JSON for full backups, collection packs for reusable groups, and OpenAPI import/export for server-level interoperability.

Choose the right format

  • Workspace JSON: use for full backup/restore of your local Mockphine workspace.
  • OpenAPI: use for importing/exporting one server as an API spec (v2/v3).
  • Collection pack JSON: use for sharing a reusable subset of endpoints.

Import actions are protected until activation. Complete Activate and license first.

What you can import and export

  • Export a full workspace to JSON.
  • Import a workspace JSON into Mockphine.
  • Export a selected server to OpenAPI v3 YAML.
  • Export a selected server to OpenAPI v2 (Swagger) YAML.
  • Import OpenAPI v2/v3 from YAML or JSON into a selected server.
  • Import OpenAPI v2/v3 from the empty state to create a new server automatically.
  • Export a collection as a pack JSON and import it into another workspace.
  • Use built-in packs (Auth, Pagination, Stripe-like errors) to start fast.

OpenAPI import workflow (recommended)

  1. Ensure activation is complete.
  2. Choose the target server (or start from the empty state).
  3. Open the server Data menu and select Import OpenAPI.
  4. Select a `.yaml`, `.yml`, or `.json` OpenAPI file.
  5. Review any OpenAPI import warnings shown after import completes.
  6. Test key routes in Live View before relying on the imported setup.

OpenAPI import behavior

  • Selected-server import replaces that server collections and endpoints only.
  • Selected-server import keeps server settings unchanged (name, local host/port, real backend URL, and fallback mode).
  • OpenAPI import supports .yaml, .yml, and .json.
  • Mockphine auto-detects OpenAPI v2 vs v3 on import.
  • Import uses best-effort mapping. Unsupported constructs may be skipped and shown in an OpenAPI import warnings dialog after import.
  • Empty-state import can create a server from Mockphine metadata (x-mockphine-server) or infer basic settings from OpenAPI info.title and servers.
  • Invalid OpenAPI files do not create a server in empty state import.
  • Mockphine-generated OpenAPI preserves same-route cases, wildcard route intent, and passthrough path templates through Mockphine-specific metadata when re-imported into Mockphine.

Workspace and pack import notes

  • Pack import requires schemaVersion = 1.
  • Imported pack items are re-IDed to prevent ID collisions.
  • AI provider API keys are not included in workspace or pack export/import.

After any import, scan endpoint modes and a few representative routes first so you catch mismatches before broader testing.

Import and export menu
Screenshot
Use the server menu Data section for workspace JSON, OpenAPI (v2/v3), and collection pack import/export actions.
Server context menu open to Data options for workspace JSON, OpenAPI, and collection pack import and export.