Generate collections from your API specification

Spec Hub is available with Postman Enterprise plans.

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 API specification. Postman automatically creates a collection with folders, requests, and response examples based on the specification. Types is turned on for the generated collection, defining properties for parameters and headers based on the specification.

Postman supports generating collections from the following types of specifications:

  • OpenAPI 3.0 specifications
  • AsyncAPI 2.0 specifications that use the WebSocket protocol

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

  1. Select Specs in the sidebar and select a supported specification.
  2. Select New collection icon Generate Collection in the upper right.
  3. Enter a name for your collection.
  4. (OpenAPI 3.0 specs only) Change any settings to customize the new collection.
  5. Select Generate Collection.

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

Generate a collection from a specification

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

Keep OpenAPI collections in sync with a specification

When you generate an OpenAPI 3.0 collection from an API 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 specification isn't in sync with any generated collections. To fix the problem, 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. Select 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. Select 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

Last modified: 2025/03/17