# Private mock server returning 403 response

**URL:** <https://community.postman.com/t/private-mock-server-returning-403-response/36420>\
**Category:** Help Hub\
**Tags:** mocks, mockservers, private-mock-servers\
**Created:** [June 21, 2022, 3:45pm UTC](https://community.postman.com/t/private-mock-server-returning-403-response/36420 "2022-06-21T15:45:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremyfiel](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jeremyfiel](https://community.postman.com/u/jeremyfiel)\
**Post date:** [June 21, 2022, 3:45pm UTC](https://community.postman.com/t/private-mock-server-returning-403-response/36420/1 "2022-06-21T15:45:46Z")

</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).

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 mechanism and I have the `x-api-key` header with my postman api key.

_Details (like screenshots)_:

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/e/e6001ba9f81a3238c21a0d19f2482558a9d89eb2.png)

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/5/553cf2441b2492803b7241381641880737613a72.jpeg)

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [June 21, 2022, 3:58pm UTC](https://community.postman.com/t/private-mock-server-returning-403-response/36420/2 "2022-06-21T15:58:49Z")

</div>

Hi @jeremyfiel

Has your API key expired?  
or have you tried regenerating a new one?

---

<div class="post-metadata">

**Author:** ![jeremyfiel](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jeremyfiel](https://community.postman.com/u/jeremyfiel)\
**Post date:** [June 21, 2022, 4:00pm UTC](https://community.postman.com/t/private-mock-server-returning-403-response/36420/3 "2022-06-21T16:00:22Z")

</div>

nope, i just generated it and tested it immediately and it returned 403.

Yes, I tried a second one and same results

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [June 21, 2022, 4:09pm UTC](https://community.postman.com/t/private-mock-server-returning-403-response/36420/4 "2022-06-21T16:09:31Z")

</div>

Where does it get the 403 response body from?  
is that an example you have created?

Do you have multiple example files for this endpoint?  
(if so what example files have you setup)

---

<div class="post-metadata">

**Author:** ![jeremyfiel](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jeremyfiel](https://community.postman.com/u/jeremyfiel)\
**Post date:** [June 21, 2022, 4:22pm UTC](https://community.postman.com/t/private-mock-server-returning-403-response/36420/5 "2022-06-21T16:22:50Z")

</div>

the 403 is my own schema example provided in the definition

i have examples for each response code. the example isn’t the problem, I can’t get it to return 200, either with an empty body or with the example schema I have

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [June 21, 2022, 4:38pm UTC](https://community.postman.com/t/private-mock-server-returning-403-response/36420/6 "2022-06-21T16:38:41Z")

</div>

When you say ‘Mock Server’ are you referring to the ‘Mock Server’ tab or the API tab?  
 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/d/d8f85fece9df6179ebff12377741c750719fdb98.png)

Sounds like you mean the API tab… I haven’t used that much personally, but I would guess that a 403 would be related to having the correct access to the URL used in the schema.

---

<div class="post-metadata">

**Author:** ![jeremyfiel](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jeremyfiel](https://community.postman.com/u/jeremyfiel)\
**Post date:** [June 21, 2022, 5:48pm UTC](https://community.postman.com/t/private-mock-server-returning-403-response/36420/7 "2022-06-21T17:48:43Z")

</div>

I have a mock server associated to a collection. the collection was generated from an imported openapi definition. So I have a collection, api and mock server in postman.

I tried sending the request outside of our corporate network and I’m getting the same 403 response.

---

<div class="post-metadata">

**Author:** ![hooram950](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@hooram950](https://community.postman.com/u/hooram950)\
**Post date:** [December 21, 2025, 1:43pm UTC](https://community.postman.com/t/private-mock-server-returning-403-response/36420/8 "2025-12-21T13:43:01Z")

</div>

> [@jeremyfiel](#):
>
> I have a mock server associated to a collection. the collection was generated from an imported openapi definition. So I have a collection, api and [mock server](https://nulsbrawl.fr/) in postman.
> 
> I tried sending the request outside of our corporate network and I’m getting the same 403 response.

Yeah, if you’re still getting a 403 even outside the corporate network, that usually means it’s not just a firewall or internal restriction issue. Could be auth requirements, headers, or access rules tied to the mock or collection setup. Might be worth double-checking permissions or any security settings tied to that mock server.
