# Caching Access Token in Send Phone Message Action

**URL:** <https://community.auth0.com/t/caching-access-token-in-send-phone-message-action/116377>\
**Category:** Get Help\
**Tags:** guardian, management-api\
**Created:** [September 15, 2023, 7:58pm UTC](https://community.auth0.com/t/caching-access-token-in-send-phone-message-action/116377 "2023-09-15T19:58:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spoudel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/spoudel/32/51376_2.png) [@spoudel](https://community.auth0.com/u/spoudel)\
**Post date:** [September 15, 2023, 7:58pm UTC](https://community.auth0.com/t/caching-access-token-in-send-phone-message-action/116377/1 "2023-09-15T19:58:35Z")

</div>

How can I cache an Access Token in Send Phone Message action? If it is not possible, can I cache it in Machine to Machine action?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 15, 2023, 8:40pm UTC](https://community.auth0.com/t/caching-access-token-in-send-phone-message-action/116377/3 "2023-09-15T20:40:05Z")

</div>

Hey there @spoudel !

Unfortunately, caching is not supported in the send phone message flow. Caching is however supported for M2M flow - See the methods on the credentials-exchange API object here:

> **[Actions Triggers: credentials-exchange - API Object](https://auth0.com/docs/customize/actions/flows-and-triggers/machine-to-machine-flow/api-object)**
>
> Learn about the credentials-exchange Action trigger's API object.

---

<div class="post-metadata">

**Author:** ![spoudel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/spoudel/32/51376_2.png) [@spoudel](https://community.auth0.com/u/spoudel)\
**Post date:** [September 16, 2023, 12:23am UTC](https://community.auth0.com/t/caching-access-token-in-send-phone-message-action/116377/4 "2023-09-16T00:23:00Z")

</div>

> [@ty.frith](#):
>
> See the methods on the credentials-exchange API object here:
> 
> [Actions Triggers: credentials-exchange - API Object - Auth0 Docs](https://auth0.com/docs/customize/actions/flows-and-triggers/machine-to-machine-flow/api-object)

Hey tyf, Thanks for the prompt response. I would like to cache the access tokens so that I would not go past the M2M token utilization quota. I ask for an M2M token in the Send Phone Message Action. If I cache the token in Machine to Machine action, will I be able to overcome the problem?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 16, 2023, 12:34am UTC](https://community.auth0.com/t/caching-access-token-in-send-phone-message-action/116377/5 "2023-09-16T00:34:51Z")

</div>

Hey @spoudel no problem, happy to help!

> [@spoudel](#):
>
> If I cache the token in Machine to Machine action, will I be able to overcome the problem?

That is correct - This allows you to use 1 token until it expires and only then do you need to request another.

> [@Actions Caching Is Now Available](https://community.auth0.com/t/actions-caching-is-now-available/94629):
>
> Reduce development overhead and improve performance while storing more artifacts. [Read more…](https://auth0.com/blog/actions-caching-is-now-available/)writing_hand:t2 Brought to you by Alexa Jacky and Oliver Wang

---

<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:** [September 30, 2023, 12:35am UTC](https://community.auth0.com/t/caching-access-token-in-send-phone-message-action/116377/6 "2023-09-30T00:35:24Z")

</div>

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