Postman Collections: Organizing Your API Tests
Postman collections, creating collections, adding requests, folder organization, collection runner, import export collections, collection-level scripts
Postman Collections: Organizing Your API Tests
Postman Collections are the backbone of organized API testing. A collection is a group of related API requests saved together — like a folder structure for your entire API test suite. If you have been making ad-hoc requests without saving them, you are missing one of Postman's most powerful features. Professional Postman API testing workflows always start with a well-organized collection.
[IMAGE: Postman Collection Structure]
Prompt: Minimal flat diagram showing a Postman collection hierarchy: top-level collection named "E-Commerce API", two folders inside (Users API and Products API), each containing 3-4 request items labeled GET, POST, PUT, DELETE. Clean icons, white background, modern developer style.
Creating a Collection
- Click the Collections icon in the left sidebar.
- Click the + button or "New Collection".
- Give it a descriptive name — for example, "ScriptValley Blog API".
- Add a description explaining what this collection tests.
- Click Create.
Adding Requests to a Collection
To save a request to a collection:
- Build your request in the request builder.
- Press Ctrl+S (Cmd+S on Mac) or click the Save button.
- Choose an existing collection or create a new one.
- Give the request a descriptive name: "Get User by ID", "Create New Post", "Delete Comment".
Alternatively, after sending a request, hover over it in the History panel and click the bookmark icon to save it directly to a collection.
Organizing with Folders
Inside a collection, use folders to group requests by resource or feature. A well-organized collection for a blog API might look like:
- Blog API Collection
- Authentication folder: Login, Refresh Token, Logout
- Posts folder: Get All Posts, Get Post by ID, Create Post, Update Post, Delete Post
- Comments folder: Get Comments, Add Comment, Delete Comment
- Users folder: Get Profile, Update Profile, Change Password
Collection-Level Variables and Scripts
Collections support variables and scripts at the collection level — they apply to every request inside the collection:
- Collection variables: Define variables shared across all requests in the collection. Set them in the collection's Variables tab.
- Pre-request Script (collection level): Runs before every request in the collection — useful for refreshing auth tokens automatically.
- Tests (collection level): Assertions that run after every request — useful for checking that every response has a valid Content-Type.
Running a Collection with the Collection Runner
The Collection Runner executes all requests in a collection in sequence — automating your entire test suite in one click:
- Click the Run button on the collection.
- Select which requests and folders to include.
- Set the number of iterations and delay between requests.
- Click Run [Collection Name].
- Review the results — each request shows Pass/Fail status for all test assertions.
Importing and Exporting Collections
Collections can be exported as JSON files and imported by teammates. This makes it easy to share your entire test suite:
- Right-click a collection in the sidebar and select Export.
- Choose Collection v2.1 format for maximum compatibility.
- Share the exported JSON file, or import it via File > Import.
You can also share collections via a Postman link if you have a team workspace.
Key Takeaways
- Collections are organized groups of saved requests — always use them instead of ad-hoc requests.
- Organize requests into folders by resource or feature for clear structure.
- Collection-level scripts and variables apply to every request inside — use them for common auth and validations.
- Use the Collection Runner to execute all tests automatically and review pass/fail results.
