For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HUMAN DashboardHUMAN WebsiteRequest a Demo
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
  • User guides
    • About the Applications API
    • Getting started
    • Authentication
    • Quick reference
  • Account Defender API
  • Bot Defender API
      • GETGet custom rules
      • POSTCreate custom rule
      • GETGet rule by ID
      • PUTUpdate rule by ID
      • PATCHUpdate field by rule ID
      • DELDelete rule by ID
      • Custom rule operators and conditions
  • Credential Intelligence API
  • Code Defender API
    • Code Examples
  • Enforce API
  • PCI DSS API
LogoLogo
Login
Login
HUMAN DashboardHUMAN WebsiteRequest a Demo
Bot Defender APICustom Rules

Update field by rule ID

PATCH
/v2/botDefender/customRules/:ruleId
PATCH
/api/v2/botDefender/customRules/:ruleId
$curl -X PATCH https://console.humansecurity.com/api/v2/botDefender/customRules/a747610a-e1d6-4e50-bc60-04c8787ac7b8 \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{}'
200Updated
1{
2 "result": true,
3 "message": "success",
4 "content": {
5 "name": "string",
6 "conditions": {
7 "operator": "$or",
8 "children": [
9 {
10 "operator": "$or",
11 "children": [
12 {
13 "operator": "$eq",
14 "conditionType": "userAgent",
15 "value": "string",
16 "fieldOption": "string"
17 }
18 ]
19 }
20 ]
21 },
22 "actions": [
23 "allow"
24 ],
25 "status": "active",
26 "ruleId": "a747610a-e1d6-4e50-bc60-04c8787ac7b8",
27 "priority": 1,
28 "description": "string"
29 }
30}
Update specified custom fields for a rule based on the rule's ID.
Was this page helpful?
Previous

Delete rule by ID

Next
Built with

Authentication

AuthorizationBearer

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

Path parameters

ruleIdstringRequired

The ID for the rule. You can get this from the get custom rules endpoint or from the Portal’s Policy Settings.

Request

This endpoint expects an object.
ruleIdstringOptional
priorityintegerOptional

Range from 0 (the highest priority) to the number of rules minus 1 (the lowest priority). For example, if there are 10 rules, then the 0th rule is the highest priority while the 9th rule is the lowest priority. By default, the priority will be set to the lowest priority.

namestringOptional
descriptionstringOptional
conditionsobjectOptional

A nested object with exactly two levels.

actionslist of enumsOptional
Allowed values:
statusenumOptional
Allowed values:

Response

Success
resultboolean
messagestring
contentobject