Back to Insights
Featured Article

API Testing with Postman for Beginners: Step-by-Step Guide 2026

By M.Arif
November 28, 2026
Share:
API Testing with Postman for Beginners: Step-by-Step Guide 2026
Expert Insight

Introduction

Every time you log in to an app, check a delivery status or pay online, an API is working behind the screen. If that API fails, the whole experience fails with it. That is why testers are expected to check APIs directly, long before a user ever sees a button.

Postman is one of the most widely used tools for this job. It lets you send requests, read responses and write automated checks without building a full test framework first. You can start with no coding background and add scripting gradually.

This guide walks you through API testing with Postman from zero. You will learn the core concepts, send your first requests to a free practice API, write assertions, use variables and environments, handle authentication, run collections from the command line, and avoid common beginner mistakes.

Quick Answer: What Is API Testing with Postman?

API testing with Postman means sending HTTP requests to an API endpoint and checking that the response has the right status code, data, headers and speed. You build requests in Postman's interface, add JavaScript assertions in the Tests tab, and group them into collections that can be re-run manually or automatically.

Key points

  • An API test checks the response, not how a page looks.
  • Start with GET and POST requests, then add assertions.
  • Variables and environments let you reuse one collection across servers.
  • Collections can run from the command line with Newman for automation.
  • No programming experience is needed for manual testing; basic JavaScript helps for automation.

What Is API Testing?

An API (Application Programming Interface) lets two software systems talk to each other. A mobile app asks a server for data; the server replies, usually in JSON format. API testing checks that this conversation works correctly.

Most web APIs follow REST principles. REST was described by Roy Fielding in his doctoral dissertation, and it relies on standard HTTP methods and stateless communication: each request carries everything the server needs to process it. The HTTP behavior itself is defined in RFC 9110 on HTTP Semantics.

API Testing vs UI Testing

AspectAPI testingUI testing
What is checkedRequests, responses, logic, dataScreens, buttons, user flows
When it can startAs soon as the endpoint existsAfter the interface is built
Typical speedFastUsually slower
FragilityLess affected by design changesOften affected by layout changes

Both matter. API tests catch backend problems early; UI tests confirm that the finished experience works.

Why API Testing Matters

  • Earlier feedback. You can test a backend before the front end exists.
  • Stable checks. Responses change less often than screen layouts, so tests need less rework.
  • Security awareness. Broken authorization is a recurring API risk. The OWASP API Security project lists the most common categories and is a good reading list once you are comfortable with the basics.
  • Microservices. Modern systems are split into many small services that talk through APIs, so each connection needs checking.

What Is Postman and What Can It Do?

Postman is an API platform with a desktop app and a web version. For testing, you will mainly use these features:

  • Requests: build and send HTTP calls.
  • Collections: folders of saved requests that can be run in order.
  • Environments and variables: swap values such as base URLs and tokens.
  • Scripts: JavaScript that runs before a request (pre-request) or after a response (tests).
  • Collection Runner: runs many requests in one go.
  • Mock servers: simulate an endpoint before the backend is ready.
  • AI assistance: Postman has been adding AI features to help write tests and scripts. Features and names change, so check the Postman Learning Center for the current options.

Is Postman Free?

Postman offers a free plan and paid plans. Limits, features and prices change from time to time, so check the official Postman pricing page before deciding. As a beginner, start on the free plan and upgrade only if a team feature becomes necessary.

Key Skills and Tools You Need Before You Start

You do not need to be a developer. You do need to understand:

1. What a client and a server are.

2. The main HTTP methods and status codes.

3. How to read JSON.

4. Basic test thinking: what should happen, and what should not.

Basic JavaScript becomes useful when you move from manual to automated checks. Postman's script editor uses JavaScript with the Chai assertion style.

If you want structured guidance and feedback while learning, IDT Pakistan's mentors page shows who teaches on its programmes.

Understanding the Basics: Requests and Responses

The Parts of an HTTP Request

  • Method: the action (GET, POST and so on).
  • URL (endpoint): where the request goes.
  • Headers: extra information, such as content type or authorization.
  • Query parameters: filters added after a ? in the URL.
  • Body: the data you send, commonly JSON, for POST, PUT and PATCH.

HTTP Methods at a Glance

Method Typical purpose Has a body?
GET Read data No
POSTCreate a new record Yes
PUTReplace an existing recordYes
PATCHUpdate part of a recordYes
DELETERemove a record Usually no

These describe typical conventions. A specific API may behave differently, which is exactly why you test it.

Status Codes Every Tester Should Know

CodeMeaningWhat to check
200OkRequest succeeded; verify the data
201CreatedA new resource was created
400Bad Request Invalid input was rejected
401unauthorizedMissing or invalid credentials
403Forbidden Authenticated but not allowed
404Not Found Resource does not exist
500Internal Server ErrorThe server failed; report it

