Skip to main content
POST
/
servers
/
{server}
/
firewall
Create firewall rule
curl --request POST \
  --url https://rdp.sh/api/v1/servers/{server}/firewall \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "action": "ACCEPT",
  "type": "in",
  "proto": "<string>",
  "dport": "<string>",
  "sport": "<string>",
  "source": "<string>",
  "dest": "<string>",
  "comment": "<string>",
  "enable": true
}
'
{
  "status": true,
  "message": "<string>"
}

Authorizations

Authorization
string
header
required

Path Parameters

server
string
required

Body

application/json
action
enum<string>
required

Rule action

Available options:
ACCEPT,
DROP,
REJECT
type
enum<string>
required

Traffic direction

Available options:
in,
out
proto
string

Protocol (tcp, udp, icmp, etc.)

dport
string

Destination port(s)

sport
string

Source port(s)

source
string

Source IP/CIDR

dest
string

Destination IP/CIDR

comment
string

Rule comment

Maximum string length: 255
enable
boolean

Whether rule is enabled

Response

Firewall rule created successfully.

status
boolean
message
string