# M2M token usage in Actions

**URL:** <https://community.auth0.com/t/m2m-token-usage-in-actions/90798>\
**Category:** Get Help\
**Created:** [September 16, 2022, 7:01pm UTC](https://community.auth0.com/t/m2m-token-usage-in-actions/90798 "2022-09-16T19:01:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![f8DhZh3P](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/f8dhzh3p/32/13599_2.png) [@f8DhZh3P](https://community.auth0.com/u/f8DhZh3P)\
**Post date:** [September 16, 2022, 7:01pm UTC](https://community.auth0.com/t/m2m-token-usage-in-actions/90798/1 "2022-09-16T19:01:22Z")

</div>

Hi there,

As part of my login flow, I have an action that executes the following when a new user signs up:

1. Send a request with client id & client secret to an M2M Application in exchange for an access token
2. Use that access token to send a request to my API

This works. However, it appears I’m burning one access token from my allotted amount in my pricing tier with every user sign up, and if I released this implementation to production, we’d run out of access tokens in a very short period of time. Given my access tokens are configured to not expire for a few hours, what are my options? Is there somewhere I can cache the access token to reuse it in the next action execution? Or is there a way to configure the M2M application to give me the same access token as long as it does not expire within a few seconds? Thank you.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 21, 2022, 11:45pm UTC](https://community.auth0.com/t/m2m-token-usage-in-actions/90798/3 "2022-09-21T23:45:34Z")

</div>

Hi @f8DhZh3P,

Welcome to the Auth0 Community!

I understand you have some questions about M2M token usage in Actions.

> [@f8DhZh3P](#):
>
> Given my access tokens are configured to not expire for a few hours, what are my options? Is there somewhere I can cache the access token to reuse it in the next action execution? Or is there a way to configure the M2M application to give me the same access token as long as it does not expire within a few seconds?

Unfortunately, when using Management API in Actions, it is not possible to cache the Access Token and must always request a new one.

Generally, if you are exceeding your alloted quota, we recommend revising your architecture and design.

Please reach out if you have any additional questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 5, 2022, 11:46pm UTC](https://community.auth0.com/t/m2m-token-usage-in-actions/90798/4 "2022-10-05T23:46:11Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
