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

Create custom rule

POST
/v2/botDefender/customRules
POST
/api/v2/botDefender/customRules
$curl -X POST https://console.humansecurity.com/api/v2/botDefender/customRules \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "string",
> "conditions": {},
> "actions": [
> "allow"
> ],
> "status": "active"
>}'
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}
Configure a custom allow or deny list rule.
Was this page helpful?
Previous

Get rule by ID

Next
Built with

Authentication

AuthorizationBearer

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

Request

This endpoint expects an object.
namestringRequired
conditionsobjectRequired

A nested object with exactly two levels.

actionslist of enumsRequired
Allowed values:
statusenumRequired
Allowed values:
ruleIdstringOptional
priorityintegerOptionalDefaults to the value corresponding to the lowest priority rule.

API returns rules between 0 (the highest priority) and the number of rules minus 1 (the lowest priority). This corresponds to the console’s rules between 1 (the highest priority) and the number of rules. For example, if there are 10 rules, then in the API, the 0th rule is the highest priority while the 9th rule is the lowest priority. This 0th rule corresponds to the 1st rule in the console. Based on this example, the default value would be 9.

descriptionstringOptional

Response

Success
resultboolean
messagestring
contentobject

Errors

400
Bad Request Error