Skip to main content
PATCH
/
waap
/
v1
/
domains
/
{domain_id}
/
firewall-rules
/
{rule_id}
Update a firewall rule
curl --request PATCH \
  --url https://api.gcore.com/waap/v1/domains/{domain_id}/firewall-rules/{rule_id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Block foobar bot",
  "description": "<string>",
  "enabled": true,
  "action": {
    "allow": {},
    "block": {
      "action_duration": "12h"
    }
  },
  "conditions": [
    {}
  ]
}
'
{
  "type": "http-bad-request",
  "title": "Bad Request",
  "status": 400,
  "detail": "Invalid domain name: ''''"
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

domain_id
integer
required

The domain ID

rule_id
integer
required

The firewall rule ID

Body

application/json
name
string | null

The name assigned to the rule

Required string length: 1 - 100
Pattern: ^[A-Za-z0-9\s.:'";<>?&|\\]+$
Example:

"Block foobar bot"

description
string | null

The description assigned to the rule

Maximum string length: 100
enabled
boolean | null

Whether or not the rule is enabled

action
FirewallRuleAction · object

The action that the rule takes when triggered

conditions
FirewallRuleCondition · object[] | null

The condition required for the WAAP engine to trigger the rule.

Required array length: 1 element

Response

Successful Response