# Mock Service Returning Incorrect Example Response

**URL:** <https://community.postman.com/t/mock-service-returning-incorrect-example-response/3766>\
**Category:** Help Hub\
**Tags:** mocks\
**Created:** [January 9, 2019, 8:53am UTC](https://community.postman.com/t/mock-service-returning-incorrect-example-response/3766 "2019-01-09T08:53:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhAtPostman](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@mhAtPostman](https://community.postman.com/u/mhAtPostman)\
**Post date:** [January 9, 2019, 8:53am UTC](https://community.postman.com/t/mock-service-returning-incorrect-example-response/3766/1 "2019-01-09T08:53:31Z")

</div>

> **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](https://learning.postman.com/docs/design-apis/mock-apis/mocks/overview) and [Create a mock](https://learning.postman.com/docs/design-apis/mock-apis/mocks/create-a-mock).  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) can build and run mocks for you.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

Hi, I created a mock service for my collection ( **C** ) that contains one request ( **R** ).  
Request **R** accepts, at most, 3 query parameters. I then saved all examples of request **R** for all possible combinations of query parameters.

When calling the actual request **R** without any query parameter, it responded with HTTP 401 which I saved as an example to be used in mocking. However, when calling the mock endpoint for that request without any query parameter, it did not return the exact example saved for that request. Instead, the mock service returned another example that is meant for a request that takes in all 3 query parameters.

Has anyone experienced the same issue?

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [April 30, 2025, 2:11pm UTC](https://community.postman.com/t/mock-service-returning-incorrect-example-response/3766/2 "2025-04-30T14:11:17Z")

</div>

Closed on April 30, 2025, 2:11pm UTC


