How to delay response from mock server?

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 a config.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 set my program to timeout if it doesn’t receive a response to an http call after several minutes. I am trying to test this case using my postman mock server, but I can’t find any way to delay the response from the mock server.

I have tried calling https://postman-echo.com/delay/10. This works but only delays up to 10 seconds. I need a longer delay than this.

Any advice is appreciated. Thank you!

As of v7.32.0 you can more accurately depict API behavior with mock servers by simulating a 100ms, 300ms, or custom network delay.

Look uder the settings for your mock server to configure:

Hi… I have been trying to set delay to 180000ms using the above ‘custom delay config’ of mock server and also set the postman timeout to 180000 ms, but when I send the request the response is coming as gateway timeout error after 1 minute… Please help !

Thanks !!