# Monitoring not working for OAuth enabled APIs

**URL:** <https://community.postman.com/t/monitoring-not-working-for-oauth-enabled-apis/43044>\
**Category:** Help Hub\
**Tags:** monitors, collections, authentication, oauth2, monitor\
**Created:** [January 19, 2023, 11:59am UTC](https://community.postman.com/t/monitoring-not-working-for-oauth-enabled-apis/43044 "2023-01-19T11:59:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkrishnaraj](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@pkrishnaraj](https://community.postman.com/u/pkrishnaraj)\
**Post date:** [January 19, 2023, 11:59am UTC](https://community.postman.com/t/monitoring-not-working-for-oauth-enabled-apis/43044/1 "2023-01-19T11:59:12Z")

</div>

We have a set of APIs enabled with OAuth in collection, we are working on implementing the monitoring functionality to the collection, if we invoke the API manually it’s working as expected, but if we trigger it from Monitor, it throws 401 Unauthorized Error, even though it’s enabled with Inherit from parent authorization.

---

<div class="post-metadata">

**Author:** ![jeq](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jeq](https://community.postman.com/u/jeq)\
**Post date:** [February 10, 2023, 3:17pm UTC](https://community.postman.com/t/monitoring-not-working-for-oauth-enabled-apis/43044/2 "2023-02-10T15:17:56Z")

</div>

I run into the same issue described above.  
I have a collection of API open to the outside world. All endpoints in that collection have Authorization set to: “Inherit auth from parent”  
When I run them individually from the collection i get expected responses. However when I run them through the monitor they all return 401 Unauthorized.

Any help setting this up for Oauth2 would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![pkrishnaraj](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@pkrishnaraj](https://community.postman.com/u/pkrishnaraj)\
**Post date:** [February 13, 2023, 4:42am UTC](https://community.postman.com/t/monitoring-not-working-for-oauth-enabled-apis/43044/3 "2023-02-13T04:42:33Z")

</div>

Jeq - This worked for me.

> <https://gist.github.com/bcnzer/073f0fc0b959928b0ca2b173230c0669>
