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 "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 · Requiredstring
Customer-selected local firewall name, 1–80 characters; independent of the generated Contabo name.
rulesJSON body · Optionalobject[]
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 · Requiredstring
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) | nullOwning team ID; null for the shared system firewall.
namestringCustomer-selected name saved locally; independent of the Contabo name.
rulesarraySaved firewall rules.
serverCountnumberNumber of current-team servers attached to this firewall.