Archived topic — some details may be out of date.
Mock servers built from saved collection examples are still supported. Postman now also has code-based mocks: JavaScript request handlers plus aconfig.yaml, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (postman mock generate) and run it (postman mock run). See About mocks and Create a mock.
Working with an AI coding agent? The Postman plugin can build and run mocks for you.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.
I have a mock server that is receiving messages I send from my system. I can see a JSON structure I send in Mock Server Call Log, inside the Request Body.
How can I save a value from this Request Body somewhere e.g. as environment or collection variable?
I need to save a specific value from the Request Body and use it to inside a Response Body.
Currently, Response body is sending hardcoded values I set up myself. I need to be able to save value from Request body and use it in the Response body.
Details (like screenshots):