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

# Update Hooks

> Learn how to update Hooks using the Dashboard or Management API. Hooks may also be imported and exported using the Auth0 Deploy Command-Line Interface (CLI) tool.

> [!WARNING]
>
> **Hooks will reach end of life (EOL) on April 30, 2027.**
>
> * As of October 16, 2023, Hooks are no longer available in newly created tenants.
> * As of November 18, 2024, Hooks are read-only. Active Hooks still run, and you can enable or disable them and change their configuration values and secrets. You can't edit their code in the Dashboard, the Management API, or tools that use it, such as the Auth0 CLI, Deploy CLI, Terraform, and Agent Skills.
> * **After April 30, 2027, Hooks stop running and are removed.**

**Use Actions to extend Auth0:**

* To learn more about Actions, read [Understand How Auth0 Actions Work](/docs/docs/customize/actions/actions-overview).
* To migrate, read [Migrate from Hooks to Actions](/docs/docs/customize/actions/migrate/migrate-from-hooks-to-actions).

You can update Hooks using the Dashboard or Management API (Management API: A product to allow customers to perform administrative tasks.).

You can also import and export hooks using the [Deploy Command-Line Interface (CLI) tool](/docs/docs/deploy-monitor/deploy-cli-tool).

Optionally, you can add secrets (such as Twilio Keys or database connection strings) to hooks.

## Rename hooks using the Dashboard

1. Go to [Auth0 Dashboard > Auth Pipeline > Hooks](https://manage.auth0.com/#/) and click the gear icon next to the hook you want to rename.
2. Click **Rename**.
3. Type a new name for the Hook and click **Rename**.

   ![Auth0 Rename Hooks](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/2Xp8Z3uYGoGZrF5EGXLPLQ/6c68c77f97133b2066219a68540b1e73/Screen_Shot_2021-05-19_at_12.08.00_PM.png)

## Update hook scripts using the Dashboard

1. Go to [Auth0 Dashboard > Auth Pipeline > Hooks](https://manage.auth0.com/#/) and click the pencil icon next to the hook you want to update.

   ![Auth0 Hooks select a Hook](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/2y2R713TkAvQWIMZPMd1zh/bf0a657261f2d090492660ea5962e0a3/dashboard-hooks-list.png)
2. Update the hook using the Hook Editor and click the disk icon to save.

   ![Auth0 Hook Editor](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/26u71QdXxZxg5zIH8SJQAg/e9bbd25b99d9b8fd44c281b6de83a5a3/dashboard-hooks-edit_menu.png)

## Update hooks using the Management API

Make a `PATCH` call to the [Update a Hook endpoint](/docs/docs/api/management/v2/#!/Hooks/patch_hooks_by_id). Be sure to replace `HOOK_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your Hook ID and Management API Access Token (Access Token: Authorization credential, in the form of an opaque string or JWT, used to access an API.), respectively.

Using the Auth0 CLI? If you haven't already, [set up and authenticate your CLI session](/docs/docs/deploy-monitor/auth0-cli) before running this command.

| Value | Description |
| - | - |
| `HOOK_ID` | ID of the Hook to update. |
| `MGMT_API_ACCESS_TOKEN` | Access Tokens for the Management API with the [scope](/docs/docs/glossary?term=scope) `update:hooks`. To learn more, read [Management API Access Tokens](/docs/docs/secure/tokens/access-tokens/management-api-access-tokens). |
| `HOOK_NAME` | Name of the Hook to create. |
| `HOOK_SCRIPT` | Script that contains the code for the Hook. Should match what you would enter if you were creating a new hook using the Dashboard. |

The `enabled` property represents whether the rule is enabled (`true`) or disabled (`false`).

> [card] 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.
