# How can I use \`api.user\` in a post change password action?

**URL:** <https://community.auth0.com/t/how-can-i-use-api-user-in-a-post-change-password-action/150085>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [October 18, 2024, 9:44am UTC](https://community.auth0.com/t/how-can-i-use-api-user-in-a-post-change-password-action/150085 "2024-10-18T09:44:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkrp1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@kkrp1](https://community.auth0.com/u/kkrp1)\
**Post date:** [October 18, 2024, 9:44am UTC](https://community.auth0.com/t/how-can-i-use-api-user-in-a-post-change-password-action/150085/1 "2024-10-18T09:44:32Z")

</div>

[This post](https://community.auth0.com/t/using-the-management-api-in-actions/64947) discusses using `api.user...` to set user meta data from within a pre-registration or post-login action. But how can I do this from a post change password action?

If I try to, I get an error:

> Property ‘user’ does not exist on type ‘PostChangePasswordAPI’

I have a flag set on user app meta, `mustChangePass`, and after they’ve changed password I want to unset that flag.

---

<div class="post-metadata">

**Author:** ![tudor.smeu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tudor.smeu/32/59767_2.png) [@tudor.smeu](https://community.auth0.com/u/tudor.smeu)\
**Post date:** [October 18, 2024, 2:36pm UTC](https://community.auth0.com/t/how-can-i-use-api-user-in-a-post-change-password-action/150085/3 "2024-10-18T14:36:11Z")

</div>

Hello @kkrp1,

Welcome back to the Auth0 community!

Unfortunately, there is no `API` object provided within this flow. What you are trying to do is possible using the Management API. Check the following Solution for further information on this: [Update User Metadata from Within a Post Change Password Action](https://community.auth0.com/t/update-user-metadata-from-within-a-post-change-password-action/124756)

I hope this was helpful.

Thanis,  
Tudor

---

<div class="post-metadata">

**Author:** ![kkrp1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@kkrp1](https://community.auth0.com/u/kkrp1)\
**Post date:** [October 23, 2024, 11:20am UTC](https://community.auth0.com/t/how-can-i-use-api-user-in-a-post-change-password-action/150085/4 "2024-10-23T11:20:40Z")

</div>

Thanks, @tudor.smeu. I’ve read some of those posts. The trouble is that they each link to each other, and it can be very cirucuitous and tiresome reading to get to the simple answer. It would be great if Auth0 could just do a full demo somewhere of how to use the management API (or specifically update user meta) from **any** action. It’s also not clear from the linked thread how creating a maching-to-machine application serves this purpose. If I create the application, how is it then used inside an action?

---

<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:** [November 6, 2024, 11:21am UTC](https://community.auth0.com/t/how-can-i-use-api-user-in-a-post-change-password-action/150085/5 "2024-11-06T11:21:05Z")

</div>

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