v52

latestOpenAPI 3.0.0raw.githubusercontent.com2026-08-03269339953.6 KB
VPS: Firewall

Update firewall rule

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.

put/api/vps/v1/firewall/{firewallId}/rules/{ruleId}

Path parameters

firewallIdinteger required
Example:9449049

Firewall ID

ruleIdinteger required
Example:8941182

Firewall Rule ID

Request body

protocol'TCP' | 'UDP' | 'ICMP' | 'GRE' | 'any' | 'ESP' | 'AH' | 'ICMPv6' | 'SSH' | 'HTTP' | 'HTTPS' | 'MySQL' | 'PostgreSQL' required
portstring required

Port or port range, ex: 1024:2048

source'any' | 'custom' required
source_detailstring required

IP range, CIDR, single IP or any

Example request

{
  "protocol": "TCP",
  "port": "443",
  "source": "any",
  "source_detail": "351.15.24.0/24"
}

Response

Success response

idinteger

Firewall rule ID

action'accept' | 'drop'

Firewall rule action

protocol'TCP' | 'UDP' | 'ICMP' | 'GRE' | 'any' | 'ESP' | 'AH' | 'ICMPv6' | 'SSH' | 'HTTP' | 'HTTPS' | 'MySQL' | 'PostgreSQL'

Firewall rule protocol

portstring

Firewall rule destination port: single or port range

sourcestring

Firewall rule source. Can be any or custom

source_detailstring

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

Example response

{
  "id": 24541,
  "action": "accept",
  "protocol": "TCP",
  "port": "1024:2048",
  "source": "any",
  "source_detail": "any"
}