Table of contents
1.
Introduction🤓
2.
Creating a Collection🧑‍💻
2.1.
Customising and Configuring Collections😃
3.
Adding Requests to a Collection💻
3.1.
Moving an Existing Request to a Different Collection📄📲
3.2.
Adding a new request to a collection📄➕
3.3.
Creating a New Request Inside a Collection📄✍️
4.
Managing Collections📃
4.1.
Including Folders in a Collection📁
4.2.
Deleting or Removing a Collection📄🚫
4.3.
Recovering Deleted Collection📂📄
4.4.
Sharing a Collection📤
4.5.
Forking a Collection😃
4.6.
Commenting on a Collection🧑‍💻
5.
Using collections in development workflows📂👾
6.
Frequently Asked Questions
6.1.
What is Collection API?
6.2.
Is Postman only used to create REST API?
6.3.
Why is Postman best for API testing?
7.
Conclusion
Last Updated: Mar 27, 2024
Easy

How to Group Requests in Collections in Postman?

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction🤓

You can organize your workspace by grouping Postman requests and examples into collections. It will help you collaborate with teammates, generate API documentation and do API tests.

postman logo

Collections in Postman are a collection (group) of saved requests. These requests can be categorised and organised into folders. Docs can be created directly from the Postman launch interface or by selecting the API Doc option.

This article will discuss how to group requests in collections in Postman. We will start our discussion by creating a collection. Afterward, we will customise and configure our created collection. Then we will add requests to collections. And we will discuss managing collections. This will conclude our discussion on how to group requests in collections in Postman.

Creating a Collection🧑‍💻

Before knowing how to group requests in collections in Postman. We should learn about how to create a collection. Postman Collections are a collection of previously saved requests. Every Postman request you send is saved in the sidebar's History tab. Reusing the requests through the history section is convenient on a small scale. You were finding a specific request in your Postman history can become time-consuming as your usage grows. You can also save all your requests as a group for easier access rather than scrolling through your history section.

collection

🍁To begin creating a new collection, create a new request first:

In Postman, you can create a new request from the sidebar. Choose New > HTTP Request.

http request

 

Step 1: In the request builder, enter a request and click Save.

Step 2: Select New Collection to start a new collection. Select Create after entering a collection name.

new collection

 

Step 3: To save the request in the new collection, click Save.

Congratulations! Postman displays all of your collections in the sidebar under Collections, as shown below:

new workspace

Customising and Configuring Collections😃

After you've created a new collection. You can customise and configure it as follows:

  1. To give your new collection a name, click the Edit icon.
     
  2. You can add a description to your collection if you want. To write your report, select the documentation icon, then the edit icon. When anyone opens it, this description will appear in the doc as well as in the workspace.
     
  3. Select Authorization to change the collection's authorization details.
     
  4. Choose Pre-request Script to create a pre-request script for your collection. It will run before requests are sent to the server.
     
  5. Select Tests to create a test script for your collection. That will run when it receives a response.
     
  6. Select Variables to define collection variable values that will be shared across all requests in the collection.
customising and configuring collection

Adding Requests to a Collection💻

In our discussion of how to group requests in collections in Postman. We will now add requests to a collection. There are some methods for adding new and existing requests to a collection. These are:

Moving an Existing Request to a Different Collection📄📲

🍁To transfer an existing request to a different collection:

  1. Choose the request to be moved.
  2. Drag the request into the right group.
     

🍁To move multiple requests to a different collection:

  1. Hold Ctrl while selecting the requests you want to move.
  2. Drag the requests to the right group.

Adding a new request to a collection📄➕

🍁To add a new request to a collection:

  1. Select Save from a new request.
  2. Choose the group to which you want to move it, and then click Save.
  3. Select New Collection to create a new collection to save the request.

Creating a New Request Inside a Collection📄✍️

🍁To add a new request to an existing collection:

  1. Select the More actions icon, which is located next to the group name.
  2. From the actions menu, choose Add Request.
creating a new request

Managing Collections📃

