{
  "app": "apiworkbench",
  "format": 1,
  "exportedAt": "2026-11-09T00:00:00.000",
  "collections": [
    {
      "id": "33999136-5d73-505a-ae00-5e6dfc1a2b94",
      "name": "Recipes (sample)",
      "requests": [
        {
          "id": "bb836696-46f8-5468-892d-37330a03c873",
          "name": "First page",
          "method": "GET",
          "url": "{{baseUrl}}/articles",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "page",
              "x": "1",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "items[0].id",
              "x": "1",
              "e": true
            }
          ],
          "folder": "Paging",
          "description": "Reads page 1 and saves the link to the next page.",
          "captures": {
            "nextPage": "body.next"
          }
        },
        {
          "id": "a5a35753-43f2-59bd-aa14-7e1dc8407ceb",
          "name": "Follow the next link",
          "method": "GET",
          "url": "{{baseUrl}}{{nextPage}}",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "page",
              "x": "2",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "items[0].id",
              "x": "3",
              "e": true
            }
          ],
          "folder": "Paging",
          "description": "Uses the link the first page gave, instead of building the URL by hand."
        },
        {
          "id": "a8153f18-8585-52d9-a9f2-0d47f13585f3",
          "name": "Past the last page",
          "method": "GET",
          "url": "{{baseUrl}}/articles",
          "params": [
            {
              "k": "page",
              "v": "3",
              "e": true
            }
          ],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "next",
              "x": "null",
              "e": true
            },
            {
              "kind": "bodyContains",
              "t": "",
              "x": "\"items\": []",
              "e": true
            }
          ],
          "folder": "Paging",
          "description": "The last page has no items and next is null."
        },
        {
          "id": "f860beb3-24a3-5d79-bf4e-b1d3b69f961a",
          "name": "Echo my data back",
          "method": "POST",
          "url": "{{baseUrl}}/echo",
          "params": [],
          "headers": [],
          "bodyType": "json",
          "body": "{\n  \"name\": \"Ada\",\n  \"city\": \"Chennai\"\n}",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "hello",
              "x": "Ada",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "city",
              "x": "Chennai",
              "e": true
            },
            {
              "kind": "bodyContains",
              "t": "",
              "x": "requestId",
              "e": true
            }
          ],
          "folder": "Echo",
          "description": "The mock fills {{body.name}} and {{body.city}} from what you send."
        },
        {
          "id": "936b7d38-d709-551a-91b4-332c135dacb3",
          "name": "First fetch",
          "method": "GET",
          "url": "{{baseUrl}}/profile",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "headerContains",
              "t": "ETag",
              "x": "v7",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "plan",
              "x": "pro",
              "e": true
            }
          ],
          "folder": "ETag",
          "description": "Saves the ETag the server sends with the profile.",
          "captures": {
            "etag": "header.ETag"
          }
        },
        {
          "id": "966c37eb-9166-5b22-bd3f-6ee42ba6ae96",
          "name": "Fetch again with If-None-Match",
          "method": "GET",
          "url": "{{baseUrl}}/profile",
          "params": [],
          "headers": [
            {
              "k": "If-None-Match",
              "v": "{{etag}}",
              "e": true
            }
          ],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "304",
              "e": true
            }
          ],
          "folder": "ETag",
          "description": "Nothing changed, so the server answers 304 and sends no body."
        },
        {
          "id": "1e88a28e-9209-5c3c-a925-1a77ba84c91a",
          "name": "Version 1 (default)",
          "method": "GET",
          "url": "{{baseUrl}}/greeting",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "version",
              "x": "1",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "message",
              "x": "Hello",
              "e": true
            }
          ],
          "folder": "Versioning"
        },
        {
          "id": "a01a9c99-9094-5678-8e8c-e6ad3381436a",
          "name": "Version 2 by header",
          "method": "GET",
          "url": "{{baseUrl}}/greeting",
          "params": [],
          "headers": [
            {
              "k": "Accept-Version",
              "v": "2",
              "e": true
            }
          ],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "version",
              "x": "2",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "message.text",
              "x": "Hello",
              "e": true
            }
          ],
          "folder": "Versioning"
        },
        {
          "id": "7ad23432-0b99-5ee0-aac9-6b96849fed74",
          "name": "Call with an expired token",
          "method": "GET",
          "url": "{{baseUrl}}/secure/report",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "bearer",
          "bearerToken": "expired-token",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "401",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "error",
              "x": "token_expired",
              "e": true
            },
            {
              "kind": "headerContains",
              "t": "WWW-Authenticate",
              "x": "invalid_token",
              "e": true
            }
          ],
          "folder": "Token refresh"
        },
        {
          "id": "e29a3c71-907e-53a9-9ba4-47b1abf746b8",
          "name": "Get a new token",
          "method": "POST",
          "url": "{{baseUrl}}/auth/refresh",
          "params": [],
          "headers": [],
          "bodyType": "json",
          "body": "{\n  \"refreshToken\": \"{{refreshToken}}\"\n}",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "bodyContains",
              "t": "",
              "x": "fresh-",
              "e": true
            }
          ],
          "folder": "Token refresh",
          "captures": {
            "accessToken": "body.accessToken"
          }
        },
        {
          "id": "34b3cf07-e9ee-54a6-ba7d-496547151765",
          "name": "Retry with the new token",
          "method": "GET",
          "url": "{{baseUrl}}/secure/report",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "bearer",
          "bearerToken": "{{accessToken}}",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "rows",
              "x": "42",
              "e": true
            }
          ],
          "folder": "Token refresh"
        },
        {
          "id": "67f9d761-1da3-5693-8df8-c62bbee5018b",
          "name": "Send a sample event",
          "method": "POST",
          "url": "{{baseUrl}}/webhooks/payments",
          "params": [],
          "headers": [
            {
              "k": "X-Signature",
              "v": "sha256=demo-signature",
              "e": true
            }
          ],
          "bodyType": "json",
          "body": "{\n  \"event\": \"payment.succeeded\",\n  \"id\": \"evt_{{$randomInt}}\",\n  \"amount\": 1999,\n  \"currency\": \"INR\"\n}",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "204",
              "e": true
            }
          ],
          "folder": "Webhooks",
          "description": "Then open Live in Mock Studio to see the event as your receiver would."
        },
        {
          "id": "25a91702-997d-5778-a82e-9052779501b1",
          "name": "Wait for the job to finish",
          "method": "GET",
          "url": "{{baseUrl}}/jobs/job-42",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "id",
              "x": "job-42",
              "e": true
            }
          ],
          "folder": "Polling",
          "description": "The script repeats this request until the status is done.",
          "testScript": "// Ask again until the job is done, at most 10 times.\nconst body = pm.response.json();\nconst tries = Number(pm.collectionVariables.get('pollTries') || 0) + 1;\npm.collectionVariables.set('pollTries', String(tries));\nif (body.status !== 'done' && tries < 10) {\n  postman.setNextRequest('Wait for the job to finish');\n} else {\n  pm.collectionVariables.set('pollTries', '0');\n  pm.test('job finished within 10 tries', function () {\n    pm.expect(body.status).to.eql('done');\n  });\n}"
        },
        {
          "id": "c769f905-86ed-5b9e-b9a3-e6190b16e982",
          "name": "Sign up",
          "method": "POST",
          "url": "{{baseUrl}}/signup",
          "params": [],
          "headers": [],
          "bodyType": "json",
          "body": "{\n  \"email\": \"{{email}}\",\n  \"password\": \"{{password}}\"\n}",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [],
          "folder": "Validation",
          "description": "Run this folder with signup-cases.csv to try every rule.",
          "testScript": "// In a data-driven run, each row says what should happen.\nconst expected = Number(pm.iterationData.get('expectedStatus') || 201);\nconst field = pm.iterationData.get('expectedField');\npm.test('status is ' + expected, function () {\n  pm.response.to.have.status(expected);\n});\nif (field) {\n  pm.test('the error names ' + field, function () {\n    pm.expect(pm.response.json().field).to.eql(field);\n  });\n}"
        },
        {
          "id": "47be11b8-0402-5771-9743-597184d2b28d",
          "name": "Preflight check",
          "method": "OPTIONS",
          "url": "{{baseUrl}}/articles",
          "params": [],
          "headers": [
            {
              "k": "Origin",
              "v": "https://app.example.com",
              "e": true
            },
            {
              "k": "Access-Control-Request-Method",
              "v": "POST",
              "e": true
            }
          ],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "204",
              "e": true
            },
            {
              "kind": "headerContains",
              "t": "Access-Control-Allow-Origin",
              "x": "*",
              "e": true
            },
            {
              "kind": "headerContains",
              "t": "Access-Control-Allow-Methods",
              "x": "POST",
              "e": true
            }
          ],
          "folder": "CORS",
          "description": "What a browser asks before calling the API from another site."
        }
      ],
      "variables": [
        {
          "k": "baseUrl",
          "v": "http://localhost:4040",
          "e": true
        },
        {
          "k": "refreshToken",
          "v": "refresh-123",
          "e": true
        },
        {
          "k": "email",
          "v": "ada@example.com",
          "e": true
        },
        {
          "k": "password",
          "v": "correct-horse",
          "e": true
        }
      ],
      "description": "Nine real-world API patterns, one folder each, for the Recipes sample mock. From learn.dhivalabs.com."
    }
  ],
  "environments": []
}
