Checking APIs by hand with curl or a browser works for a handful of calls. It stops working once you have dozens of API endpoints, more than one environment, and regular releases, because nobody can repeat the same checks the same way every time.
To use Postman for API testing, create an API request with the right method and URL, send it, then add test scripts that check the status code and body. Save the requests in a collection and run it with the Collection Runner or the Postman CLI. This guide covers installing Postman, writing assertions, using variables, automating runs, and testing GraphQL and API security basics.
What Is API Testing?
API testing sends requests to Application Programming Interfaces and checks what comes back, with no user interface in the way. In software, that means checking the status code, the API response body, the headers, and the response time.
API tests usually sit alongside other test types used in Quality Assurance. Each one checks something different:
- Unit testing: Checks one function on its own.
- Contract testing: Checks that the API provider and its consumers agree on the data shape.
- Functional testing: Checks that an endpoint does what it should.
- End-to-end testing: Checks a full user journey across software systems.
- Performance testing: Checks speed and stability under load.
API tests run in seconds and do not need a front end, so API development teams can run them early. Your API documentation is also a good source of test scenarios, because every documented behaviour is something you can check.
What Is Postman?
Postman is an API platform built around an API client for sending requests and inspecting responses. It is one of the most widely used API testing tools. It works well for functional testing and regression checks. It is not built for deep security testing or large load tests. If you later move to a Postman alternative, the steps in this guide still apply, because the ideas are the same in any API client. If you want to compare Postman with code-based options, our guide to the API testing framework choices and practices is a good next read.
What Postman Can Test
Postman works with any REST API, plus SOAP and GraphQL. REST architecture uses URLs to name resources and HTTP methods such as GET and POST to work with them. Inside Postman, you can build:
- Functional checks on single API endpoints.
- Regression suites from saved request collections.
- Data-driven runs that read from CSV or JSON files.
- API workflows that chain one request into the next.
- A mock server, so you can test against endpoints that do not exist yet.
Load testing and large-scale performance testing need other tools. Check what your Postman plan includes before you rely on it for either.
How to Download and Install Postman
Postman runs on Windows, macOS, and Linux, and there is a web version for locked-down laptops. The Postman download is a standard installer. To download Postman for Windows, follow these steps:
- Open the Postman download page and pick the build for your system, such as Windows 64-bit.
- Run the installer. It needs no further prompts.
- Launch the app and sign in, or skip sign-in if the current flow allows it.
The steps are similar on macOS and Linux. Only the build you pick and the installer format differ. Onboarding changes from time to time, so check the sign-in step against what you see on screen.
Set Up Your First Workspace
A workspace is the space where your API testing work lives. It holds your collections, environments, and request history, and you can share it with teammates so everyone tests against the same setup. Create one and a first collection with these steps:
- Select Workspaces in the top bar, then choose Create Workspace.
- Name it after the API you are testing, such as 'Posts API', and pick personal or team visibility.
- Inside the workspace, choose New Collection and give it a clear name such as 'Posts API smoke tests'.
A collection is a folder of saved requests that you can run together later. Every request you create in the next steps will be saved in this collection, so the same checks can be rerun on demand.
How to Test an API with Postman, Step by Step
Testing an API in Postman takes four actions: Send a request, validate the response, parameterise with variables, and run the collection. Every example uses the free JSONPlaceholder API, so you do not need any credentials.
Send Your First API Request
Start with a simple GET to see a healthy API response, then try a POST that creates data. For the GET:
- Choose GET and enter https://jsonplaceholder.typicode.com/posts/1.
- Press Send.
- Read the status (200), the JSON body, and the response time.
Now try POST on /posts with a raw JSON body such as {"title": "test", "body": "hello", "userId": 1}. You should get 201 Created. If you get an empty body or a 4xx status, check the URL, the method, and the Content-Type header, in that order.
Write Test Scripts to Validate Responses
Test scripts live in the Post-response tab, which older tutorials call Tests. They run in the Postman Sandbox, a JavaScript environment built into the app. Response validation starts with three assertions:
pm.test("Status is 200", () => pm.response.to.have.status(200));
pm.test("Post has the expected id", () => {
pm.expect(pm.response.json().id).to.eql(1);
});
pm.test("Content-Type is JSON", () => {
pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
});To see a failure, change the expected ID to 2 and send again. The result appears in Test Results, and the Postman Console shows the raw request and response behind it.
Good Data Validation goes beyond the status code. Check that fields have the right type and that required fields are present. A response that returns id as a string can break a client even when the status is 200.
Use Environments and Variables
Hard-coded URLs break as soon as you test a second environment such as staging. Postman gives you two kinds of variables for this:
- Environment variables: Values that change per target, such as baseUrl or a token.
- Collection variables: Values shared by every request in one collection.
Write your requests as {{baseUrl}}/posts/1, duplicate the environment for staging, and switch between them from the dropdown. The same collection now runs against both. To pass a value from one request to the next, save it in a post-response script:
pm.environment.set("postId", pm.response.json().id);Keep tokens and passwords in secret-type variables, and never in a collection you share. Anyone who opens an exported collection can read plain values.
Run Collections with the Collection Runner
Choose Run on a collection, and the Collection Runner executes every request in order. It reports pass or fail for each assertion. Attach a CSV or JSON data file, and each request runs once per row, which makes data-driven testing simple.
For test automation outside the app, you need a command-line runner. The Postman CLI is the current option and signs in with an API key. Newman is the older open-source runner. It works with compatible exported collections but not with the newer v3 collection format, so read our guide to Postman and Newman for command-line API testing before choosing.
The table shows where each runner fits. Pick the one that matches how you work:
- Debugging by hand: Use the Collection Runner.
- Building a new CI job from collections kept in Postman: Use the Postman CLI.
- Newman already running in a pipeline: Keep it until it needs replacing.
The Postman CLI fits into CI/CD pipelines as one automation script step. A failing assertion then fails the build. If you also need to create or update collections from code, the Postman API can do that:
postman login --with-api-key $POSTMAN_API_KEY
postman collection run <collection-id>
Testing GraphQL and API Security in Postman
Postman supports GraphQL queries and basic API security checks. It does not replace a penetration test.
Test GraphQL Queries in Postman
GraphQL is a query language for APIs. Instead of calling many fixed endpoints, the client sends a query to one endpoint and asks for exactly the fields it needs. This changes one habit when you test: A GraphQL response can return status 200 and still contain an errors array. To test a query:
- Create a new request and choose GraphQL.
- Point it at the single GraphQL endpoint.
- Write a query, add variables, and send.
- Assert on both data and errors:
const body = pm.response.json();
pm.test("No GraphQL errors", () => pm.expect(body.errors).to.be.undefined);
pm.test("Data returned", () => pm.expect(body.data).to.be.an("object"));
Always assert on both fields, because checking only one can hide a failure. The GraphQL documentation explains how errors are shaped.
Run Basic API Security Checks
Start with authentication. Send each of these calls and expect the API to reject all three:
- A call with no token.
- A call with an expired token.
- A call with a token for the wrong role.
Then check object-level authorisation. Log in as user A and request a resource that belongs to user B. The API should refuse. The OWASP API Security Top 10 lists this as the first risk, and it is easy to automate in a collection.
Postman is a good starting point, but it is not a security solution on its own. Rate limiting, injection, and business-logic checks need dedicated API security solutions, such as an API security platform or a security service from a penetration testing company that offers penetration testing services.
How Frugal Testing Helps You Scale API Testing Beyond Postman
Postman collections stop being enough when only one person can run them, or when every release needs an automatic gate. At that point, you need a maintained suite wired into your CI/CD pipelines. That is what our API testing service builds, using tools such as Rest Assured and Jenkins, which a team already relies on.
This work sits within our QA testing services, automation testing services, and software QA services. Our guide to test automation in CI/CD explains the pipeline side in more detail. If you prefer to hand the work over, we also offer QA outsourcing services.
What Our API Testing Engagement Looks Like
An engagement follows the same four steps, whatever the size of the suite. This is how the work runs:
- We review your current collections and what they cover.
- We agree which failures should block a release, such as failed logins or wrong data.
- We build and automate the suite, so it runs on every commit in your pipeline.
- We hand it over and show your team how to maintain it.
At the end, you own the collections, scripts, pipeline config, and run reports. Nothing is locked inside our tools.

