API Reference

Create one rule or a batch

Enabled per organisation

This endpoint answers 403 until our staff enable the Firewall API flag on your organisation, and its ability cannot be granted to a key before then. Open a ticket saying what you intend to build — see Activation.
POST
/rules

Send a single rule object, or {rules: [...]} for a batch. Each item reports created, exists or error; atomic: true makes the batch all-or-nothing. A batch of more than sync_max_items (4) rules must set mode: async and is answered 202 with a job to poll; a request carries at most max_batch_size (1000) rules. A ttl (seconds, in the batch body or as ?ttl= for a single rule) makes the rules ephemeral: they are removed when it runs out unless bumped via POST /rules/{ref}/bump.

Authorization

BearerAuth firewall.manage
AuthorizationBearer <token>

Your organisation API key: Authorization: Bearer tbk_...

In: header

Scope: firewall.manage

Query Parameters

mode?string

Value in

  • "sync"
  • "async"
ttl?integer
Range1 <= value <= 31536000

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/rules" \  -H "Content-Type: application/json" \  -d '{    "rules": [      {        "kind": "ip",        "destination": {          "ip": "207.174.40.5"        }      }    ]  }'
{  "data": {    "kind": "ip",    "destination": {      "ip": "207.174.40.5",      "port": 27015    },    "source": {      "ip": "0.0.0.0",      "port": 0    },    "protocol": "any",    "action": "deny",    "ref": "string",    "id": 0,    "expires_at": "string"  }}