Create a protection rule
Creates a rule from one of the presets in GET /v1/firewall/applications.
The response carries no rule. The panel accepts the request and applies it in the
background, without returning an id: the new rule appears in GET /v1/firewall/rules as
creating and becomes working on its own. Poll that if you need to know it took effect.
Not idempotent, and there is no idempotency key in v1. A repeated identical rule is
refused by the panel as a duplicate — a 400, not a silent success. Read the rule list
before retrying a call whose response you never saw.
The advanced fields are only meaningful on the Custom application; the presets carry
their own tuning and ignore them.
apiToken firewall:writeAuthorizationBearer <token>A personal API token: Authorization: Bearer dh_live_…. See Authentication for scopes.
Scope: firewall:write
application/json- body
ip*stringOne of your addresses.
applicationId*integerid from GET /v1/firewall/applications.
port*integer1 <= value <= 65535maxConnections?integer1 <= value <= 65534maxConnectionsAction?stringWhat to do past maxConnections.
"drop""cookie"maxPacketSize?integer0 <= value <= 1500maxPacketNum?integerPackets per second.
0 <= value <= 65534maxBytes?integerBytes per second.
0 <= value <= 65534The panel accepted the rule. It is queued, not yet enforced.
application/json- response
ok*booleancurl -X POST 'https://api.deluxhost.net/v1/firewall/rules' \ -H "Authorization: Bearer $DELUXHOST_TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "ip": "string", "applicationId": 0, "port": 1}'{ "ok": true}List protection rules GET
Ten per page, the panel's own page size. `state` is `working` once the rule is enforced; a rule you just created is `creating`, and one being removed is `delete`.
Delete a protection rule DELETE
`ip` is required. Rule ids are a global sequence upstream, so the rule is checked to exist **for that address** before anything is deleted; anything else is a `404`. Removing a rule does not take the address offline — it falls back to the network's default filtering. Recreating it is one `POST` away, which is why this is the one thing a token is allowed to delete.