Replace all firewall rules in group
Replaces all firewall rules within a specified firewall group with the provided set of rules in a single atomic operation, instead of creating or deleting rules one by one.
Replaces all firewall rules within a specified firewall group with the provided set of rules in a single atomic operation, instead of creating or deleting rules one by one.
Any virtual machine using this firewall group will need to be synchronized after replacing rules; pass the "sync" parameter to trigger synchronization immediately.
API Token authentication
Firewall ID
9449049Synchronize the firewall group to all its virtual machines after replacing the rules
Success response
Firewall ID
65224Firewall name
HTTP and SSH onlyIs current firewall synced with VPS
false2021-09-01T12:00:00Z2021-09-01T12:00:00ZUnauthenticated response
Validation error response
Error response
PUT /api/vps/v1/firewall/{firewallId}/rules HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 103
{
"rules": [
{
"protocol": "TCP",
"port": "443",
"source": "any",
"source_detail": "351.15.24.0/24"
}
],
"sync": true
}{
"id": 65224,
"name": "HTTP and SSH only",
"is_synced": false,
"rules": [
{
"id": 24541,
"action": "accept",
"protocol": "TCP",
"port": "1024:2048",
"source": "any",
"source_detail": "any"
}
],
"created_at": "2021-09-01T12:00:00Z",
"updated_at": "2021-09-01T12:00:00Z"
}Last updated
Was this helpful?