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
List firewall rules Get all firewall rules for a server that the user owns or has subuser access to.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
Response data field | Type | Description |
|---|---|---|
data | FirewallRule[] |
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
Create firewall rule Create a new firewall rule for a server that the user owns or has subuser access to.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
Request body: FirewallRuleCreateRequest (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
remote_ip | string | yes | IP address or CIDR |
server_port | integer | yes | Allocated port (1-65535) |
priority | integer | no | Rule priority (0-10000) |
type | string | yes | |
protocol | string | no |
Response data field | Type | Description |
|---|---|---|
data | FirewallRule |
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}
Update firewall rule Update an existing firewall rule for a server that the user owns or has subuser access to.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
ruleId | path | integer | yes | Firewall rule ID |
Request body: FirewallRuleUpdateRequest (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
remote_ip | string | no | IP address or CIDR |
server_port | integer | no | Allocated port (1-65535) |
priority | integer | no | Rule priority (0-10000) |
type | string | no | |
protocol | string | no |
Response data field | Type | Description |
|---|---|---|
data | FirewallRule |
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}
Delete firewall rule Delete a firewall rule for a server that the user owns or has subuser access to.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
ruleId | path | integer | yes | Firewall 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}
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.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
port | path | integer | yes | Server port |
Response data field | Type | Description |
|---|---|---|
data | FirewallRule[] |
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
Sync firewall rules Manually sync firewall rules for a server to iptables.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuidShort | path | string | yes | Server short UUID |
Response data field | Type | Description |
|---|---|---|
message | string |
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