When a body needs computed fields, conditional parts, escaping or data from earlier responses, build it as a JavaScript object and send it with pm.request.body.raw. Patterns for totals, optional fields, dates and signatures.
Values that scripts set during a run are gone when it ends. When you really need one in the next run (a created account, a cursor, a last-seen id), save it on purpose with the CLI, and when you don't, make each run start clean.
A short naming guide a team can agree on in ten minutes: requests, folders, environments, variables and tests. With examples, the reasons behind each rule, and what to do with the names you already have.
Tests with realistic data find more bugs, but copying production data into collections, data files and run history spreads personal data everywhere. How to get the shapes and edge cases of production without the people.
Random values avoid collisions and find edge cases; fixed values make failures reproducible. A practical split for API tests: what to randomize, what to pin, and how to make a random failure repeatable.
Variables hold text, so an object saved with pm.environment.set comes back as a JSON string. How to save whole objects and lists, read them in later scripts, and use them in request bodies.
Product 42 exists on staging but not locally, and the test account has a different id in each environment. Keep test data ids in environments, check they still exist before a run, and seed Local with a script.
Two pipelines create "[email protected]" at the same moment and one fails with "already exists". How to make every run's data unique with a run id, dynamic variables and iteration numbers, and clean up only what your run created.
{{variables}} are replaced as plain text, so where you put the quotes decides whether a value becomes a string, a number or an array. The rules, the common breakages, and how to build tricky bodies safely in a script.
Five services times three stages is fifteen environments in one long list. How environment groups keep Local, Staging and Production per service, share the list of expected variables, and work with a local .env file.
A request with an unresolved {{variable}} goes to the wrong URL or sends an empty token. How the Variables panel shows every variable a request uses and where its value comes from, and why the CLI refuses to send a request with a missing one.
Where a {{variable}} gets its value in an API client, in which order, and how to structure collection, folder and environment variables so requests stay reusable across stages.
Log in once, store the token from the response, and use it in every request after it. Plus passing IDs between requests, in the app, in collection runs and in CI.
Generate unique IDs, timestamps and realistic fake data in API requests with built-in dynamic variables. Postman-compatible names, grouped by use, with examples.
One collection, three stages. Create environment groups and environments, keep secrets safe per stage, switch with one click, and avoid sending a test request to production by mistake.