> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging.auth0-mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Post User Registration

> Learn about Post User Registration Actions, which run after a user has been created for a Database or Passwordless connection. They can be used to notify another system that a user has registered.

The `post-user-registration` trigger runs after a user is added to a Database or <Tooltip tip="Passwordless: Form of authentication that does not rely on a password as the first factor." cta="View Glossary" href="/docs/glossary?term=Passwordless">Passwordless</Tooltip> connection. Use this trigger to notify another system that a user has registered for your application. Multiple Actions can be bound to this trigger, and the Actions will run in order.

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/docs-staging/docs/images/cdy7uua7fh8z/4bqF9YEPYQshnJGCx39pws/079798c354f4a83355a756a6a02650d5/post-user-registration-flow.png" alt="Diagram of the Actions Post User Registration Flow." />
</Frame>

Actions in this flow are non-blocking (asynchronous): the Auth0 pipeline continues to run without waiting for the Action to finish, so the Action's outcome does not affect the Auth0 transaction.

## References

* [Event object](/docs/customize/actions/reference/post-user-registration/post-user-registration-event-object): Provides contextual information about the newly-created user.
* [API object](/docs/customize/actions/reference/post-user-registration/post-user-registration-api-object): Provides methods for changing the behavior of the flow.

## Common use cases

### Notify Slack when a new user registers

A post-user-registration Action can be used to notify a Slack channel about each new registration:

```javascript lines theme={null}
/**
 * @param {Event} event - Details about the context and user that has registered.
 * @param {PostUserRegistrationAPI} api - Interface whose methods can be used to change the behavior of post user registration.
 */
exports.onExecutePostUserRegistration = async (event, api) => {
  const { IncomingWebhook } = require("@slack/webhook");
  const webhook = new IncomingWebhook(event.secrets.SLACK_WEBHOOK_URL);

  const text = `New User: ${event.user.email}`;
  const channel = '#some_channel';

  webhook.send({ text, channel });
};
```

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  For this Action to execute properly, the Action must contain a secret named `SLACK_WEBHOOK_URL` and must have a dependency on the `@slack/webhook` `npm` package.
</Callout>

### Store the Auth0 user ID in a remote system

A post-user-registration Action can be used to store the Auth0 user ID in a remote system:

```javascript lines theme={null}
const axios = require("axios");

/**
 * @param {Event} event - Details about the context and user that has registered.
 * @param {PostUserRegistrationAPI} api - Interface whose methods can be used to change the behavior of post user registration.
 */
exports.onExecutePostUserRegistration = async (event, api) => {
  await axios.post("https://my-api.exampleco.com/users", { params: { email: event.user.email }});
};
```

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  To use an `npm` library like `axios`, you must add the library to the Action as a dependency. To learn more, read the "Add a dependency" section in [Write Your First Action](/docs/customize/actions/write-your-first-action).
</Callout>
