Add a new firewall rule to a VPS instance
curl --request POST \
--url https://api.storiza.store/vps/{vmId}/firewall/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"port": "<string>",
"source": "<string>",
"destination": "<string>",
"action": "allow",
"comment": "<string>",
"enabled": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
port: '<string>',
source: '<string>',
destination: '<string>',
action: 'allow',
comment: '<string>',
enabled: true
})
};
fetch('https://api.storiza.store/vps/{vmId}/firewall/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.storiza.store/vps/{vmId}/firewall/rules"
payload = {
"port": "<string>",
"source": "<string>",
"destination": "<string>",
"action": "allow",
"comment": "<string>",
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"message": "Firewall rule added successfully",
"data": {
"type": "inbound",
"protocol": "tcp",
"port": "<string>",
"source": "<string>",
"destination": "<string>",
"action": "allow",
"comment": "<string>",
"enabled": true
}
}Server firewall
Add a new firewall rule to a VPS instance
Validates and appends a firewall rule to the VPS. Inbound rules may not carry a destination and outbound rules may not carry a source; ports must be a number, a range, or all, and source/destination must be an IPv4 address, a CIDR, or all. Returns the rule as it was stored.
Required API key permission: vps:write
POST
/
vps
/
{vmId}
/
firewall
/
rules
Add a new firewall rule to a VPS instance
curl --request POST \
--url https://api.storiza.store/vps/{vmId}/firewall/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"port": "<string>",
"source": "<string>",
"destination": "<string>",
"action": "allow",
"comment": "<string>",
"enabled": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
port: '<string>',
source: '<string>',
destination: '<string>',
action: 'allow',
comment: '<string>',
enabled: true
})
};
fetch('https://api.storiza.store/vps/{vmId}/firewall/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.storiza.store/vps/{vmId}/firewall/rules"
payload = {
"port": "<string>",
"source": "<string>",
"destination": "<string>",
"action": "allow",
"comment": "<string>",
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"message": "Firewall rule added successfully",
"data": {
"type": "inbound",
"protocol": "tcp",
"port": "<string>",
"source": "<string>",
"destination": "<string>",
"action": "allow",
"comment": "<string>",
"enabled": true
}
}Authorizations
An API key from the Storiza dashboard (API & Integrations), sent as Authorization: Bearer stz_….
Path Parameters
Minimum string length:
1Body
application/json
Was this page helpful?