Postman is the most popular API testing tool for developers. It simplifies API development with an intuitive interface, powerful collections, and automated testing. Whether you're building REST, GraphQL, or gRPC APIs, Postman has you covered.
This tutorial covers everything from basics to advanced features in Postman 2026.
Getting Started with Postman
Installation
- Desktop App: Download from postman.com (recommended for power users)
- Web App: app.postman.com (no installation required)
- VS Code Extension: Thunder Client (lightweight alternative)
Creating an Account
- Free Account: Limited but sufficient for individuals
- Basic Plan: $12/user/month (better collections, unlimited mock servers)
- Professional Plan: $29/user/month (team features, advanced monitoring)
First API Request
Creating a Request
- Open Postman and click "New Request"
- Enter the API URL:
https://api.example.com/users - Select HTTP method: GET, POST, PUT, DELETE, etc.
- Click "Send"
- View response in the bottom panel
Common HTTP Methods
| Method | Description | Example |
|---|---|---|
| GET | Retrieve data | GET /users |
| POST | Create data | POST /users |
| PUT | Update data | PUT /users/123 |
| PATCH | Partial update | PATCH /users/123 |
| DELETE | Remove data | DELETE /users/123 |
Postman Collections
What are Collections?
Collections organize API requests into logical groups. Perfect for APIs with many endpoints.
Creating a Collection
- Create a few related requests
- Select the requests (Cmd/Ctrl + click)
- Click "Save to Collection"
- Create a new collection or add to existing
- Organize with folders inside collections
Collection Structure Example
My API Collection
├── Authentication
│ ├── Login
│ ├── Register
│ └── Refresh Token
├── Users
│ ├── Get All Users
│ ├── Get User by ID
│ ├── Create User
│ ├── Update User
│ └── Delete User
└── Posts
├── Get Posts
├── Create Post
├── Update Post
└── Delete Post
Environments
Managing Multiple Environments
Environments let you manage variables for different stages (dev, staging, production).
Creating Environments
- Click the environment selector (top right)
- Click "Add"
- Name it: "Development"
- Add variables:
base_url:https://dev-api.example.comapi_key:dev-key-123
- Create "Staging" and "Production" environments similarly
Using Environment Variables
In your requests, reference variables with {{variable_name}} syntax:
URL: {{base_url}}/users
Headers:
Authorization: Bearer {{api_key}}
Authentication
Bearer Token (JWT)
- Go to Headers tab in your request
- Add header:
- Key: Authorization
- Value: Bearer {{jwt_token}}
API Key
- Add header:
- Key: X-API-Key
- Value: {{api_key}}
OAuth 2.0
Postman supports OAuth 2.0 flows:
- Click "Authorization" tab
- Select "OAuth 2.0" from Type dropdown
- Configure callback URL, auth URL, token URL
- Click "Get New Access Token"
- Use token automatically in requests
Automated Testing
Writing Tests
Add tests to requests using the "Tests" tab. Postman evaluates tests after receiving the response.
Example Tests
// Test status code
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
// Test response time
pm.test("Response time is less than 200ms", function () {
pm.expect(pm.response.responseTime).to.be.below(200);
});
// Test response body has specific field
pm.test("Response has user ID", function () {
const jsonData = pm.response.json();
pm.expect(jsonData.id).to.exist;
});
// Save value from response for next request
const jsonData = pm.response.json();
pm.environment.set("user_id", jsonData.id);
Running Tests
- Run tests for a single request (Tests tab)
- Run tests for an entire collection (Collection Runner)
- Automate tests with Newman (CLI tool)
Pre-Request Scripts
Run JavaScript before requests for dynamic data, timestamps, or authentication.
Examples
// Generate timestamp
const timestamp = Date.now();
pm.environment.set("timestamp", timestamp);
// Generate random data
const userId = Math.floor(Math.random() * 1000);
pm.environment.set("random_user_id", userId);
// Hash data for authentication
const crypto = require('crypto-js');
const hashedPassword = crypto.SHA256(pm.environment.get("password")).toString();
pm.environment.set("hashed_password", hashedPassword);
Mock Servers
Postman lets you create mock servers that simulate API responses. Perfect for frontend development when the backend isn't ready.
Setting Up a Mock Server
- Open a collection
- Click "..." menu → "Mock collection"
- Postman generates a mock URL:
https://mockserver-id.mock.pstmn.io - Add examples to each request with different responses
Adding Examples
- Open a request → "Examples" tab
- Add example with:
- Status code (200, 404, etc.)
- Response body
- Headers
GraphQL Support
Creating GraphQL Requests
- Create new request
- Change type from "GET" to "GraphQL"
- Enter query or mutation
- Click "Send"
Example GraphQL Request
query GetUser($id: ID!) {
user(id: $id) {
id
name
email
}
}
Variables:
{
"id": 123
}
Monitors (Paid Plans)
Monitors run your API requests on a schedule and alert you if they fail. Essential for production monitoring.
Setting Up a Monitor
- Open collection → "Monitors" tab
- Click "Create Monitor"
- Configure:
- Name: "User API Health Check"
- Request: Select from collection
- Frequency: Every 5 minutes
- Region: US-East
- Alerts: Email, Slack, PagerDuty
Team Collaboration
Sharing Collections
- Open collection → "Share"
- Generate share link (for anyone)
- Or invite team members (for private access)
- Team can fork collections and make changes
Workspaces
Workspaces let teams collaborate in real-time:
- ✅ Real-time collaboration
- ✅ Shared collections and environments
- ✅ Team comments and discussions
- ✅ Version control for collections
Advanced Features
API Documentation
Generate API documentation from collections:
- Open collection → "..." menu
- Select "View in web"
- Postman generates documentation automatically
- Share documentation link
API Design
Design APIs before implementing:
- Create "New API Definition"
- Design endpoints with OpenAPI/Swagger spec
- Generate mock servers automatically
- Generate code stubs
Import/Export
- Import: Import from OpenAPI/Swagger, RAML, WSDL, or cURL
- Export: Export collections as JSON for version control or sharing
2026 Updates
Postman 11.0
- 🆕 Improved GraphQL editor with autocomplete
- 🆕 Better gRPC support
- 🆕 Enhanced test runner with parallel execution
- 🆕 AI-powered test suggestions
- 🆕 Better workspace performance
- 🆕 New API design templates
Best Practices
1. Organize Collections
- Use folders to group related endpoints
- Use descriptive names (not just "Request 1")
- Document endpoints with descriptions
2. Use Environment Variables
- Never hardcode URLs, tokens, or IDs
- Use variables for environment-specific values
- Keep sensitive data in variables (not in requests)
3. Write Tests
- Test status codes for every endpoint
- Test response structure and required fields
- Test edge cases (missing data, invalid data)
4. Use Pre-Request Scripts
- Generate timestamps and random IDs
- Handle authentication tokens
- Generate test data
Getting Started Checklist
Day 1
- ☐ Install Postman Desktop
- ☐ Create account and sign in
- ☐ Create first GET request
- ☐ Create first POST request with body
Week 1
- ☐ Create a collection for your API
- ☐ Set up environments (dev, staging, prod)
- ☐ Write tests for critical endpoints
- ☐ Explore authentication options
Week 2+
- ☐ Set up mock servers for frontend
- ☐ Configure monitors for production APIs
- ☐ Share collections with team
- ☐ Automate tests with Newman
Conclusion
Postman is an essential tool for API development. Start with basic requests and collections, then explore environments, tests, and mock servers as your needs grow.
For individuals, the free account is sufficient. For teams, consider the Basic or Professional plans for better collaboration and monitoring features.
This article contains affiliate links to Postman. If you click through and sign up for a paid plan, I may earn a commission at no additional cost to you. I use Postman daily for API testing and recommend it to all API developers.