# Monitoring Authorization Error

**URL:** <https://community.postman.com/t/monitoring-authorization-error/18761>\
**Category:** Help Hub\
**Created:** [December 30, 2020, 6:06pm UTC](https://community.postman.com/t/monitoring-authorization-error/18761 "2020-12-30T18:06:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbalasi](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@jbalasi](https://community.postman.com/u/jbalasi)\
**Post date:** [December 30, 2020, 6:06pm UTC](https://community.postman.com/t/monitoring-authorization-error/18761/1 "2020-12-30T18:06:01Z")

</div>

I have set up collection and added test to them. I added monitoring to a collection and it runs and passes one of the test that monitors how long the call takes, but it fails on the 200 status. I am getting a 401 unauthorized response. When I run the api it works and retrieves information, but when I run in monitor it fails? I have the Ocp-Apim-Subscription-Key set as a global variable, and it is correct in the api call.

---

<div class="post-metadata">

**Author:** ![praveendvd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/praveendvd/32/6796_2.png) [@praveendvd](https://community.postman.com/u/praveendvd)\
**Post date:** [January 2, 2021, 4:20am UTC](https://community.postman.com/t/monitoring-authorization-error/18761/2 "2021-01-02T04:20:20Z")

</div>

Thank you for reachig out, please see if this helps

> **[Monitor health and performance of your APIs in Postman | Postman Docs](https://learning.postman.com/docs/monitoring-your-api/intro-monitors/)**
>
> Postman Monitors enable you to continuously check the health and performance of your APIs. You can create monitors that run requests in selected collections.

### Accessible APIs

- Monitors require all URLs to be publicly available on the internet as they run in the Postman cloud. A monitor cannot directly access your localhost or run requests behind a firewall. However, to overcome this issue, static IPs are available on [Postman Business and Enterprise plans](https://www.postman.com/pricing).

So make sure your API is authorized to be accessed from the outside world, see if this helps

---

<div class="post-metadata">

**Author:** ![taehoshino](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/taehoshino/32/6608_2.png) [@taehoshino](https://community.postman.com/u/taehoshino)\
**Post date:** [January 4, 2021, 6:27am UTC](https://community.postman.com/t/monitoring-authorization-error/18761/3 "2021-01-04T06:27:19Z")

</div>

Hi @jbalasi! I understand you are using a API key that is set as a global variable when running a monitor, correct?

Monitor does not have access to global variables so use collection/environment variables instead.

FYI, a few differences between runner and monitor:

- All API must be publicly available
- No access to global variables (use collection/environment variables instead)
- No access to CURRENT VALUE (remember CURRENT VALUE is local to your session)

Hope this helps!
