Skip to content

Get VPS firewall options

GET /api/v2/vps/{id}/firewall/options

Get whether the VPS firewall is on and what happens to incoming traffic that matches no rule. platformFilteringInbound is true when the firewall is on and unmatched traffic is kept out. Only traffic that matches an allow rule then reaches the VPS. source: "fallback" and available: false mean the live state could not be read. The values are then defaults, not the real state. Change the options with PUT /api/v2/vps/{id}/firewall/options.

Authentication: An API key with the scope read:vm. About keys and scopes

Request

Path parameters

idstringrequired
The VPS ID (vps_…).

Example

GET /api/v2/vps/{id}/firewall/options
curl "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/firewall/options" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 Firewall options.

Response 200
{
"enabled": true,
"inboundPolicy": "DROP",
"platformFilteringInbound": true,
"available": true,
"reason": null,
"source": "live",
"mode": "enabled_restrictive",
"summary": "Firewall protection is on. Incoming traffic must match an allow rule to pass.",
"detail": "Traffic that does not match an allow rule is blocked on our side before it reaches the VM.",
"actions": {
"canUpdate": {
"allowed": true,
"reason": null
}
}
}
Response fields
enabledboolean
The firewall’s main switch. It is true on a new VPS even while protection is off. platformFilteringInbound says whether incoming traffic is filtered.
inboundPolicystring
What happens to incoming traffic that matches no rule. ACCEPT lets it in. DROP discards it. REJECT refuses it. One of ACCEPT, DROP, REJECT.
platformFilteringInboundboolean
True when the firewall is on and incoming traffic that matches no rule is kept out.
availableboolean
Whether the live state could be read.
reasonstring or null
Why the state is unavailable. Null when it is available.
sourcestring or null
live when read from the VPS now. fallback when the live state could not be read and defaults are shown.
modestring or null
disabled, enabled_allow_all (on and unmatched traffic still gets in) or enabled_restrictive (on and only allowed traffic gets in).
summarystring or null
The state in one sentence.
detailstring or null
What the state means for incoming traffic.
actionsobject
What you can do with the options now.
canUpdateobject
Whether the options can be changed now.
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is vps_not_found.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.