# \#mocks

**URL:** https://community.postman.com/tag/mocks/5.md

[Latest](https://community.postman.com/latest.md) · [Categories](https://community.postman.com/categories.md) · [Tags](https://community.postman.com/tags.md)

---

## [Private mock server returning 403 response](https://community.postman.com/t/private-mock-server-returning-403-response/36420)

<div class="topic-metadata">

**Author:** [@jeremyfiel](https://community.postman.com/u/jeremyfiel)\
**Replies:** 7\
**Last updated:** [December 21, 2025, 1:43pm UTC](https://community.postman.com/t/private-mock-server-returning-403-response/36420 "2025-12-21T13:43:01Z")

</div>

I have a private mock server setup and i’m able to send a request and receive my 403 response body schema, but I’m not sure why the 403 is being returned. I’m using a GET call with no parameters, no oAuth or security me…

---

## [Getting request body array variable in mock's dynamic response](https://community.postman.com/t/getting-request-body-array-variable-in-mocks-dynamic-response/47718)

<div class="topic-metadata">

**Author:** [@davsingh](https://community.postman.com/u/davsingh)\
**Replies:** 0\
**Last updated:** [May 23, 2023, 10:42am UTC](https://community.postman.com/t/getting-request-body-array-variable-in-mocks-dynamic-response/47718 "2023-05-23T10:42:09Z")

</div>

The request body has an array variable in POST request. I want to make dynamic response for my mock server. Could you please help me as I want to pick the names from input request dynamically. Input request: { "name…

---

## [Mock response template for arrays](https://community.postman.com/t/mock-response-template-for-arrays/72089)

<div class="topic-metadata">

**Author:** [@cpaye](https://community.postman.com/u/cpaye)\
**Replies:** 0\
**Last updated:** [December 4, 2024, 9:48pm UTC](https://community.postman.com/t/mock-response-template-for-arrays/72089 "2024-12-04T21:48:07Z")

</div>

Hello. I am setting up responses for my mock server. My request body is an array of JSON objects. I want to use the value of report\_request\_id in my mock response. Here is a simplified version of my request body: \[…

---

## [Mock server always returning "mockRequestNotFoundError"](https://community.postman.com/t/mock-server-always-returning-mockrequestnotfounderror/63835)

<div class="topic-metadata">

**Author:** [@epablom](https://community.postman.com/u/epablom)\
**Replies:** 3\
**Last updated:** [July 31, 2024, 11:31am UTC](https://community.postman.com/t/mock-server-always-returning-mockrequestnotfounderror/63835 "2024-07-31T11:31:59Z")

</div>

I created a new collection with a single request to learn how to use Postman mock servers and, while I managed to successfully make it private, return different examples for a single route depending on query parameters… …

---

## [502 Bad Gateway NGINX](https://community.postman.com/t/502-bad-gateway-nginx/61290)

<div class="topic-metadata">

**Author:** [@aditi139](https://community.postman.com/u/aditi139)\
**Replies:** 0\
**Last updated:** [May 21, 2024, 1:25pm UTC](https://community.postman.com/t/502-bad-gateway-nginx/61290 "2024-05-21T13:25:19Z")

</div>

For a collection, when I mock an API using the mock server URL, the first API mock example returns 200 OK, but 2nd mock example of 2nd API is returning 502 Bad Gateway NGINX. Steps Create a collection of APIs Mock t…

---

## [Passing Payload to Example in Mock GET Call](https://community.postman.com/t/passing-payload-to-example-in-mock-get-call/59347)

<div class="topic-metadata">

**Author:** [@grubeg](https://community.postman.com/u/grubeg)\
**Replies:** 0\
**Last updated:** [March 28, 2024, 4:52pm UTC](https://community.postman.com/t/passing-payload-to-example-in-mock-get-call/59347 "2024-03-28T16:52:11Z")

</div>

I have a mock server GET call with one Example. I want to be able to run the GET call and pass the response payload to the Example dynamically so that the response in the GET call matches the payload I passed to the Exa…

---

## [Send API request to mock server with IP address](https://community.postman.com/t/send-api-request-to-mock-server-with-ip-address/42600)

<div class="topic-metadata">

**Author:** [@wonsangl](https://community.postman.com/u/wonsangl)\
**Replies:** 2\
**Last updated:** [January 6, 2023, 1:32am UTC](https://community.postman.com/t/send-api-request-to-mock-server-with-ip-address/42600 "2023-01-06T01:32:37Z")

</div>

I’m trying to send request to mock server with mock server’s IP address With url, it’s works fine But it returns 404 error when using IP address. I get IP address of mock server with ping command. Is there a…

---

## [Postman mock servers force require Authorization header](https://community.postman.com/t/postman-mock-servers-force-require-authorization-header/16886)

<div class="topic-metadata">

**Author:** [@taewonyara](https://community.postman.com/u/taewonyara)\
**Replies:** 2\
**Last updated:** [June 7, 2022, 2:48pm UTC](https://community.postman.com/t/postman-mock-servers-force-require-authorization-header/16886 "2022-06-07T14:48:09Z")

</div>

I’ve tried searching existing topics and the closest I found was: https://community.postman.com/t/basic-auth-example-using-mock-server/7643 which had no answers. I’m trying to simulate the authentication on my postman m…

---

## [Mock server responses matching request query string params](https://community.postman.com/t/mock-server-responses-matching-request-query-string-params/343)

<div class="topic-metadata">

**Author:** [@overflow](https://community.postman.com/u/overflow)\
**Replies:** 23\
**Last updated:** [May 17, 2022, 8:46pm UTC](https://community.postman.com/t/mock-server-responses-matching-request-query-string-params/343 "2022-05-17T20:46:56Z")

</div>

Hello, I am testing Postman Mock Server functionality and I am not able to understand how does the matching algorithm works. Especially, is it possible to returns different response according to to matching request que…

---

## [Mock Server request matching - use request body as well](https://community.postman.com/t/mock-server-request-matching-use-request-body-as-well/25247)

<div class="topic-metadata">

**Author:** [@a.f](https://community.postman.com/u/a.f)\
**Replies:** 6\
**Last updated:** [May 10, 2022, 4:26pm UTC](https://community.postman.com/t/mock-server-request-matching-use-request-body-as-well/25247 "2022-05-10T16:26:32Z")

</div>

My question: Is it possible to configure a Mock Server to also match by request body, not only by Url? This is not mentioned in the docs, and I can confirm with the latest version, the differences in the bodies of two …

---

## [Mock server incorrect response](https://community.postman.com/t/mock-server-incorrect-response/32692)

<div class="topic-metadata">

**Author:** [@w4dd325](https://community.postman.com/u/w4dd325)\
**Replies:** 11\
**Last updated:** [May 2, 2022, 8:06pm UTC](https://community.postman.com/t/mock-server-incorrect-response/32692 "2022-05-02T20:06:33Z")

</div>

My question: When I build a mock server in a private workspace and set the x-mock-match-request-body header to true, the response I get with an incorrect body is a fail (as expected / left side of image), but if I hit t…

---

## [I'm getting an error "mockRequestNotFoundError" when doing mock request](https://community.postman.com/t/im-getting-an-error-mockrequestnotfounderror-when-doing-mock-request/5903)

<div class="topic-metadata">

**Author:** [@tmdo](https://community.postman.com/u/tmdo)\
**Replies:** 9\
**Last updated:** [April 28, 2022, 3:38am UTC](https://community.postman.com/t/im-getting-an-error-mockrequestnotfounderror-when-doing-mock-request/5903 "2022-04-28T03:38:46Z")

</div>

Describe the bug When doing mock request I get an error: { “error”: { “name”: “mockRequestNotFoundError”, “message”: “This collection does not have any Examples. Please add examples to the requests in this collectio…

---

## [GET response with application/zip as content-type creation](https://community.postman.com/t/get-response-with-application-zip-as-content-type-creation/8005)

<div class="topic-metadata">

**Author:** [@mohdfirdaus.hirmanri](https://community.postman.com/u/mohdfirdaus.hirmanri)\
**Replies:** 5\
**Last updated:** [March 30, 2022, 7:29pm UTC](https://community.postman.com/t/get-response-with-application-zip-as-content-type-creation/8005 "2022-03-30T19:29:02Z")

</div>

Hi all, Basically, I’m trying to mock a behaviour where client downloads a simple zip file from a server. So I’m trying to create a mock server with an example response to a GET HTTP request. The response is an applica…

---

## [Initial value of the variable does not update and I can't use the current value of the variable with mock server](https://community.postman.com/t/initial-value-of-the-variable-does-not-update-and-i-cant-use-the-current-value-of-the-variable-with-mock-server/33856)

<div class="topic-metadata">

**Author:** [@altimetry-architect6](https://community.postman.com/u/altimetry-architect6)\
**Replies:** 0\
**Last updated:** [March 25, 2022, 12:45am UTC](https://community.postman.com/t/initial-value-of-the-variable-does-not-update-and-i-cant-use-the-current-value-of-the-variable-with-mock-server/33856 "2022-03-25T00:45:12Z")

</div>

have problems with variables in the initial value I can’t, I’m using the simulated server I can save the value in the initial value of the variation, I use the pre script: pm.environment.set(‘currencyQuote’, codeData\[so…

---

## [How to link request examples with response examples in the OpenAPI specification](https://community.postman.com/t/how-to-link-request-examples-with-response-examples-in-the-openapi-specification/12495)

<div class="topic-metadata">

**Author:** [@koble.postman3](https://community.postman.com/u/koble.postman3)\
**Replies:** 1\
**Last updated:** [March 11, 2022, 3:41pm UTC](https://community.postman.com/t/how-to-link-request-examples-with-response-examples-in-the-openapi-specification/12495 "2022-03-11T15:41:38Z")

</div>

I am using an API first approach to define my APIs with postman and OpenAPI 3.0. However I’ve encountered a problem with the examples when generating collections from the API specification. When I am autogenerating a co…

---

## [Parse query parameter from request update a variable and use the variable in a header of a response postman mock](https://community.postman.com/t/parse-query-parameter-from-request-update-a-variable-and-use-the-variable-in-a-header-of-a-response-postman-mock/31750)

<div class="topic-metadata">

**Author:** [@nordic-zach](https://community.postman.com/u/nordic-zach)\
**Replies:** 0\
**Last updated:** [January 20, 2022, 6:19pm UTC](https://community.postman.com/t/parse-query-parameter-from-request-update-a-variable-and-use-the-variable-in-a-header-of-a-response-postman-mock/31750 "2022-01-20T18:19:49Z")

</div>

I’m using Postman mock servers for an OAuth flow requiring an inbound UUID to be included with a redirect as a query parameter. The UUID inbound is dynamic (changes every request into the mock server) and will need to be…

---

## [Mock server and regular expression](https://community.postman.com/t/mock-server-and-regular-expression/11245)

<div class="topic-metadata">

**Author:** [@peri.gold81](https://community.postman.com/u/peri.gold81)\
**Replies:** 15\
**Last updated:** [September 25, 2021, 12:14am UTC](https://community.postman.com/t/mock-server-and-regular-expression/11245 "2021-09-25T00:14:28Z")

</div>

Can we use in example request regular expression? currently, i have: { "timestamp": 123456, "customerid": 1212, "Token": "sdcgsdfhgdfsjnhasdfgvweDSTG245TRWEFG" } can I code something like that? { "ti…

---

## [How to mimic oAuth authentication on a Postman mock server](https://community.postman.com/t/how-to-mimic-oauth-authentication-on-a-postman-mock-server/21218)

<div class="topic-metadata">

**Author:** [@gerhard-finclude](https://community.postman.com/u/gerhard-finclude)\
**Replies:** 1\
**Last updated:** [March 10, 2021, 12:26pm UTC](https://community.postman.com/t/how-to-mimic-oauth-authentication-on-a-postman-mock-server/21218 "2021-03-10T12:26:20Z")

</div>

Hi, First of, I scoured the net as well as this forum for an answer or a hint. Unfortunately, I came up empty. I’ve got an API collection for which I had set up a Postman mock server. The actual dev API makes use of oA…

---

## [Mocked responses where the URL is identical](https://community.postman.com/t/mocked-responses-where-the-url-is-identical/7953)

<div class="topic-metadata">

**Author:** [@conbrio96](https://community.postman.com/u/conbrio96)\
**Replies:** 6\
**Last updated:** [February 22, 2021, 4:51pm UTC](https://community.postman.com/t/mocked-responses-where-the-url-is-identical/7953 "2021-02-22T16:51:13Z")

</div>

Hello all! I’m trying to figure out how I can mock two different responses when the URL for both requests is identical. Here’s an example: let’s say I’ve got a GET URL which returns a list of cats. The list of cats re…

---

## [Request using x-mock-match-request-body](https://community.postman.com/t/request-using-x-mock-match-request-body/19272)

<div class="topic-metadata">

**Author:** [@vahan-a](https://community.postman.com/u/vahan-a)\
**Replies:** 1\
**Last updated:** [January 19, 2021, 4:27am UTC](https://community.postman.com/t/request-using-x-mock-match-request-body/19272 "2021-01-19T04:27:27Z")

</div>

does the request specified in the query and the example response have to match exactly ? I’m trying to build a mock endpoint for graphql api and seems like formatting of the request json affects how the response is matc…

---

## [Postman mock server not displaying headers with underscore in the name](https://community.postman.com/t/postman-mock-server-not-displaying-headers-with-underscore-in-the-name/16762)

<div class="topic-metadata">

**Author:** [@shaun.williams](https://community.postman.com/u/shaun.williams)\
**Replies:** 0\
**Last updated:** [October 14, 2020, 4:28pm UTC](https://community.postman.com/t/postman-mock-server-not-displaying-headers-with-underscore-in-the-name/16762 "2020-10-14T16:28:55Z")

</div>

Hi, I’ve been using a mock server to test some edge/error cases for an http client. When I enter a header that contains an underscore in the header name, the mock server does not display it. Is this expected behaviour…

---

## [Post 400 error for Mock "The request cannot be fulfilled due to bad syntax."](https://community.postman.com/t/post-400-error-for-mock-the-request-cannot-be-fulfilled-due-to-bad-syntax/16485)

<div class="topic-metadata">

**Author:** [@profconnietaylor](https://community.postman.com/u/profconnietaylor)\
**Replies:** 8\
**Last updated:** [October 5, 2020, 3:03pm UTC](https://community.postman.com/t/post-400-error-for-mock-the-request-cannot-be-fulfilled-due-to-bad-syntax/16485 "2020-10-05T15:03:14Z")

</div>

Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic. I have imported a OpenAPI/YAML API and trying to creat…

---

## [Use path variable as variable in mock server response](https://community.postman.com/t/use-path-variable-as-variable-in-mock-server-response/15717)

<div class="topic-metadata">

**Author:** [@lukaswelte](https://community.postman.com/u/lukaswelte)\
**Replies:** 3\
**Last updated:** [September 9, 2020, 2:39pm UTC](https://community.postman.com/t/use-path-variable-as-variable-in-mock-server-response/15717 "2020-09-09T14:39:09Z")

</div>

I’m building mocked APIs using examples. The faker library to create random bits and pieces (https://learning.postman.com/docs/writing-scripts/script-references/variables-list/) is awesome to mock the creation of a new …

---

## [{{url}}/knockknock cannot be used as a mock server endpoint](https://community.postman.com/t/url-knockknock-cannot-be-used-as-a-mock-server-endpoint/14641)

<div class="topic-metadata">

**Author:** [@shaun.williams](https://community.postman.com/u/shaun.williams)\
**Replies:** 3\
**Last updated:** [July 31, 2020, 1:27pm UTC](https://community.postman.com/t/url-knockknock-cannot-be-used-as-a-mock-server-endpoint/14641 "2020-07-31T13:27:46Z")

</div>

Hi, I have been using postman and mock servers for a while now, but today I was attempting demonstrate the use of mock servers to some of my peers. I decided to take a trivial example to quickly set up and demonstrate. …

---

## [Rest Assured Automation : Getting "mockRequestNotFoundError" even after specifying "x-mock-match-request-body : true" header for Post request](https://community.postman.com/t/rest-assured-automation-getting-mockrequestnotfounderror-even-after-specifying-x-mock-match-request-body-true-header-for-post-request/13801)

<div class="topic-metadata">

**Author:** [@dinesh.biradar](https://community.postman.com/u/dinesh.biradar)\
**Replies:** 0\
**Last updated:** [July 1, 2020, 7:49am UTC](https://community.postman.com/t/rest-assured-automation-getting-mockrequestnotfounderror-even-after-specifying-x-mock-match-request-body-true-header-for-post-request/13801 "2020-07-01T07:49:35Z")

</div>

Hi, I have created the simple mock server with single POST request for login. The request details are as follows : Path = {{url}}/api/v1/user/login Body = { "username":"test@test.io", "password":"1" } I have create…

---

## [Use environment variable in mock examples](https://community.postman.com/t/use-environment-variable-in-mock-examples/13078)

<div class="topic-metadata">

**Author:** [@alexandre.perrachon](https://community.postman.com/u/alexandre.perrachon)\
**Replies:** 5\
**Last updated:** [June 4, 2020, 11:10am UTC](https://community.postman.com/t/use-environment-variable-in-mock-examples/13078 "2020-06-04T11:10:16Z")

</div>

Hi there I’m trying to reuse my URL parameters inside my mock examples. For example: /mock?param=ABC would ideally reply { "param" = "ABC" } /mock?param=BCD would reply { "param" = "BCD" } etc In my exa…

---

## [Refresh Mock Server and Collection after API definiton has changed](https://community.postman.com/t/refresh-mock-server-and-collection-after-api-definiton-has-changed/12157)

<div class="topic-metadata">

**Author:** [@pbrunmaypbs](https://community.postman.com/u/pbrunmaypbs)\
**Replies:** 1\
**Last updated:** [April 25, 2020, 5:50am UTC](https://community.postman.com/t/refresh-mock-server-and-collection-after-api-definiton-has-changed/12157 "2020-04-25T05:50:33Z")

</div>

What is the fasted way of refreshing a collection and a mock server after the OpenAPI schema has been changed? Do i really always need to recreate them ?

---

## [Getting mocked examples to work on forked collection](https://community.postman.com/t/getting-mocked-examples-to-work-on-forked-collection/11417)

<div class="topic-metadata">

**Author:** [@mfuruya](https://community.postman.com/u/mfuruya)\
**Replies:** 1\
**Last updated:** [March 20, 2020, 4:29pm UTC](https://community.postman.com/t/getting-mocked-examples-to-work-on-forked-collection/11417 "2020-03-20T16:29:38Z")

</div>

Is there a trick to getting mocked examples to work on a collection that has been forked? It seems that a mocked examples only works with the original collection but not the forked ones. My forked collection is hitting t…

---

## [Using Wildcards - Mock Server Matching Algorithm](https://community.postman.com/t/using-wildcards-mock-server-matching-algorithm/11310)

<div class="topic-metadata">

**Author:** [@maryfatimma](https://community.postman.com/u/maryfatimma)\
**Replies:** 2\
**Last updated:** [March 11, 2020, 8:18pm UTC](https://community.postman.com/t/using-wildcards-mock-server-matching-algorithm/11310 "2020-03-11T20:18:22Z")

</div>

I’m trying to follow the instructions for using wildcards in Mock Server Example URLs as described in the documentation here, but I’m not having any luck: https://learning.postman.com/docs/postman/mock-servers/matching-…

---

## [Postman does not accept \`-\` as an URI param for mocking server requests](https://community.postman.com/t/postman-does-not-accept-as-an-uri-param-for-mocking-server-requests/10107)

<div class="topic-metadata">

**Author:** [@Gawady14](https://community.postman.com/u/Gawady14)\
**Replies:** 4\
**Last updated:** [January 15, 2020, 6:08pm UTC](https://community.postman.com/t/postman-does-not-accept-as-an-uri-param-for-mocking-server-requests/10107 "2020-01-15T18:08:30Z")

</div>

I get the following error response: { "error": { "name": "mockRequestNotFoundError", "header": "No matching requests", "message": "Double check your method and the request path and try again.…

[Next page](https://community.postman.com/tag/mocks/5.md?match_all_tags=true&page=1&tags%5B%5D=mocks)
