Firewall Rules

Create and manage firewall rules through the API.

Firewall rules are nested under domains. See Firewall Rules for detailed documentation on condition types and best practices.

List rules

GET /domains/:id/firewall

Create rule

POST /domains/:id/firewall
FieldTypeRequiredDescription
namestringYesA label for the rule
actionstringYesallow, block, or rate_limit
conditionobjectYesWhat to match (see below)
prioritynumberNoLower number = higher priority (defaults to 100)

Condition formats:

// IP address
{"type": "ip_address", "address": "1.2.3.4"}

// CIDR range
{"type": "ip_range", "cidr": "10.0.0.0/8"}

// Country (ISO 3166-1 alpha-2)
{"type": "country", "code": "CN"}

// Protocol version (Java and Geyser only)
{"type": "protocol_version", "min": 760}

// Username regex (Java and Geyser only)
{"type": "username", "pattern": "^Bot_\\d+$"}

Rate limit action:

When the action is rate_limit, include the rate in the request body:

{
  "name": "Rate limit US",
  "action": "rate_limit",
  "condition": {"type": "country", "code": "US"},
  "priority": 50,
  "rate_limit": {"max_per_second": 10}
}

Bulk import

POST /domains/:id/firewall/bulk

Import multiple rules at once. Accepts {"rules": [...]} with the same format as the create endpoint.

Update rule

PUT /domains/:id/firewall/:rid

Delete rule

DELETE /domains/:id/firewall/:rid

On this page