A Postman Collection is a group of API requests saved together in Postman. Collections help developers organize and manage multiple API requests for the same project.
A Postman Collection is a container that stores multiple API requests in one organized place.
For example, a Student Management API may have requests for:
Collections make API testing easier because related requests can be kept together.
Benefits include:
A project can have its own Postman Collection.
For example:
Student Management API
All student-related API requests can be stored inside this collection.
In Postman, you can create a collection from the Collections section.
Basic steps:
Give the collection a meaningful name.
Example:
Student Management API
A clear name makes it easier to identify the collection later.
After creating a collection, API requests can be saved inside it.
For example, a GET request:
GET
http://localhost/api/students.php
This request can be saved inside the Student Management API collection.
Suppose we have a GET request for retrieving students.
GET /api/students.php
Save the request inside the appropriate collection.
The request can then be reused whenever student data needs to be tested.
A POST request for adding a student can also be stored in the same collection.
POST /api/students.php
The request can contain JSON data such as:
{
"name": "Rahul",
"course": "ADCA"
}
A PUT request for updating a student can also be added to the collection.
PUT /api/students.php?id=10
This keeps the update request together with the other student API requests.
A PATCH request can also be stored in the collection.
PATCH /api/students.php?id=10
This can be used to test partial updates.
A DELETE request can be saved in the same collection.
DELETE /api/students.php?id=10
Now the collection contains requests for the main CRUD operations.
A collection can contain all CRUD requests for an API.
Student Management API
│
├── GET Students
├── GET Student
├── POST Student
├── PUT Student
├── PATCH Student
└── DELETE Student
Collections can be organized using folders.
For example:
Student Management API
│
├── Authentication
├── Students
├── Courses
└── Users
Folders make large collections easier to manage.
Authentication-related requests can be grouped inside an Authentication folder.
Examples:
Authentication
├── Register
├── Login
└── Logout
Student-related requests can be stored inside a Students folder.
Students
├── Get Students
├── Get Student
├── Add Student
├── Update Student
└── Delete Student
This structure makes the collection easier to understand.
Give each request a meaningful name.
Instead of:
Request 1
Use:
Get All Students
Meaningful names make API testing easier.
Each saved request contains its API URL.
http://localhost/api/students.php
When the request is opened later, the saved URL can be used again.
Headers can also be saved with a request.
Content-Type: application/json
Accept: application/json
This allows the request to be reused with the same header configuration.
POST, PUT, and PATCH requests can save their request body inside the request.
{
"name": "Rahul Kumar",
"course": "ADCA"
}
This makes repeated API testing easier.
One major benefit of a collection is that saved requests can be reused.
Instead of creating the same request again, open it from the collection, modify the required values, and send it.
A collection can act as a complete set of API requests for testing a project.
API Project
↓
Postman Collection
↓
Multiple Requests
↓
API Testing
This is useful when an API contains many endpoints.
Suppose we are building a React Native Student Management application.
The backend may contain:
All these requests can be stored in one Postman collection.
Student Mobile App API
│
├── Authentication
│ ├── Register
│ ├── Login
│ └── Logout
│
├── Students
│ ├── List Students
│ ├── Student Details
│ ├── Add Student
│ ├── Update Student
│ └── Delete Student
│
└── Profile
└── Get Profile
Collections can also help teams organize and share API request definitions.
A backend developer can prepare API requests while a mobile developer can use those requests to understand and test the API endpoints.
The exact sharing and collaboration features depend on the Postman setup being used.
Use clear and meaningful names.
Avoid unclear names such as Test1 or New Collection for production projects.
Before using a collection, check:
Student Management API
│
├── Authentication
│ ├── Register
│ └── Login
│
├── Students
│ ├── Get All Students
│ ├── Get Student
│ ├── Add Student
│ ├── Update Student
│ ├── Patch Student
│ └── Delete Student
│
└── Profile
└── Get Profile
This collection can contain the main API requests required by a student management mobile application.
A Postman collection can be used during React Native development to test the backend before writing or debugging the mobile application's API integration.
Postman Collection
↓
Test REST API
↓
Verify JSON Response
↓
React Native Integration
↓
Mobile Application
This helps separate backend API testing from mobile UI development.
A Postman Collection is a useful way to organize multiple API requests. Requests can be grouped into folders for authentication, students, users, products, or other project features. Collections make API testing and reusing requests much easier.
Collection
↓
Folders
↓
API Requests
↓
GET / POST / PUT / PATCH / DELETE
↓
REST API Testing
Question: What is a Postman Collection mainly used for?