DeluxHostAPI Reference
Firewall

Create a protection rule

POST
/v1/firewall/rules

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.

Authorization

apiToken firewall:write
headerAuthorizationBearer <token>

A personal API token: Authorization: Bearer dh_live_…. See Authentication for scopes.

Scope: firewall:write

Request Body

application/json
  1. body
ip*string

One of your addresses.

applicationId*integer

id from GET /v1/firewall/applications.

port*integer
Range1 <= value <= 65535
maxConnections?integer
Range1 <= value <= 65534
maxConnectionsAction?string

What to do past maxConnections.

Value in"drop""cookie"
maxPacketSize?integer
Range0 <= value <= 1500
maxPacketNum?integer

Packets per second.

Range0 <= value <= 65534
maxBytes?integer

Bytes per second.

Range0 <= value <= 65534

Response Body

The panel accepted the rule. It is queued, not yet enforced.

application/json
  1. response
ok*boolean
curl -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}'
Example Response
{  "ok": true}