Collections in Postman

Bisma Latif
5 min readJul 3, 2023

This is the third article in the Postman for API testing series. To access previous articles here are the links:

  1. API Testing using Postman [CRUD operations]
  2. Variables in Postman

What is COLLECTION in Postman?

In Postman, collections are a way to organize and group related API requests, scripts, tests, and documentation into a single entity. Collections allow you to manage and work with multiple requests in a structured manner, making it easier to collaborate, share, and maintain your API workflows.

Postman Collections cover image

Features and benefits of using collections in Postman:

Here are some key features and benefits of using collections in Postman:

Grouping requests: Collections enable you to group related API requests together. For example, you can create a collection for a specific API or a set of API endpoints related to a particular functionality.

Organizing and managing requests: Within a collection, you can create folders to further organize your requests. This hierarchical structure helps you maintain a logical structure and makes navigating your API workflows easier.

Request chaining: Collections allow you to chain multiple API requests together, where the output of one request can be used as input for subsequent requests. This feature is useful for scenarios where you need to perform a series of API calls in a specific sequence.

Environment and variable management: Postman collections support environment variables, which allow you to parameterize your requests and manage different sets of values for different environments (e.g., development, testing, production). This enables you to easily switch between environments without modifying the requests manually.

Pre-request and test scripts: Collections allow you to define pre-request and test scripts for individual requests. Pre-request scripts are executed before sending the request and can be used to set up necessary data or perform actions. Test scripts are executed after receiving the response and can be used to validate the response data or perform assertions.

Sharing and collaboration: Postman collections can be easily shared with team members or the broader community. You can export collections as JSON files or publish them on the Postman Cloud, making collaborating and reusing collections across different projects simple.

API documentation: Collections can also serve as a documentation source for your APIs. Postman provides options to generate and publish API documentation based on the requests and descriptions within a collection, making it easier for others to understand and consume your APIs.

Overall, collections in Postman provide a structured and organized way to manage your API workflows, facilitating collaboration, testing, and documentation efforts.

How to Create a Collection in Postman?

To create a collection in Postman, follow the steps below:

Step 1: Launch the Postman application or open the Postman web client.

Step 2: In the left-hand sidebar, click on the “Collections” tab.

Step 3: Click on the “New” button (usually located at the top-right corner) to create a new collection.

Step 4: Give your collection a name in the provided field.

Step 5: Optionally, create folders within the collection to organize your requests. Click on the “New Folder” button within the collection and provide a name for the folder.

Step 6: Add requests by clicking on the collection or folder where you want to add the request. Then, click on the “New” button (usually represented by a plus (+) icon).

Step 7: Enter the details of the API request in the request editor, including the URL, method, headers, parameters, and body.

Step 8: Click on the “Save” button to save the request within the collection. Repeat this process to add more requests.

Step 9: Organize and reorder your requests within the collection by dragging and dropping them into the desired position.

Step 10: Save the collection by clicking on the “Save” button at the top-right corner of the Postman interface.

How to share collections in Postman?

Sharing collections in Postman allows you to collaborate with team members or share your API workflows with others. Here’s how you can share collections:

  1. Open the Postman application or web client and navigate to the collection you want to share.
  2. Ensure that the collection is saved by clicking the “Save” button if any changes were made.
  3. Click on the ellipsis (…) button next to the collection name to open the options menu.
  4. From the options menu, select “Share”.
  5. In the sharing dialog, you have multiple options for sharing the collection:
    a. Share via link: Click on the “Get public link” button to generate a public link for the collection. You can choose to make the link read-only or allow others to edit the collection. You can copy the link and share it with others via email, chat, or any other preferred method.
    b. Share with team: If you’re working in a team, you can share the collection with your team members by clicking the “Share with team” button. Select the team from the list, and choose whether they can view or edit the collection.

c. Export collection: If you prefer to share the collection as a file, you can click on the “Export” button. Postman allows you to export collections in various formats, including JSON, YAML, and cURL.

6. Choose the sharing option that best suits your needs and follow the prompts to complete the sharing process.

By sharing collections, you can collaborate with others, allow them to view or edit the collection, and maintain a centralized repository of your API workflows. It’s important to ensure that you choose the appropriate sharing settings to protect sensitive information and control access to your collections.

After the end of this article, you will be able to create collections in Postman. If you have any questions, drop me a comment.

Till then Happy Testing!

--

--

Bisma Latif

A writer, coder, and an avid reader, who puts her soul in everything she does!