How to Use Folder in Collection in Postman: Step-by-Step Guide
In Postman, you can organize your API requests by creating
folders inside a collection. Folders help group related requests, making your tests easier to manage and run together. Simply create a folder within a collection and add requests to it.Syntax
In Postman, a collection is a container for API requests. Inside a collection, you can create folders to group related requests. The basic structure is:
- Collection: The main container for your API requests.
- Folder: A subgroup inside a collection to organize requests.
- Request: An individual API call inside a folder or directly in the collection.
You create folders via the Postman UI by clicking the New Folder button inside a collection.
plaintext
Collection โโโ Folder 1 โ โโโ Request A โ โโโ Request B โโโ Folder 2 โโโ Request C
Example
This example shows how to create a folder named Users inside a collection called My API and add two requests to it.
plaintext
1. Open Postman and select your collection named "My API". 2. Click the three dots next to the collection name and select "Add Folder". 3. Name the folder "Users" and save. 4. Inside the "Users" folder, click "Add Request". 5. Create a request named "Get User" with method GET and URL https://api.example.com/users/1. 6. Add another request named "Create User" with method POST and URL https://api.example.com/users. 7. Save all changes.
Output
Folder "Users" created inside "My API" collection with two requests: "Get User" and "Create User".
Common Pitfalls
- Not saving the folder after creation, so it does not appear in the collection.
- Adding requests outside the folder unintentionally, which breaks organization.
- Confusing folders with environments; folders only group requests, they don't store variables.
- Trying to run a folder without selecting it properly in the runner.
plaintext
Wrong way: - Creating requests directly under collection but expecting them to be in a folder. Right way: - Explicitly create a folder and add requests inside it to keep them grouped.
Quick Reference
| Action | How to do it | Purpose |
|---|---|---|
| Create Folder | Right-click collection > Add Folder | Group related requests |
| Add Request to Folder | Drag request into folder or create inside folder | Organize requests logically |
| Run Folder | Select folder in Collection Runner > Run | Execute grouped requests together |
| Rename Folder | Right-click folder > Rename | Keep names clear and meaningful |
| Delete Folder | Right-click folder > Delete | Remove unwanted groups |
Key Takeaways
Folders in Postman collections help organize API requests into logical groups.
Create folders by right-clicking a collection and selecting 'Add Folder'.
Add requests inside folders to keep your workspace tidy and manageable.
Use the Collection Runner to run all requests inside a folder together.
Always save your folder and requests to avoid losing changes.