メインコンテンツへスキップ
PATCH
/
hooks
/
{id}
TypeScript
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.hooks.update("id", {});
}
main();
{
  "triggerId": "<string>",
  "id": "00001",
  "name": "hook",
  "enabled": true,
  "script": "module.exports = function(client, scope, audience, context, cb) cb(null, access_token); };",
  "dependencies": {}
}

承認

Authorization
string
header
必須

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

パスパラメータ

id
string
必須

ID of the hook to update.

Pattern: ^[A-Za-z0-9-]*$

ボディ

name
string
デフォルト:my-hook

Name of this hook.

Pattern: ^[a-zA-Z0-9]([ \-a-zA-Z0-9]*[a-zA-Z0-9])?$
script
string
デフォルト:module.exports = function(client, scope, audience, context, cb) cb(null, access_token); };

Code to be executed when this hook runs.

Minimum string length: 1
enabled
boolean
デフォルト:false

Whether this hook will be executed (true) or ignored (false).

dependencies
object

Dependencies of this hook used by webtask server.

レスポンス

Hook successfully created.

triggerId
string

Trigger ID

id
string
デフォルト:00001

ID of this hook.

name
string
デフォルト:hook

Name of this hook.

enabled
boolean
デフォルト:true

Whether this hook will be executed (true) or ignored (false).

script
string
デフォルト:module.exports = function(client, scope, audience, context, cb) cb(null, access_token); };

Code to be executed when this hook runs.

dependencies
object

Dependencies of this hook used by webtask server.