Get your free beta license ↗
API operation · security group
PUT

/security/firewall/ports

First published 14 Oct 20260.2.0Unchanged since publication

Replace the firewall's list of extra open ports

Who may call it
AdministratorResellerCustomer
Token scope, any of
securityall
Answers200 OK

UrbeStack adds new extra port openings and removes those omitted from the list in a single firewall update. An empty string or array removes all extra port openings.

The API also accepts an array of entries in ports. The 2000-character limit applies after the entries are joined with a comma and a space. The API returns 400 if ports is missing, has an unsupported type, contains unsupported characters, or exceeds the limit.

As a command

Run as root on the server

Request body

JSON· 1 field
portsstring, up to 2000 charactersRequired
Comma-separated list of ports or inclusive ranges from 1 to 65535, with the lower port first in each range. TCP is the default, and you can append /udp for UDP or /tcp for TCP, as in 8080, 9000/udp, 30000-31000.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X PUT "$API/security/firewall/ports" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ports": "text"
  }'
Response · 200 OK
{
  "closed": [
    "text"
  ],
  "opened": [
    "text"
  ],
  "ports": [
    "text"
  ]
}

Errors

4 errors, each a status and a sentence
400A port is a number, or a range like 30000-31000, optionally followed by /udp
400The list is up to 2000 characters
400ports is the list of extra open ports, comma separated, empty for none
401Authentication required
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.2.0 on 14 Oct 2026.
urbestack.com/docs/api/put-security-firewall-ports/