For the full list, see the MDN HTTP status code reference.

Step-by-Step: Setting Up Postman

1. Download Postman from the official website and install it on Windows, macOS or Linux, or use the web version.

2. Create a free account and sign in.

3. Open or create a Workspace, which is your working area.

4. Click New and choose Collection. Name it something clear, such as "Practice API Tests".

Step-by-Step: Send Your First GET Request

We will use JSONPlaceholder, a free fake API built for practice.

1. Inside your collection, add a new request and name it "Get single post".

2. Set the method to GET.

3. Enter this URL: https://jsonplaceholder.typicode.com/posts/1

4. Click Send.

You should see a status of 200 OK and a JSON body with fields such as userId, id, title and body. Look at the response time and size shown above the body too.

Adding Query Parameters

Try https://jsonplaceholder.typicode.com/posts?userId=1. Postman lists the parameters in the Params tab, so you can switch them on and off without retyping the URL. The response is now an array of posts for that user.

Step-by-Step: Testing a POST Request with a JSON Body

1. Create a new request named "Create post" and set the method to POST.

2. Use the URL https://jsonplaceholder.typicode.com/posts.

3. Open the Body tab, choose raw, and select JSON.

4. Paste this body:json

{ "title": "Learning Postman", "body": "My first POST request", "userId": 1 }

5. Click Send.

You should receive 201 Created and a response containing the data you sent plus a new id. JSONPlaceholder simulates creation and does not store the record, so a later GET for that id will not return it. Knowing how your practice API behaves prevents confusion.

Writing Your First Automated Tests

Open the Scripts (or Tests) tab of the "Get single post" request and add:

JavaScript

pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});

pm.test("Response time is under 500 ms", function () {
pm.expect(pm.response.responseTime).to.be.below(500);
});

pm.test("Body has expected fields", function () {
const json = pm.response.json();
pm.expect(json).to.have.property("id", 1);
pm.expect(json).to.have.property("title");
pm.expect(json.userId).to.be.a("number");
});

Click Send again and open the Test Results panel. Each pm.test shows as pass or fail. The 500 ms limit is only an example; set thresholds based on your project's actual requirements.

What Each Part Does

  • pm.test() names and wraps a check.
  • pm.response gives access to the status, headers, time and body.
  • pm.expect() writes the assertion in Chai style.

Pre-request Scripts vs Post-response Scripts

A pre-request script runs before the request is sent. Use it to generate a timestamp, set a variable or prepare data. A post-response script (the Tests tab) runs after the response arrives. Use it for assertions and for saving values such as tokens.

Variables and Environments

Hard-coding URLs and tokens makes collections difficult to maintain. Variables solve this.

Variable Scopes

ScopeBest used for
GlobalValues shared across the whole workspace (use sparingly)
CollectionValues shared by one collection
EnvironmentValues that change per server, such as dev or staging
LocalTemporary values within one request run

Postman resolves a variable from the narrowest scope outward, so a local value overrides an environment value of the same name.

Create an Environment

1. Click Environments and create a new one called "Practice".

2. Add a variable base URL with the value https://jsonplaceholder.typicode.com.

3. Select the environment in the top-right corner.

4. Change your request URL to {{base URL}}/posts/1.

Now you can point the same collection at a different server by switching environments.

Chaining Requests

Chaining means using data from one response in the next request. A typical example is saving a login token:

JavaScript

const json = pm.response.json(); pm.environment.set("token", json.token);

Your next request then reads {{token}} in its Authorization header. Your own API's response field may have a different name, so check the real response first.

Authentication in Postman

Most real APIs need authentication. In the Authorization tab you can choose:

  • API Key: a key sent in a header or query string.
  • Bearer Token: a token (often a JWT) sent in the Authorization header.
  • Basic Auth: a username and password.
  • OAuth 2.0: a token-based flow with several grant types.

Bearer token definition: a credential included in the request header, usually written as Authorization: Bearer <token>, that proves the caller has been authenticated.

You can set authorization once at the collection level and let requests inherit it. Never paste real secrets into a collection you plan to share or make public.

Debugging 401 and 403 Errors

  • 401: check that the token is present, correctly formatted and not expired. Confirm the variable resolved and is not showing as an empty value.
  • 403: the credentials were accepted but the account lacks permission. Check the user's role and the endpoint's access rules.

Running Tests with the Collection Runner

Right-click your collection and choose Run.

Select the requests and the environment.

Set the number of iterations.

Click Run and review passes and failures.

Data-Driven Testing

You can feed a CSV or JSON file into the runner so the same request runs with different inputs. In your request, use variables such as {{username}} and map them to column headings in the file. This is useful for testing many valid and invalid inputs without duplicating requests.

Mock Servers and Importing Specifications

