# Sample code bug in new Actions documentation(Post-User-Registration)

**URL:** <https://community.auth0.com/t/sample-code-bug-in-new-actions-documentation-post-user-registration/62321>\
**Category:** Product Feedback\
**Tags:** actions\
**Created:** [May 5, 2021, 8:50pm UTC](https://community.auth0.com/t/sample-code-bug-in-new-actions-documentation-post-user-registration/62321 "2021-05-05T20:50:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harrisonm](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/harrisonm/32/13593_2.png) [@harrisonm](https://community.auth0.com/u/harrisonm)\
**Post date:** [May 5, 2021, 8:50pm UTC](https://community.auth0.com/t/sample-code-bug-in-new-actions-documentation-post-user-registration/62321/1 "2021-05-05T20:50:26Z")

</div>

> **[Post User Registration Flow](https://auth0.com/docs/customize/actions/flows-and-triggers/post-user-registration-flow)**
>
> Learn about the Post User Registration Flow and post-user-registration Action trigger, which runs after a user has been created for a Database or Passwordless connection.

The code sample references:  
`api.user.setAppMetadata("my-api-user-id", remoteUser.id);`

But according the documentation above, the api object is not available for this type of trigger. Which is correct?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 6, 2021, 9:32am UTC](https://community.auth0.com/t/sample-code-bug-in-new-actions-documentation-post-user-registration/62321/2 "2021-05-06T09:32:26Z")

</div>

Hey there @harrisonm !

I allowed myself to move your topic to the feedback category as I think that’s a better place for it and I closed your initial post.

Regarding your question, let me follow-up with the team to see what is actually correct here. I’ll get back to you soon!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 6, 2021, 9:33am UTC](https://community.auth0.com/t/sample-code-bug-in-new-actions-documentation-post-user-registration/62321/3 "2021-05-06T09:33:58Z")

</div>

Just found it! It seems like it’s a copy/paste error from our side.

The api object is not available in post-user-reg at this time. We’ll get the docs updated.

---

<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:** [May 21, 2021, 9:34am UTC](https://community.auth0.com/t/sample-code-bug-in-new-actions-documentation-post-user-registration/62321/4 "2021-05-21T09:34:37Z")

</div>

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