Skip to documentation
DocumentationAPI referenceCreate a firewall
POSTBearer token

Create a firewall

/api/v1/firewalls/create

Save a team firewall and its rules locally. The first server binding creates or reuses the Contabo firewall and syncs the rules.

Before you call

If the result is unclear, list firewalls before creating another one.

Request example

cURL
curl "https://tovahub.com/api/v1/firewalls/create" -X POST \
  -H "Authorization: Bearer $TOVAHUB_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{
  "name": "my-firewall",
  "requestKey": "docs_example_001",
  "rules": []
}'

Examples only. No requests are sent from this page.

Parameters

nameJSON body · Required

string

Customer-selected local firewall name, 1–80 characters; independent of the generated Contabo name.

rulesJSON body · Optional

object[]

Optional list of up to 64 active accept rules. Each rule requires displayName (1–255 chars), protocol (tcp, udp, icmp or empty string), destPorts (up to 15 ports/ranges, 0–65535), srcCidr.ipv4 (up to 100 IPs/CIDRs or AnyIPv4), srcCidr.ipv6 (up to 100 IPs/CIDRs or AnyIPv6), action: accept and status: active. At least one source list must be nonempty. TCP/UDP need ports; ICMP needs no ports.

requestKeyJSON body · Required

string

8–100 characters: A–Z, a–z, 0–9, underscore or hyphen. Keep the same key and identical input when retrying the same operation.

Response

HTTP status 200

Return the firewall saved in TOVA.

_idstring (ObjectId)

Local firewall identifier.

teamIdstring (ObjectId) | null

Owning team ID; null for the shared system firewall.

namestring

Customer-selected name saved locally; independent of the Contabo name.

rulesarray

Saved firewall rules.

serverCountnumber

Number of current-team servers attached to this firewall.