API Testing · Postman Tutorial 2026
Postman Tutorial for Beginners 2026
Quick summary — Postman tutorial for beginners
Postman is the most popular API testing and collaboration tool in the world. This tutorial walks you through the basics so you can test, document, and automate APIs confidently.
In this tutorial you will learn:
- Sending requests — GET, POST, PUT, DELETE.
- Collections — organising and sharing requests.
- Environments — switching between dev, staging, prod.
- Tests and scripts — automating checks.
- CI/CD integration — running tests with Newman.
SECTION 01Installing Postman
Postman is available as a desktop app for Windows, macOS, and Linux, plus a web version. Download it from the official website and sign up for a free account.
| Platform | How to install | Notes |
|---|---|---|
| Windows | Download .exe from postman.com | Desktop recommended |
| macOS | Download .dmg or use Homebrew | Native Apple Silicon build |
| Linux | Snap, AppImage, or .deb | Multiple package options |
| Web | Use web.postman.co | No install needed |
SECTION 02Sending your first request
Sending a request in Postman is easy. You'll use the same workflow for every API call:
| Step | Action | Example |
|---|---|---|
| 1. Method | Choose GET, POST, etc. | GET |
| 2. URL | Enter the endpoint | https://api.example.com/users |
| 3. Headers | Add auth or content-type | Authorization: Bearer ... |
| 4. Body | Send JSON for POST/PUT | {"name": "John"} |
| 5. Send | Click Send and inspect | Check status and body |
# GET request in Postman
Method: GET
URL: https://jsonplaceholder.typicode.com/users
# Headers
Accept: application/json
# Click "Send"
# Response (200 OK):
[
{ "id": 1, "name": "Leanne Graham", ... },
{ "id": 2, "name": "Ervin Howell", ... },
...
]
# POST request in Postman
Method: POST
URL: https://jsonplaceholder.typicode.com/posts
# Headers
Content-Type: application/json
# Body (raw → JSON)
{
"title": "My first post",
"body": "Hello Postman!",
"userId": 1
}
# Response (201 Created):
{
"id": 101,
"title": "My first post",
"body": "Hello Postman!",
"userId": 1
}
SECTION 03Collections & environments
Collections group related requests; environments store variables like base URLs and API keys — so you can switch between dev and production easily.
| Concept | Purpose | Example |
|---|---|---|
| Collection | Group related requests | "User API" collection |
| Folder | Sub-group inside a collection | "Auth" folder |
| Environment | Different config per stage | Dev, Staging, Prod |
| Variable | Reusable values | {{baseUrl}} |
| Pre-request script | Run before request | Generate auth token |
# Example environment: "Dev"
baseUrl = https://dev.api.example.com
apiKey = dev-abc123
# Example environment: "Prod"
baseUrl = https://api.example.com
apiKey = prod-xyz789
# Switch between them from the dropdown
# in the top-right of Postman.
# Request using variables
Method: GET
URL: {{baseUrl}}/users
# Headers
Authorization: Bearer {{apiKey}}
# Postman resolves the variables
# based on the active environment.
SECTION 04Tests & scripts
Postman lets you write tests in JavaScript that run after each request. Tests automatically validate responses and can chain requests.
| Test type | Example | What it checks |
|---|---|---|
| Status code | pm.response.to.have.status(200) |
Response status |
| Response time | pm.expect(pm.response.responseTime).to.be.below(500) |
Performance |
| Body content | pm.expect(jsonData.name).to.eql("John") |
Field values |
| Schema | pm.response.to.have.jsonSchema(schema) |
Structure |
| Headers | pm.response.to.have.header("Content-Type") |
Response headers |
// Tests tab in Postman
pm.test('Status is 200', () => {
pm.response.to.have.status(200);
});
pm.test('Response time is under 500ms', () => {
pm.expect(pm.response.responseTime).to.be.below(500);
});
pm.test('Body contains name', () => {
const data = pm.response.json();
pm.expect(data.name).to.eql('John');
});
pm.test('Content-Type is JSON', () => {
pm.response.to.have.header('Content-Type');
});
// Save token from login response,
// then use it in later requests.
// 1. Login test
pm.test('Login successful', () => {
pm.response.to.have.status(200);
const data = pm.response.json();
pm.environment.set('token', data.access_token);
});
// 2. Later request headers
// Authorization: Bearer {{token}}
// This pattern is used constantly
// in real API workflows.
SECTION 05CI/CD with Newman
Newman is Postman's command-line runner. It lets you run collections in CI/CD pipelines, on servers, or from your terminal.
# Install Newman
npm install -g newman
# Run a collection
newman run my-collection.json \
-e dev-environment.json \
--reporters cli,json
# Run with HTML report
newman run my-collection.json \
--reporters html \
--reporter-html-export report.html
# .github/workflows/api-tests.yml
name: API Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g newman
- run: |
newman run postman/collection.json \
-e postman/dev.json \
--reporters cli
SECTION 06Interview Q&A — Postman
Q1What is Postman?
Postman is an API development and testing tool. It lets you send HTTP requests, inspect responses, write tests, and organise requests into collections.
Q2What is a Postman collection?
A collection is a group of related requests, with optional tests, scripts, and variables — you can share and run collections easily.
Q3What is an environment in Postman?
An environment is a set of variables (like URLs and API keys) that let you switch between dev, staging, and production setups.
Q4What is Newman?
Newman is Postman's command-line collection runner. It's used in CI/CD pipelines to run API tests automatically.
Q5How do you handle authentication in Postman?
Postman supports many auth types: Bearer tokens, Basic auth, API keys, OAuth 2.0, and more — configure them in the Auth tab.
SECTION 07Test yourself — Postman
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
Is Postman free?
Postman has a free tier with most essential features. Paid plans add team collaboration and advanced options.
Do I need to code to use Postman?
No — you can send requests and inspect responses without code. Writing tests requires basic JavaScript.
Can Postman test REST and GraphQL APIs?
Yes — Postman supports REST, GraphQL, gRPC, and WebSocket APIs.
How do I share a collection with my team?
Use Postman cloud workspaces to share collections, or export the collection as JSON and share the file.
Is Postman useful for QA testers?
Absolutely — Postman is a core tool for API testing. QA testers use it to validate endpoints, write assertions, and run tests in CI/CD.
SECTION 09Related reads
Classroom & online · Noida
Master API testing with Postman
Our API Testing with Postman Course is designed for beginners — learn requests, collections, tests, and CI/CD automation.
₹15,500 · full programme- Beginner-friendly curriculum
- Hands-on projects
- Expert mentorship
- Weekday & weekend batches