View .md

Firewall endpoints (Client API: game servers)

6 FeatherPanel Client API: game servers endpoints from user/server/firewall.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Last synced from FeatherPanel 15b94e9 on .

On this page

Defined in backend/app/routes/user/server/firewall.php. Authentication used here: Server access. Read Authentication for how to send credentials and Rate limits and errors for the response envelope.

Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.

Endpoints

GET/api/user/servers/{uuidShort}/firewall

Auth: Server accessDefault rate limit: 30 / minute (user-server-firewall)Route name: user-server-firewall-listController: ServerFirewallController::listRulesroute source

List firewall rules Get all firewall rules for a server that the user owns or has subuser access to.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
Response data fieldTypeDescription
dataFirewallRule[]
curl -X GET "$PANEL_URL/api/user/servers/$UUID_SHORT/firewall" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Firewall rules retrieved successfully · 400 Bad request · 401 Unauthorized · 403 Forbidden · 404 Server not found · 500 Internal server error

POST/api/user/servers/{uuidShort}/firewall

Auth: Server accessRoute name: user-server-firewall-createController: ServerFirewallController::createRuleroute source

Create firewall rule Create a new firewall rule for a server that the user owns or has subuser access to.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID

Request body: FirewallRuleCreateRequest (application/json)

Body fieldTypeRequiredDescription
remote_ipstringyesIP address or CIDR
server_portintegeryesAllocated port (1-65535)
priorityintegernoRule priority (0-10000)
typestringyes
protocolstringno
Response data fieldTypeDescription
dataFirewallRule
curl -X POST "$PANEL_URL/api/user/servers/$UUID_SHORT/firewall" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"remote_ip":"","server_port":0,"priority":0,"type":"","protocol":""}'

Plugin events: featherpanel:server:update

Responses: 201 Firewall rule created successfully · 400 Bad request · 401 Unauthorized · 403 Forbidden · 404 Server or node not found · 500 Internal server error

PUT/api/user/servers/{uuidShort}/firewall/{ruleId}

Auth: Server accessDefault rate limit: 10 / minute (user-server-firewall)Route name: user-server-firewall-updateController: ServerFirewallController::updateRuleroute source

Update firewall rule Update an existing firewall rule for a server that the user owns or has subuser access to.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
ruleIdpathintegeryesFirewall rule ID

Request body: FirewallRuleUpdateRequest (application/json)

Body fieldTypeRequiredDescription
remote_ipstringnoIP address or CIDR
server_portintegernoAllocated port (1-65535)
priorityintegernoRule priority (0-10000)
typestringno
protocolstringno
Response data fieldTypeDescription
dataFirewallRule
curl -X PUT "$PANEL_URL/api/user/servers/$UUID_SHORT/firewall/$RULE_ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"remote_ip":"","server_port":0,"priority":0,"type":"","protocol":""}'

Plugin events: featherpanel:server:update

Responses: 200 Firewall rule updated successfully · 400 Bad request · 401 Unauthorized · 403 Forbidden · 404 Server or rule not found · 500 Internal server error

DELETE/api/user/servers/{uuidShort}/firewall/{ruleId}

Auth: Server accessDefault rate limit: 10 / minute (user-server-firewall)Route name: user-server-firewall-deleteController: ServerFirewallController::deleteRuleroute source

Delete firewall rule Delete a firewall rule for a server that the user owns or has subuser access to.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
ruleIdpathintegeryesFirewall rule ID
curl -X DELETE "$PANEL_URL/api/user/servers/$UUID_SHORT/firewall/$RULE_ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Plugin events: featherpanel:server:update

Responses: 200 Firewall rule deleted successfully · 400 Bad request · 401 Unauthorized · 403 Forbidden · 404 Server or rule not found · 500 Internal server error

GET/api/user/servers/{uuidShort}/firewall/port/{port}

Auth: Server accessDefault rate limit: 30 / minute (user-server-firewall)Route name: user-server-firewall-by-portController: ServerFirewallController::getRulesByPortroute source

Get firewall rules by port Get all firewall rules for a specific port on a server that the user owns or has subuser access to.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
portpathintegeryesServer port
Response data fieldTypeDescription
dataFirewallRule[]
curl -X GET "$PANEL_URL/api/user/servers/$UUID_SHORT/firewall/port/$PORT" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Firewall rules for port retrieved successfully · 400 Bad request · 401 Unauthorized · 403 Forbidden · 404 Server not found · 500 Internal server error

POST/api/user/servers/{uuidShort}/firewall/sync

Auth: Server accessDefault rate limit: 5 / minute (user-server-firewall)Route name: user-server-firewall-syncController: ServerFirewallController::syncRulesroute source

Sync firewall rules Manually sync firewall rules for a server to iptables.

ParameterInTypeRequiredDescription
uuidShortpathstringyesServer short UUID
Response data fieldTypeDescription
messagestring
curl -X POST "$PANEL_URL/api/user/servers/$UUID_SHORT/firewall/sync" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Plugin events: featherpanel:server:update

Responses: 200 Firewall rules synced successfully · 400 Bad request · 401 Unauthorized · 403 Forbidden · 404 Server or node not found · 500 Internal server error