Add, modify, or remove firewall rules for your virtual servers (VMs). Control network traffic to and from your VM, such as opening specific ports for applications or blocking unwanted traffic.
path.vmid vmid integer · min: 1 required
Example: 10000 Unique vmid identifier
Accept Example Content-Type Example action string required
· Example: ACCEPT comment string · enum required
· Example: HTTPS Secure Web HTTPS Secure Web dport string required
· Example: 443 enable integer required
· Example: 1 proto string · enum required
· Example: tcp icmp tcp udp source string required
· Example: 2001:db8::1/32 type string required
· Example: in data object required data.message string required
· Example: Firewall rule added successfully Human-readable message.
data.rule object required data.rule.action string required
· Example: ACCEPT data.rule.comment string · enum required
· Example: HTTPS Secure Web HTTPS Secure Web data.rule.dport string required
· Example: 443 data.rule.enable integer required
· Example: 1 data.rule.proto string · enum required
· Example: tcp icmp tcp udp data.rule.source string required
· Example: 2001:db8::1/32 data.rule.type string required
· Example: in data.success boolean required
· Example: true True for successful responses.
requestId string required
· Example: 2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba Unique request identifier (UUID).
success boolean required
· Example: true True for successful responses.
timestamp string required
· Example: 2026-02-10T00:00:00.000Z ISO 8601 timestamp (UTC).
https://cloud.hostup.se/api/vm/{vmid}/firewall curl -X POST "https://cloud.hostup.se/api/vm/10000/firewall" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "in",
"action": "ACCEPT",
"proto": "tcp",
"dport": "443",
"source": "2001:db8::1/32",
"comment": "HTTPS Secure Web",
"enable": 1
}' {
"success": true,
"timestamp": "2026-02-10T00:00:00.000Z",
"requestId": "2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba",
"data": {
"success": true,
"rule": {
"type": "in",
"action": "ACCEPT",
"proto": "tcp",
"dport": "443",
"source": "2001:db8::1/32",
"comment": "HTTPS Secure Web",
"enable": 1
},
"message": "Firewall rule added successfully"
}
} {
"type": "in",
"action": "ACCEPT",
"proto": "tcp",
"dport": "443",
"source": "2001:db8::1/32",
"comment": "HTTPS Secure Web",
"enable": 1
}