Generate collections from your API specification

You can generate a collection from a specification to share it with your team members and consumers. With the generated collection, they can test your API or explore its capabilities. You can also keep a collection in sync with its specification if it was generated from an OpenAPI 3.0 specification.

Generate collections from a specification

You can generate a Postman Collection from your OpenAPI 3.0 specifications and AsyncAPI 2.0 specifications that use the WebSocket protocol. Postman automatically creates a collection with folders, requests, and response examples based on the specification.

To generate a collection from a specification, do the following:

  1. Click Docs icon Specs in the sidebar and select a supported specification.

  2. Click New collection icon Generate Collection in the upper right.

    Generate a collection from a specification

  3. Enter a name for your collection.

  4. (OpenAPI 3.0 specs only) Change any settings to customize the new collection:

    • Naming requests - Determines how request names in the generated collection. Select Fallback (default) to name the requests based on one of the following schema values: summary, operationId, description, or url. Select URL to name the requests based on the path parameter.

    • Parameter generation - Determines whether to base the request and response parameters on the Example (default) or Schema.

    • Folder organization - Choose whether to create folders based on the specification’s Paths (default) or Tags.

    • Nested folder organization using tags - If you created folders based on the specification’s tags, turn this on to create a nested folder structure based on the order of tags used to group operations.

    • Set indent character - Set character indentation to Space (default) or Tab.

    • Include auth info in example requests - Turn this on to include authentication parameters from example requests.

    • Enable optional parameters - Turn this on to enable optional parameters in the generated collection and its requests.

    • Keep implicit headers - Turn this on to include implicit headers in the generated collection and its requests. This is turned off by default.

    • Include deprecated properties - Turn this on to include deprecated operations, parameters, and properties in the generated collection.

    • Always inherit authentication - Turn this on to include authentication details in every request and inherit authentication details from the parent collection. This is turned off by default.

  5. Click Generate Collection.

To view the generated collection, click Down Large icon the arrow next to New collection icon Generate Collection and select the collection. You can also click Collections in the sidebar.

You can generate more than one collection from the same specification.

Keep OpenAPI collections in sync with a specification

When you generate a collection from an OpenAPI 3.0 specification, Postman creates a collection with requests that match what’s defined in the specification. If you update the specification, for example by adding a path, Postman alerts you that the generated collections aren’t in sync with the specification. To fix this, update the collections based on the latest changes to the specification.

Syncing isn’t available for collections generated from AsyncAPI specifications.

To update generated collections, do the following:

  1. Click Docs icon Specs in the sidebar and select an OpenAPI 3.0 specification.

    An orange dot on Down Large icon the arrow next to New collection icon Generate Collection indicates one or more collections aren’t in sync with the specification.

  2. Click Down Large icon the arrow next to New collection icon Generate Collection.

  3. Select Update next to the generated collection you want to update.

Update a collection from a specification

Updates to the source specification may overwrite changes made directly to the generated collection. To avoid this, it’s recommended that you only update the source specification and then follow the steps to sync it with the generated collection.

Postman doesn’t delete elements from a generated collection when you sync it with the source specification. For example, if you change the name of an existing path in your specification, Postman will create a new path in your generated collection when it’s updated. The existing path still exists with the previous name in your generated collection, and you can choose to delete the path.

Last modified: 2025/03/17