Quick answer: Insomnia's desktop UI has no OpenAPI export option. A UI export gives you only Insomnia v5 YAML or a HAR file. To get OpenAPI, you run inso export spec, which extracts the raw spec already tied to the collection; it does not regenerate a spec from your requests or fold in the edits, environments, scripts, or tests you added while debugging. The trip back to OpenAPI is therefore not a symmetric save, and the original spec stays the contract of record.

What each export actually produces

Insomnia separates moving your whole workspace from extracting the contract, and the two paths return different things.

Path Format What it holds
UI export Insomnia v5 YAML The collection with its spec, requests, environment settings, and tests
UI export HAR A request and response archive for traffic analysis
Inso CLI OpenAPI YAML or JSON The raw spec bound to the collection, written to a file or stdout

The UI labels each export with the entity name and asks for a format, but OpenAPI is not on that list. The CLI command inso export spec "My API Collection" --output spec.yaml is the only built-in route to an OpenAPI file, which makes it a tool for CI and scripting rather than a general save button.

Why the round trip is not symmetric

When you import a spec, Insomnia generates requests as build artifacts. That generation runs one way: editing a generated request changes the request, not the spec. Running inso export spec afterward hands back the original document, so work that lives only in the workspace never makes the return trip.

Stays in the workspace Returns in the exported spec
Environment variables and sub-environments Paths, operations, and schemas from the raw spec
Pre-request and after-response scripts Declared servers and security schemes
Assertions and test suites Component definitions already in the spec
Nunjucks template tags and cookie history Nothing you changed only inside a request

The practical rule is to change the contract in the spec itself and regenerate the request, instead of editing the request and expecting an export to write it back. If you start from a hand-built collection that has no spec, there is no native reverse button. Turning those requests into OpenAPI needs a third-party plugin, and the output has to be reviewed because OpenAPI has no place for scripts, environments, or template tags.

The plain-text trap in exported files

Version 13.4 and later mark variables as confidential. When a v5 file is exported, those names land on a confidentialKeys list, which preserves the marking across import, Git Sync, and duplication. The marking does not protect the value: it stays in plain text in the file's data. Anyone who can read the exported file or the Git repository can read the token.

A confidential label is not encryption. The v5 file records the name on a confidentialKeys list while the real value sits beside it in plain text. Treat the export as a secret even though the variable looks protected. Use secret variables in the vault when you need the value encrypted at rest.

Before committing a v5 file, scan it for tokens the same way you would scan any config, or move sensitive values into secret variables. Relying on the confidential flag to keep a credential out of a shared repository is the failure mode worth avoiding.

Frequently asked questions

Can I export my edited requests straight back to OpenAPI in the UI? No. The UI offers only v5 YAML and HAR. Use inso export spec for OpenAPI, and expect the raw spec rather than a document rebuilt from your requests.

Why do my request changes not appear in the exported spec? Generation is one-way. Edit the spec and regenerate the request so the contract and the calls you send stay aligned.

Are confidential variables safe to commit? No. Their values export in plain text even though the names are listed as confidential. Use secret variables for encrypted storage, and keep plain-text exports out of public repositories.

How do I get OpenAPI from a hand-built collection? Through a third-party plugin. Review the result carefully, since scripts, environments, and template tags cannot be represented in the spec.

The bottom line

Keep the spec as the single source of truth and use each export for what it is good at: v5 for backup and migration, HAR for traffic analysis, and inso export spec for pulling the contract into CI and linting. None of these merge your debugging work back into the contract, and a v5 file should be handled as a possible secret. When your checks need to prove that running requests still match the contract instead of merely moving files around, Powerduck pairs ordered scenario runs with code review in one desktop app. For how the tools differ across these workflows, see the Insomnia comparison hub.