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

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.rules.update("id", {});
}
main();
{
  "name": "rule_1",
  "id": "con_0000000000000001",
  "enabled": true,
  "script": "function (user, context, callback) {\n  callback(null, user, context);\n}",
  "order": 1,
  "stage": "login_success"
}

承認

Authorization
string
header
必須

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

パスパラメータ

id
string
必須

ID of the rule to retrieve.

Pattern: ^rul_[A-Za-z0-9]{16}$

ボディ

script
string
デフォルト:function (user, context, callback) { callback(null, user, context); }

Code to be executed when this rule runs.

Minimum string length: 1
name
string
デフォルト:my-rule

Name of this rule.

Pattern: ^[a-zA-Z0-9]([ \-a-zA-Z0-9]*[a-zA-Z0-9])?$
order
number
デフォルト:2

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

必須範囲: x >= 0
enabled
boolean
デフォルト:true

Whether the rule is enabled (true), or disabled (false).

レスポンス

Rule successfully updated.

name
string
デフォルト:rule_1

Name of this rule.

id
string
デフォルト:con_0000000000000001

ID of this rule.

enabled
boolean
デフォルト:true

Whether the rule is enabled (true), or disabled (false).

script
string
デフォルト:function (user, context, callback) { callback(null, user, context); }

Code to be executed when this rule runs.

order
number
デフォルト:1

Order that this rule should execute in relative to other rules. Lower-valued rules execute first.

stage
string
デフォルト:login_success

Execution stage of this rule. Can be login_success, login_failure, or pre_authorize.