Postman Integeration

Generate a postman collection full of example requests and responses

Showcase

Getting started

The configuration for the postman generator lives in your fern folder, in a file called generators.yml.

Step 1: Configure your generators.yml

Start by running the following command:

1fern add fern-postman --group postman

Once the command completes, you will see the following configuration added:

generators.yml
1groups:
2 postman:
3 generators:
4 - name: fernapi/fern-postman
5 version: 0.0.45
6 output:
7 location: local-file-system
8 path: ../postman

Step 2: Generate a collection.json

Start by running the following command

1fern generate --group postman

This will trigger postman collection on Fern’s cloud. Once complete, you’ll see a collection.json:

$fern/
> ├─ fern.config.json
> ├─ generators.yml
>postman
> ├─ collection.json

Publishing

If you’d like Fern to publish the collection directly to Postman instead, you can modify your generators.yml configuration in the following way:

generators.yml
1generators:
2 postman:
3 generators:
4 - name: fernapi/fern-postman
5 version: 0.4.0
6 output:
7 location: postman
8 api-key: ${POSTMAN_API_KEY}
9 workspace-id: 07e228e5-3f91-4223-8e27-bbfe4a81a601
10 collection-name: My collection name

If you’d like to publish to a particular collection, just specify the collection ID.

generators.yml
1generators:
2 postman:
3 generators:
4 - name: fernapi/fern-postman
5 version: 0.4.0
6 output:
7 location: postman
8 api-key: ${POSTMAN_API_KEY}
9 workspace-id: 07e228e5-3f91-4223-8e27-bbfe4a81a601
10 collection-id: 21510182-14b07230-46e2-431e-8153-d5c7d217b214
11 collection-name: My collection name