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.POST
call to the Create Rule endpoint. Be sure to replace MGMT_API_ACCESS_TOKEN
, RULE_NAME
, RULE_SCRIPT
, RULE_ORDER
, and RULE_ENABLED
placeholder values with your , rule name, rule script, rule order number, and rule enabled value, respectively.
Value | Description |
---|---|
MGMT_API_ACCESS_TOKEN | Access Token for the Management API with the scope create:rules . |
RULE_NAME | Name of the rule you would like to create. The rule name can only contain alphanumeric characters, spaces, and hyphens; it may not start or end with spaces or hyphens. |
RULE_SCRIPT | Script that contains the code for the rule. Should match what you would enter if you were creating a new rule using the Dashboard. |
RULE_ORDER (optional) | Integer that represents the order in which the rule should be executed in relation to other rules. Rules with lower numbers are executed before rules with higher numbers. If no order number is provided, the rule will execute last. |
RULE_ENABLED (optional) | Boolean that represents whether the rules is enabled (true ) or disabled (false ). |
travel0.us.auth0.com
). If a request arrives from a machine that supports IPv6, then the context.request.ip
property will contain an IPv6 address. If you perform manual IP address manipulation, we suggest you use the ipaddr.js@1.9.0 library.X-RateLimit-Remaining
header and acting appropriately when the number returned nears 0. You should also add logic to handle cases in which you exceed the provided rate limits and receive the HTTP Status Code 429 (Too Many Requests); in this case, if a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. To learn more about rate limits, read Rate Limit Policy For Auth0 APIs.