The End of Life (EOL) date of Rules and Hooks will be November 18, 2026, and they are no longer available to new tenants created as of October 16, 2023. Existing tenants with active Hooks will retain Hooks product access through end of life.We highly recommend that you use Actions to extend Auth0. With Actions, you have access to rich type information, inline documentation, and public npm packages, and can connect external integrations that enhance your overall extensibility experience. To learn more about what Actions offer, read Understand How Auth0 Actions Work.To help with your migration, we offer guides that will help you migrate from Rules to Actions and migrate from Hooks to Actions. We also have a dedicated Move to Actions page that highlights feature comparisons, an Actions demo, and other resources to help you on your migration journey.To read more about the Rules and Hooks deprecation, read our blog post: Preparing for Rules and Hooks End of Life.
Because we plan to remove Rules and Hooks functions in 2026, you should create new Rules or Hooks only in your Development environment and only to test migration to Actions.To learn how to migrate your Rules to Actions, read Migrate from Rules to Actions. To learn how to migrate your Hooks to Actions, read Migrate from Hooks to Actions.
You can create multiple hooks using the Dashboard or . You can also import and export hooks using the Deploy Command-Line Interface (CLI) tool.
Although you may create multiple hooks for any given extensibility point, each extensibility point may have only one enabled hook at a time. Any subsequent hooks you create for that extensibility point are automatically disabled, so you must explicitly enable them. The enabled hook will be executed for all applications and APIs.
Optionally, you can add secrets (such as Twilio Keys or database connection strings) to hooks.

Use the Dashboard

  1. Go to Auth0 Dashboard > Auth Pipeline > Hooks, and click +Create.
  2. Enter a descriptive name for your hook, select the extensibility point for which the hook should execute, and click Create.
  3. Locate the section for the extensibility point you selected, and click the pencil icon next to the hook you created.
  4. Update the hook using the Hook Editor, and click the disk icon to save.

Use the Management API

Make a POST call to the Create a Hook endpoint. Be sure to replace MGMT_API_ACCESS_TOKEN, HOOK_NAME, HOOK_SCRIPT, and EXTENSIBILITY_POINT_NAME placeholder values with your Management API , Hook name, Hook script, and extensibility point name, respectively.
curl --request POST \
  --url 'https://{yourDomain}/api/v2/hooks' \
  --header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --data '{ "name": "HOOK_NAME", "script": "HOOK_SCRIPT", "triggerId": "EXTENSIBILITY_POINT_NAME" }'
ValueDescription
MGMT_API_ACCESS_TOKENAccess Token for the Management API with the create:hooks. To learn more, read Management API Access Tokens.
HOOK_NAMEName of the Hook to create.
HOOK_SCRIPTScript that contains the code for the Hook. Should match what you would enter if you were creating a new Hook using the Dashboard.
EXTENSIBILITY_POINT_NAMEName of the extensibility point for which the Hook should execute. Options include: credentials-exchange, pre-user-registration, post-user-registration, post-change-password. To learn more about extensibility points, read Extensibiity Points.

Handle rate limits when calling APIs from within Hooks

If you call Auth0 APIs from within a Hook’s script, you will need to handle rate limits. To do so, check the X-RateLimit-Remaining header and act appropriately when the number returned nears 0.Additionally, add logic to handle cases in which you exceed the provided rate limits and receive the 429 HTTP Status Code (Too Many Requests). In this case, if a re-try is needed, it is best to allow for a back-off to avoid going into an infinite retry loop.
To learn more about Auth0 rate limiting for Hooks, read Rate Limits.

Learn more