API Documentation

Get Firewall Status

Returns the current firewall status and all rules for a VPS. Firewall management is performed via SSH (supports ufw and firewalld).

Request

GET /api/v1/vps/{id}/firewall

Required scope: vps:manage

Path Parameters

Parameter Type Description
id string The VPS ID

Headers

Header Required Value
Authorization Yes Bearer YOUR_API_KEY

Response

{
  "data": {
    "tool": "ufw",
    "active": true,
    "defaultIncoming": "deny",
    "defaultOutgoing": "allow",
    "rules": [
      {
        "port": "22",
        "proto": "tcp",
        "action": "allow",
        "source": "any"
      },
      {
        "port": "80",
        "proto": "tcp",
        "action": "allow",
        "source": "any"
      },
      {
        "port": "443",
        "proto": "tcp",
        "action": "allow",
        "source": "any"
      }
    ],
    "readViaSSH": true
  }
}

Response Fields

Field Type Description
tool string Firewall tool detected (ufw, firewalld, or none)
active boolean Whether the firewall is currently active
defaultIncoming string Default policy for incoming traffic
defaultOutgoing string Default policy for outgoing traffic
rules array List of firewall rules
rules[].port string Port or port range (e.g. 80, 8000:8100)
rules[].proto string Protocol: tcp, udp, or both
rules[].action string allow or deny
rules[].source string Source IP or any
readViaSSH boolean Whether the status was read via SSH

Errors

Status Code Description
404 NOT_FOUND VPS not found or not accessible
502 FIREWALL_ERROR Firewall operation failed on the server

Example

curl "https://site.quest/api/v1/vps/699cdea2ab57a244bb5273fd/firewall" \
  -H "Authorization: Bearer YOUR_API_KEY"

MCP

This data is also available via the get_firewall MCP tool.