Run in Apidog
Create or replace the IPv4 firewall plan for this VPS and apply or remove it. Sending the full rules array replaces all existing rules. An empty rules array removes the plan from the VPS and deletes it. IPv4 only.
Request Add parameter in header API-key
Example: API-key: ********************
or
Body Params application/json Required
{
"enabled" : true ,
"default_policy" : "DROP" ,
"rules" : [
{ "direction" : "OUT" , "decision" : "ACCEPT" , "protocol" : "TCP" , "port" : "ALL" , "source_ip" : "0.0.0.0/0" } ,
{ "direction" : "IN" , "decision" : "ACCEPT" , "protocol" : "TCP" , "port" : "22,80,443" , "source_ip" : "0.0.0.0/0" }
]
} Request Code Samples
curl --location --request PUT 'https://mijn.host/api/v2/vps/12345/firewall' \
--header 'Accept: application/json' \
--header 'User-Agent: my-application/1.0.0' \
--header 'API-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true,
"default_policy": "DROP",
"rules": [
{ "direction": "OUT", "decision": "ACCEPT", "protocol": "TCP", "port": "ALL", "source_ip": "0.0.0.0/0" },
{ "direction": "IN", "decision": "ACCEPT", "protocol": "TCP", "port": "22,80,443", "source_ip": "0.0.0.0/0" }
]
}' Responses application/json
Generate Code
{
"status" : 200 ,
"status_description" : "Firewall updated." ,
"data" : {
"enabled" : true ,
"default_policy" : "DROP" ,
"rules" : [
{ "direction" : "OUT" , "decision" : "ACCEPT" , "protocol" : "TCP" , "port" : "ALL" , "source_ip" : "0.0.0.0/0" } ,
{ "direction" : "IN" , "decision" : "ACCEPT" , "protocol" : "TCP" , "port" : "22,80,443" , "source_ip" : "0.0.0.0/0" }
] ,
"locked" : null
}
}
Modified at 2026-09-07 15:03:25