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 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. Types is turned on for collections generated from an OpenAPI 3.0 specification, defining properties for parameters and headers based on the specification.

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

  1. Select Docs icon 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 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 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 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. 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

Postman doesn't delete elements from a generated collection when you sync it with your 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