Conclusion: From First Request to a Release Gate
Using Postman for API testing comes down to three skills: Sending and reading requests, writing assertions that can fail, and automating the run so nobody has to remember it. The first takes an afternoon. The third takes more discipline, and it is where most teams stall.
Start with one collection for one API and run it by hand. Once the assertions are stable, move the same collection into your pipeline so every release gets the same checks. Add requests gradually, and keep each assertion small enough to explain a failure.
People Also Ask (FAQs)
Q1. How often should I run API tests?
Ans: Run quick smoke checks on every commit or pull request, and the full regression collection nightly or before each release. Frequent runs catch breaking changes early.
Q2. What is GraphQL?
Ans: GraphQL is a query language for APIs that lets clients request exactly the fields they need from a single endpoint, instead of calling several fixed endpoints and discarding unused data.
Q3. SOAP vs REST API: What is a REST API and how does it differ?
Ans: A REST API exposes resources through URLs and HTTP methods, usually returning JSON. SOAP is a stricter XML protocol with formal contracts, so REST is lighter and more flexible.
Q4. What is the best Postman alternative for API testing?
Ans: Bruno and Insomnia are popular lighter clients, while REST Assured and Karate suit code-first teams. The right choice depends on your language, budget, and collaboration needs.
Q5. How do I choose from the best API security platforms?
Ans: Shortlist platforms that offer API discovery, runtime threat detection, and testing against the OWASP API Top 10. Then run a trial on real traffic before committing.







