About Blog Contact Links Vault
Latest
Home / API, Integration, & Backend Testing / API Testing with Postman: Manual First, Then Automate What Sticks
API, Integration, & Backend Testing
7 min read · January 15, 2025 · Updated May 30, 2026 · 738 views

API Testing with Postman: Manual First, Then Automate What Sticks

Manual Postman testing, real assertions beyond status codes, Newman for CI integration, and how AI fits in the API testing workflow without replacing your judgment.

Share:

If you are testing an API for the first time on a new project, Postman is still the fastest way to get oriented. You can fire off a request, see the response, and start building an understanding of how the backend behaves before you write a single line of test code. API testing with Postman works because it removes the friction between having a question about an endpoint and getting an answer. The tooling gets out of the way.

This post covers the manual testing workflow first, because that is the right order. You build the collection manually, you understand what you are asserting and why, and then you automate it with Newman. Skipping the manual phase and going straight to automation means you are automating assumptions instead of verified behavior.

Setting Up Your First Request the Right Way

Open Postman, create a new request, and select the HTTP method that matches what you are testing. GET for reading data, POST for creating, PUT or PATCH for updating, DELETE for removing. Enter the endpoint URL. If the API requires authentication, set it up in the Authorization tab before you do anything else. Testing without auth and getting 401s back is not testing. It is noise.

Set your headers. Most modern APIs expect Content-Type: application/json on requests that send a body. If the API uses API keys, bearer tokens, or session cookies, configure those in the headers or in Postman’s built-in auth helpers. For POST and PUT requests, build your request body in the Body tab using raw JSON. Send the request and read the full response before writing any assertions. Status code, response time, and response body structure tell you whether the endpoint is behaving before you start pinning down what it is supposed to do.

What to Actually Assert

Status codes are the floor, not the ceiling. A 200 response that returns the wrong data is still a failed test. API testing with Postman gets useful when you write assertions in the Tests tab that validate the actual response content, not just whether the server responded.

Postman uses JavaScript in the Tests tab. Here is what a real assertion set looks like for a GET endpoint that returns a user object:

js

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

pm.test("Response has user ID", function () {
    const body = pm.response.json();
    pm.expect(body).to.have.property("id");
});

pm.test("Username matches expected value", function () {
    const body = pm.response.json();
    pm.expect(body.username).to.eql("test_user");
});

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

Four assertions. Status, structure, value, and response time. That is the baseline for any endpoint worth testing. Add more based on what the spec says the endpoint should return. If the response includes nested objects, assert into them. If the response includes an array, assert the length or the contents of the first element. The assertions should reflect what a broken endpoint would look like, not just what a working one looks like.

Organizing Tests into Collections

A single request in Postman is useful for exploration. A collection is what makes it useful for ongoing testing. Group your requests by resource or by flow. An auth flow goes in one folder: login, refresh token, logout. A user management flow goes in another: create user, get user, update user, delete user.

Set collection-level variables for your base URL and any shared values like auth tokens. This lets you change the environment (dev, staging, production) without touching individual requests. Postman environments handle this cleanly. Create one environment per deployment target, store the base URL and credentials there, and reference them in requests with double curly syntax: {{base_url}}.

Pre-request scripts at the collection or folder level let you handle auth token refresh automatically before each request runs. If your API uses short-lived tokens, this prevents the constant 401 interruptions that make manual testing slower than it needs to be.

Newman: Running Your Postman Collection from the Command Line

Once your collection is built and your assertions are written, Newman turns it into something you can run headlessly. Install it globally:

bash

npm install -g newman

Export your collection from Postman as a JSON file. Export your environment too if you are using one. Then run:

bash

newman run your-collection.json -e your-environment.json

Newman outputs a summary of every request, every assertion, and every failure. It exits with a non-zero code on failure, which is what CI pipelines need to detect test failures automatically. If you want more readable output, the newman-reporter-htmlextra reporter generates an HTML report with full request and response details for every test run.

bash

npm install -g newman-reporter-htmlextra
newman run your-collection.json -e your-environment.json -r htmlextra

Integrating Newman into CI

Newman in CI is a one-line addition to your pipeline once the collection is exported and checked into your repository. In GitHub Actions:

yaml

- name: Run API tests
  run: newman run collections/your-collection.json -e environments/staging.json

The practical consideration is where the collection file lives. Checking it into source control means the tests version with the code. Pulling it from the Postman API at runtime means you always get the latest version but adds a dependency on Postman’s API. For most teams, checking the JSON into the repo is simpler and more reliable. Update it when the collection changes, commit it, and the pipeline always has a known-good version.

Where AI Fits in the Postman Workflow Now

The gap that AI fills in API testing is not the assertion writing. That is mechanical enough that you should write it yourself because it forces you to think about what the endpoint is supposed to return. The gap is edge case generation and request body construction for complex schemas.

If you are testing an endpoint that accepts a deeply nested JSON body with conditional required fields, feeding the schema to an AI and asking it to generate test cases for invalid inputs is faster than deriving them manually. The output needs review. AI will miss domain-specific constraints that are not in the schema. But the starting list is useful and faster to edit than to generate from scratch.

The AI-assisted manual testing post covers this workflow in more detail, including how to use AI as a thinking partner for coverage gaps rather than as a test generator you trust blindly. The same principles apply to API testing as they do to UI testing. The AI accelerates the surface area. You make the calls on what actually matters.

What This Post Does Not Cover

Happy and sad path testing as a structured methodology has its own post: real-world happy and sad path testing. If you are looking for how to apply that thinking to API flows specifically, including the error states and boundary conditions that matter most, that is the right place to go after this one.

If you are testing APIs from inside a Playwright test rather than from Postman, the manual API testing in QA post covers that workflow. Postman is the right tool for building your understanding of an API. Playwright’s request context is the right tool when you need to combine UI and API assertions in the same test run.

Share this article:
Jaren Cudilla
QA Overlord

Has used Postman as his first move on every new API engagement. The collection becomes the living documentation of what the backend actually does versus what the spec says it should. This post is how he builds that collection and makes it useful beyond his own local machine.

Leave a Comment

What is API Testing with Postman: Manual First, Then Automate What Sticks?

If you are testing an API for the first time on a new project, Postman is still the fastest way to get oriented.