Update firewall rules for a VPS

Add, modify, or delete firewall rules on your virtual server (VPS). This controls incoming and outgoing traffic to protect your server. The endpoint returns a 'requestId' to track the operation in audit logs.

Path Parameters

vmid integer · min: 1 required Example

Unique vmid identifier

Query Parameters

pos string required

Headers

Accept Example
Content-Type Example

Body

required
application/json
type string · enum required
group
in
out
action string · enum required
ACCEPT
DROP
REJECT
proto string · enum required
icmp
tcp
udp
dport string required
source string required
comment string required
enable integer required

Responses

200
success boolean
timestamp string
requestId string
data object
500
error string
message string
code string
timestamp string
requestId string
PUT https://cloud.hostup.se/api/vm/{vmid}/firewall
For AI assistants
cURL
curl -X PUT "https://cloud.hostup.se/api/vm/17562/firewall?pos=string" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "group",
    "action": "ACCEPT",
    "proto": "icmp",
    "dport": "string",
    "source": "string",
    "comment": "string",
    "enable": 0
  }'
Response
{
  "success": true,
  "timestamp": "string",
  "requestId": "string",
  "data": {
    "success": true,
    "rule": {
      "type": "string",
      "action": "string",
      "proto": "string",
      "dport": "string",
      "source": "string",
      "comment": "string",
      "enable": 0
    },
    "pos": "string",
    "message": "string"
  }
}
Request Body
{
  "type": "group",
  "action": "ACCEPT",
  "proto": "icmp",
  "dport": "string",
  "source": "string",
  "comment": "string",
  "enable": 0
}