In our discussion of how to group requests in Postman collections. We will now discuss how to manage groups (collections). You can do the following from the list of groups in your workspace:

  1. Please select a group to view its details in a new tab.
  2. You can open and close group content by clicking the arrow next to the group name.
  3. To move a group to the top of the list, hover over its name and select the star icon.
  4. Filter your groups using the collection search bar.
  5. Drag and drop requests, folders, and examples within a group to reorder them.
Managing collection

Including Folders in a Collection📁

🍁To add a folder to your collection:

  1. Select the More icon. It is located next to the collection name.
  2. Choose Add folder.

You can also add subfolders to the group's requests and examples to create other levels of nesting.

Deleting or Removing a Collection📄🚫

🍁To remove a collection, follow these steps:

  1. Select the More icon. It is located next to the collection name.
  2. Choose Delete.

You can also select and delete the collection by pressing the Delete key on your keyboard.

Recovering Deleted Collection📂📄

🍁To recover a deleted collection, follow these steps:

  1. Select the More icon. It is located next to the collection search bar.
  2. Choose Open Trash.

Then, select the restore icon next to the collection you want to recover on the Trash page.

Sharing a Collection📤

🍁You can share your groups (collections) with others by doing the following:

  1. Create a Run in Postman button.
  2. Invite others to the team by clicking the More icon next to the group name and then clicking Share
  3. Move the group to a shared workspace by clicking the More actions icon next to the group name and then clicking Move

Forking a Collection😃

🍁You can fork collections in your workspace. To fork a collection:

  1. Select the More icon. It is located next to the collection name.
  2. Choose Fork.

Commenting on a Collection🧑‍💻

🍁To make a collection-level comment:

  1. Choose the comment icon from the right sidebar.
  2. Enter your comment. And then click the Add Comment button.

Using collections in development workflows📂👾

using collection in development

Now, coming to the end of our discussion on how to group requests in collections in Postman. How to use collections in the development process is a must-know thing. Groups can be used to power different aspects of your API development and testing.

  1. Select Run to open the Collection Runner. This lets you run all requests in a collection and incorporate testing workflows into your runs.
  2. To make an API doc from the group, click the doc icon.
  3. You can schedule collection runs when you connect a monitor to a group. Select the More icon next to the group name, followed by Monitor collection.
  4. You can use mock servers to return sample data during testing and development. Select Mock collection from the More icon next to the group name.
  5. Using the Postman API Builder. You can create groups with API specs.

Frequently Asked Questions

What is Collection API?

A collection is a single object that represents a group of objects (such as the familiar Vector class). A collections API is a single framework for managing and describing collections. It allows them to be changed regardless of how they already exist.

Is Postman only used to create REST API?

At the start, we could only create REST API using Postman. After the upgradation, we can create REST, SOAP, and GraphQL queries using Postman. 

Why is Postman best for API testing?

Postman is a type of application that allows users to test APIs. It uses a graphical user interface to do so. Postman has the collection feature and the possibility of creating different testing environments. This is why it makes it Best for API testing.

Conclusion

In this article, we have briefly discussed how to group requests in collections in Postman. We started by creating a new collection. We have then discussed how to change and configure our designed collections. Afterward, we discussed how to add requests to the collection and how to manage these collections. This concludes our discussion of how to group requests in collections in Postman.

If you think this blog has helped you with the topic of how to group requests in collections in Postman. And if you would like to learn more, check out our articles Introduction to PostmanIntegration in PostmanRest APIAPI testingAPI, and Web Testing. You can also refer to our guided path on the basics of java and many more on our Website.

Refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and AlgorithmsCompetitive ProgrammingJavaScriptSystem Design, and many more! If you want to test your competency in coding, you may check out the mock test series and participate in the contests hosted on Coding Ninjas Studio! 

But suppose you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc. In that case, you must look at the problemsinterview experiences, and interview bundles for placement preparations.

Nevertheless, you may consider our paid courses to give your career an edge over others!

Happy learning!

Live masterclass