Manage a multi-file API specification
Manage a multi-file API specification
Manage a multi-file API specification
With a multi-file API specification in Spec Hub, your specification can span across multiple files and folders, improving its organization and management.
Postman supports the following multi-file specifications in Spec Hub:
All files in a multi-file specification are considered the full API specification. Each multi-file specification has a root file that’s the top-level file in your specification where the root object is defined. The root file hosts the operations defined by the API and it can reference other files in your specification.
When you create a multi-file specification or import a multi-file specification, Postman determines the root file based on the references across the files. Your specification can only have one root file.
You can use the Postman API to bundle all files in your multi-file specification into a single OpenAPI file. Provide the specification ID to get the bundled specification in the response. Learn how to bundle a multi-file specification with the Postman API.
Add one or more files to an OpenAPI or protobuf specification to turn it into a multi-file specification. Then you can add more files and folders to your specification from the file manager.
To create a multi-file specification, do the following:
Expand Specs in the sidebar, then select the specification.
If you don’t have a specification, click in the sidebar, select Spec, then select the type of specification you want to create. You can also import a specification.
Next to your specification, More actions > Add File. This adds a new file to the file manager in the sidebar, located in the sidebar.

Once you’ve created or imported a multi-file OpenAPI or protobuf specification, you can add more files and folders and even search them by name, all from the file manager. You can also rename and delete your files and folders.
To add more files and folders to your specification, do the following:
Expand Specs in the sidebar and select a multi-file specification.
In the file manager, hover over All Files and click Add file or folder, then select one of the following:
Next to a folder, you can also click More actions and then select one of the following:
You can also take the following actions from the file manager:
Your multi-file specification can only have one root file that’s used to reference other files in your specification. You can change the root file in your OpenAPI or protobuf 2 and protobuf 3 multi-file specification at any time.
To change the root file in a multi-file specification, do the following:
Make sure to update the new root file with the root OpenAPI object and references to other files in your specification. Otherwise, Postman can’t parse your specification.