Add or modify firewall rules for your VPS

Configure firewall rules for your virtual server (VPS). Specify incoming traffic, protocols, ports, and source addresses to protect your server. This API returns a 'requestId' to track your request status.

Path Parameters

vmid integer · min: 1 required Example

Unique vmid identifier

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
POST https://cloud.hostup.se/api/vm/{vmid}/firewall
For AI assistants
cURL
curl -X POST "https://cloud.hostup.se/api/vm/11284/firewall" \
  -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
    },
    "message": "string"
  }
}
Request Body
{
  "type": "group",
  "action": "ACCEPT",
  "proto": "icmp",
  "dport": "string",
  "source": "string",
  "comment": "string",
  "enable": 0
}