# Monitor - Can the bearer {{access\_token}} Environment Variable be updated post OAUTH monitor

**URL:** <https://community.postman.com/t/monitor-can-the-bearer-access-token-environment-variable-be-updated-post-oauth-monitor/1039>\
**Category:** Help Hub\
**Created:** [February 23, 2018, 6:21pm UTC](https://community.postman.com/t/monitor-can-the-bearer-access-token-environment-variable-be-updated-post-oauth-monitor/1039 "2018-02-23T18:21:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![data\_reporting](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@data\_reporting](https://community.postman.com/u/data_reporting)\
**Post date:** [February 23, 2018, 6:21pm UTC](https://community.postman.com/t/monitor-can-the-bearer-access-token-environment-variable-be-updated-post-oauth-monitor/1039/1 "2018-02-23T18:21:51Z")

</div>

Hi,

I use Postman Free, so I can make 1000 API calls free via Monitor.  
There is a requirement to automate API calls once a day that work fine if manually run or by individually running them by setting the Environment variables via this helpful link:

> **[Using Postman Environment Variables & Auth Tokens](https://medium.com/@codebyjeff/using-postman-environment-variables-auth-tokens-ea9c4fe9d3d7)**
>
> An ever increasing part of our job as developers these days is creating back-end apis. There are a lot of great tools being developed to…

The refresh tokens take around a few hours to expire so I set up the OAUTH collection under a monitor (which does work in isolation), however it does not update the new bearer {{access\_token}} on each of the 4 jobs, so they cannot authenticate when they run post OAUTH monitor.

These API Calls run fine manually post OAUTH req, but these are required overnight for a data import for analysis. Is there a way I can do this, or is it a limitation on the Monitor?

Thanks in advance, happy to expand if not enough info given…

---

<div class="post-metadata">

**Author:** ![kunagpal](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kunagpal/32/9_2.png) [@kunagpal](https://community.postman.com/u/kunagpal)\
**Post date:** [February 26, 2018, 8:09am UTC](https://community.postman.com/t/monitor-can-the-bearer-access-token-environment-variable-be-updated-post-oauth-monitor/1039/2 "2018-02-26T08:09:41Z")

</div>

Hey @data_reporting, this is quite common a use case and can be accomplished easily. All you’ll have to do is include a final request in your collection that uses the [Postman API](https://docs.api.getpostman.com/#a237ffbe-0444-b394-a2c4-b99f691931cf) to update your monitor’s environment after the run has completed.

---

<div class="post-metadata">

**Author:** ![data\_reporting](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@data\_reporting](https://community.postman.com/u/data_reporting)\
**Post date:** [February 26, 2018, 2:42pm UTC](https://community.postman.com/t/monitor-can-the-bearer-access-token-environment-variable-be-updated-post-oauth-monitor/1039/4 "2018-02-26T14:42:17Z")

</div>

Thanks @kunagpal , ok, I’ve created the E Var {{postman\_api\_key}} and tested [https://api.getpostman.com/environments/](https://api.getpostman.com/environments/) which worked and the API key is linked to the correct environment.

 ![EVars](https://us1.discourse-cdn.com/getpostman/original/3X/a/f/afb02bf28df1a3a04ee07678e8ad56720a51ebdc.jpeg)

I think I’ve got it set up ok, but until the OAUTH token runs out, I can’t test this on Monitor for a few hours yet

---

<div class="post-metadata">

**Author:** ![garethj](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/garethj/32/576_2.png) [@garethj](https://community.postman.com/u/garethj)\
**Post date:** [May 1, 2018, 11:09pm UTC](https://community.postman.com/t/monitor-can-the-bearer-access-token-environment-variable-be-updated-post-oauth-monitor/1039/5 "2018-05-01T23:09:43Z")

</div>

This works, but as a user, it could be a LOT easier. I’d rather have a checkbox like in the runner to have a monitor able to affect its environment simply by writing to it in script.
