Postman Response Examples

An example is a saved copy of a request together with a sample response. Examples show what an API returns without calling the live server. They power documentation and mock servers, and they teach teammates the expected output for success and failure cases.

Why Examples Help

A recipe book lists the ingredients and also shows a photo of the finished dish. The photo tells the cook what success looks like. An example plays the photo's role for an API call: it displays the exact shape of a good response, a missing item, or an error.

  REQUEST: GET /users/1
  │
  ├── Example 1: "Success"       200  { "id": 1, "name": "Asha" }
  ├── Example 2: "User not found" 404  { "error": "No such user" }
  └── Example 3: "Unauthorized"   401  { "error": "Token missing" }

Save a Response as an Example

  1. Send a request and wait for the response.
  2. Click Save Response above the response body.
  3. Choose Save as example.
  4. Rename the example, for instance 200 Success.

The example appears under the request in the sidebar. Click the small arrow beside the request to expand the list.

Create an Example by Hand

Some responses are hard to trigger, such as a 500 server error. Build them manually.

  1. Open the three-dot menu on a request and select Add example.
  2. Type an example name.
  3. Set the status code and status text.
  4. Paste or type the response body.
  5. Add response headers, such as Content-Type: application/json.
  6. Click Save.

What Each Example Contains

PartPurpose
Request sectionThe URL, method, headers, and body that produced the response
StatusCode and text, such as 404 Not Found
HeadersResponse headers like Content-Type
BodySample data in JSON, XML, or text form

Examples Feed Other Features

            ┌──────────────────┐
            │     EXAMPLES     │
            └────────┬─────────┘
        ┌────────────┼────────────┐
        ▼            ▼            ▼
  Mock Servers   Documentation   Team Learning
  (return the    (display the    (show expected
   saved data)    sample output)  behavior)

Mock Servers

A mock server matches incoming requests to saved examples and returns the example response. Frontend developers build screens against the mock before the real backend exists.

API Documentation

Published documentation displays examples beside each endpoint, so readers see real response shapes at a glance.

Match Requests to Examples

Mock servers compare the incoming URL, method, and sometimes headers with each example. Add the header x-mock-response-name with the example name to force a specific example. Add x-mock-response-code with a status number to request an example with that code.

GET {{mockUrl}}/users/1
x-mock-response-name: User not found

Use Variables in Examples

Dynamic placeholders make examples feel alive. Use variables like {{$randomFullName}} or {{$guid}} in the body so every mock call returns fresh values.

{
  "id": "{{$guid}}",
  "name": "{{$randomFullName}}",
  "email": "{{$randomEmail}}"
}

Examples to Cover for Each Endpoint

  • A normal success response.
  • An empty list result.
  • A validation error with a 400 status.
  • A missing or expired login with a 401 status.
  • A resource that does not exist with a 404 status.
  • A server failure with a 500 status.

Keep Examples Trustworthy

  • Remove real personal data from saved responses before sharing.
  • Refresh examples after the API changes.
  • Name examples by outcome, such as 201 Created, so they read clearly.
  • Delete outdated examples to avoid confusing mock results.

Key Points

  • An example stores a request and its sample response.
  • Save real responses or write error cases by hand.
  • Mock servers and documentation both read examples.
  • Mock headers select a specific example on demand.
  • Clean and current examples keep teams aligned.