Update firewall rule
Update a specific firewall rule from a specified firewall.
Update a specific firewall rule from a specified firewall.
Any virtual machine that has this firewall activated will lose sync with the firewall and will have to be synced again manually.
Use this endpoint to modify existing firewall rules.
API Token authentication
Firewall ID
9449049Firewall Rule ID
8941182TCPPossible values: Port or port range, ex: 1024:2048
443anyPossible values: IP range, CIDR, single IP or any
351.15.24.0/24Success response
Firewall rule ID
24541Firewall rule action
acceptPossible values: Firewall rule protocol
TCPPossible values: Firewall rule destination port: single or port range
1024:2048Firewall rule source. Can be any or custom
anyFirewall rule source detail. Can be any or IP address, CIDR or range
anyUnauthenticated response
Validation error response
Error response
PUT /api/vps/v1/firewall/{firewallId}/rules/{ruleId} HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 79
{
"protocol": "TCP",
"port": "443",
"source": "any",
"source_detail": "351.15.24.0/24"
}{
"id": 24541,
"action": "accept",
"protocol": "TCP",
"port": "1024:2048",
"source": "any",
"source_detail": "any"
}Last updated
Was this helpful?