For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update firewall rule

Update a specific firewall rule from a specified firewall.

Update firewall rule

put

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.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
firewallIdintegerRequired

Firewall ID

Example: 9449049
ruleIdintegerRequired

Firewall Rule ID

Example: 8941182
Body
protocolstring · enumRequiredExample: TCPPossible values:
portstringRequired

Port or port range, ex: 1024:2048

Example: 443
sourcestring · enumRequiredExample: anyPossible values:
source_detailstringRequired

IP range, CIDR, single IP or any

Example: 351.15.24.0/24
Responses
200

Success response

application/json
idintegerOptional

Firewall rule ID

Example: 24541
actionstring · enumOptional

Firewall rule action

Example: acceptPossible values:
protocolstring · enumOptional

Firewall rule protocol

Example: TCPPossible values:
portstringOptional

Firewall rule destination port: single or port range

Example: 1024:2048
sourcestringOptional

Firewall rule source. Can be any or custom

Example: any
source_detailstringOptional

Firewall rule source detail. Can be any or IP address, CIDR or range

Example: any
put/api/vps/v1/firewall/{firewallId}/rules/{ruleId}
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?