When the backend is not ready, a Postman mock server returns example responses you define, so front-end work and test design can continue. You can also import an OpenAPI (Swagger) file or a cURL command to generate requests automatically. The OpenAPI Initiative maintains the specification.

Automating with Newman and CI/CD

Newman is Postman's command-line collection runner, so your tests can run on a build server instead of your laptop. Basic usage:

bash

npm install -g newman newman run my-collection.json -e my-environment.json

Export your collection and environment from Postman first. See the Newman repository for options and reporters. Postman also provides its own command-line tool, so check the official documentation to decide which fits your pipeline.

Newman can be called from tools such as GitHub Actions or Jenkins, which means each code change can trigger your API checks automatically.

Manual vs Automated API Testing in Postman

Manual Automated
HowSend requests and read results yourselfScripts assert results automatically
Best forExploring a new endpoint, one-off checksRegression and repeated checks
Skill neededHTTP basicsHTTP basics plus basic JavaScript

Most testers begin manually to understand the API, then automate the checks they repeat often.

What to Test: A Beginner Checklist

  • Correct status code for valid requests.
  • Response body contains the expected fields and data types.
  • Invalid input returns a sensible error (400 or similar), not a crash.
  • Missing or wrong credentials return 401 or 403.
  • Non-existent resources return 404.
  • Response time stays within your agreed limit.
  • Required headers, such as content type, are present.
  • Data created with POST can be read, updated and deleted correctly (a CRUD workflow).

Postman vs Other API Tools

ToolNotes
Postman Full-featured platform with collaboration, scripting, mocks and monitors
Bruno Open-source client that stores collections as files, which suits Git workflows
InsomniaAPI client with a clean interface, developed by Kong
HoppscotchOpen-source, web-based client that is quick for simple requests
REST AssuredA Java library for code-based API tests, not a graphical client

The best choice depends on your team, budget and skills. Check each tool's official site for current features and licensing, as these change often.

Common Beginner Mistakes

1. Testing only the success path and ignoring error cases.

2. Hard-coding URLs and tokens instead of using variables.

3. Forgetting to select the correct environment.

4. Checking only the status code and not the response body.

5. Sharing collections that contain real credentials.

6. Writing one huge request chain that is hard to debug.

7. Assuming a practice API behaves like a real backend.

Best Practices for Organizing Collections

  • Group requests into folders by feature, for example "Auth", "Posts", "Users".
  • Use clear names that describe the check, such as "Create post returns 201".
  • Keep shared values in collection or environment variables.
  • Add a short description to each folder so teammates understand its purpose.
  • Review and remove outdated requests regularly.

How to Keep Learning

  • Work through the official Postman Learning Center.
  • Practise on free public APIs and try to break them with bad input.
  • Build a small portfolio collection with documented tests.
  • For testing theory and certification pathways, see the ISTQB website.
  • Follow a structured plan. The 30-day roadmap after a digital course shows one way to turn learning into steady practice.
  • If APIs are new to you, it helps to understand how web applications are built. The web development roadmap for beginners explains the front-end and back-end basics that APIs connect.

Frequently Asked Questions

Do I need coding knowledge to use Postman? No. You can send requests and inspect responses without code. Basic JavaScript is needed only when you write automated assertions and scripts.

How do I send my first GET request in Postman? Create a request, choose GET, enter the endpoint URL, and click Send. Check the status code and response body.

What do 200, 400, 404 and 500 mean? 200 means success, 400 means the request was invalid, 404 means the resource was not found, and 500 means the server failed.

What is a Postman collection? A collection is a saved group of requests, with their tests and variables, that you can organize, share and run together.

What is the difference between pre-request and post-response scripts? Pre-request scripts run before sending, to prepare data. Post-response scripts run after the reply, to assert results or save values.

How do I pass a token from one request to another? Save it with pm.environment.set("token", value) in the login request's test script, then reference {{token}} in later requests.

Can I automate API tests using only Postman? Yes, using scripts, the Collection Runner and monitors. To run them in a pipeline, use Newman or Postman's command-line tool.

Is Postman free for beginners? Postman has a free plan, but limits and features change. Check the official pricing page for current details.

What is the easiest way to check response time? Read the time shown beside the response, or assert it with pm.response.responseTime in a test.

How do I test an API before the backend is ready? Use a Postman mock server to return example responses based on your design.

Conclusion

API testing with Postman is a practical first step into software quality assurance. Start by understanding requests, responses and status codes. Send GET and POST calls to a practice API. Add assertions, then variables and environments, and finally run your collections automatically with Newman.

Learn in small steps, test both good and bad inputs, and keep your collections tidy. Tools and plans will keep changing, but the habit of checking what an API actually returns stays useful.

If you want guided practice with test cases and real QA workflows, explore IDT Pakistan's Software Quality Assurance course and check the official course page for the current syllabus, duration and batch details.

Share this article
Chat with us