Skip to content

Latest commit

 

History

History
92 lines (71 loc) · 3.34 KB

update.md

File metadata and controls

92 lines (71 loc) · 3.34 KB
title description topics contentType useCase v2
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.
hooks
dashboard
mgmt-api
how-to
extensibility-hooks
true

Update Hooks

You can update Hooks configured for any given extensibility point using the Dashboard or Management API.

Hooks may also be imported and exported using the Deploy Command-Line Interface (CLI) Extension.

::: note If you added a Hook Secret and want to update it, see Update Hook Secrets. :::

Rename Hooks using the Dashboard

  1. Navigate to the Hooks page in the Auth0 Dashboard, and click the gear icon next to the Hook you want to rename.
  2. Select Rename.
  3. Enter the current name and new name of the hook, then click Rename.

Rename Hooks prompt

Update Hook scripts using the Dashboard

  1. Navigate to the Hooks page in the Auth0 Dashboard, and click the pencil icon next to the Hook you want to update.

List of Hooks

  1. Update the Hook using the Hook Editor, and click the disk icon to save.

Update a Hook in the Hook Editor

Update Hooks using the Management API

  1. Make a PATCH call to the Update a Hook endpoint. Be sure to replace HOOK_ID and MGMT_API_ACCESS_TOKEN placeholder values with your hook ID and Management API Access Token, respectively.
{
	"method": "PATCH",
	"url": "https://${account.namespace}/api/v2/hooks/HOOK_ID",
	"headers": [
    	{ "name": "Content-Type", "value": "application/json" },
   		{ "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" },
    	{ "name": "Cache-Control", "value": "no-cache" }
	],
	"postData": {
      	"mimeType": "application/json",
      	"text" : "{ \"name\": \"HOOK_NAME\", \"script\": \"HOOK_SCRIPT\", \"enabled\": \"true\" }"
	}
}
Value Description
HOOK_ID ID of the hook to be updated.
MGMT_API_ACCESS_TOKEN Access Tokens for the Management API with the scope update:hooks.
HOOK_NAME Name of the hook you would like 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.

::: note The enabled property represents whether the rule is enabled (true) or disabled (false). | :::

<%= include('./_includes/_handle_rate_limits') %>

::: note Optionally, you can add secrets (such as Twilio Keys or database connection strings) to Hooks. To learn how to update secrets, see Update Hook Secrets. :::