How to Validate JSON API Responses in Postman (Complete Guide)
Validate REST responses with pm.expect, JSON schema, JSONPath, and JMESPath. A step-by-step Postman guide with copy-paste snippets and a free JSON tester.

2026-07-17 · By Avinash K
Every mature API test suite validates three things about a JSON response: shape (schema), values (assertions), and contracts (types). This guide shows how to do all three in Postman without leaving the app.
1. Value assertions with pm.expect
const body = pm.response.json();
pm.test("status is 200", () => pm.response.to.have.status(200));
pm.test("first product name", () => {
pm.expect(body.data[0].name).to.eql("Widget");
});
pm.test("all prices are positive", () => {
body.data.forEach(p => pm.expect(p.price).to.be.above(0));
});2. Schema validation with ajv
const schema = {
type: "object",
required: ["id", "name", "price"],
properties: {
id: { type: "integer" },
name: { type: "string", minLength: 1 },
price: { type: "number", minimum: 0 }
}
};
pm.test("body matches schema", () => {
pm.response.to.have.jsonSchema(schema);
});3. Filter with JSONPath before asserting
const paid = body.orders.filter(o => o.status === "paid");
pm.test("we have exactly 3 paid orders", () => {
pm.expect(paid.length).to.eql(3);
});Prototype the JSONPath in the free JSON / JSONPath / JMESPath Tester, copy the working expression into Postman.
4. Data-driven runs
Use Postman's Runner with a CSV file to loop the same assertions across many payloads. Combine with the schema step above to catch contract regressions across environments.
5. Move complex assertions into code
Beyond ~10 assertions per request, prefer a real testing framework. Convert the collection to Playwright, Rest Assured, or k6 with the free Postman → Code Converter.