Skip to main content
POST
/
security-groups
/
{id}
/
rules
Add a firewall rule
curl --request POST \
  --url https://console.cloudblast.io/api/v2/security-groups/{id}/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "inbound",
  "action": "ACCEPT",
  "protocol": "tcp",
  "source": "0.0.0.0/0",
  "destination": "<string>",
  "source_port": "<string>",
  "destination_port": "443",
  "comment": "Allow HTTPS",
  "priority": 0
}
'
{
  "data": {
    "id": 1,
    "type": "inbound",
    "action": "ACCEPT",
    "protocol": "tcp",
    "source": null,
    "destination": null,
    "source_port": null,
    "destination_port": "80,443",
    "comment": "Allow HTTP/HTTPS",
    "priority": 0
  }
}

Authorizations

Authorization
string
header
required

API token from your CloudBlast account settings. Pass as Authorization: Bearer <token>.

Path Parameters

id
integer
required

Security group ID

Body

application/json
type
enum<string>
required
Available options:
inbound,
outbound
Example:

"inbound"

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

"ACCEPT"

protocol
string
required

Protocol (e.g., tcp, udp, icmp)

Maximum string length: 20
Example:

"tcp"

source
string | null

Source IP/CIDR

Example:

"0.0.0.0/0"

destination
string | null

Destination IP/CIDR

source_port
string | null

Source port or range

Maximum string length: 50
destination_port
string | null

Destination port or range (e.g., 80, 8000:9000, 80,443)

Maximum string length: 50
Example:

"443"

comment
string | null

Optional description

Example:

"Allow HTTPS"

priority
integer | null

Rule priority (lower = higher priority). Defaults to 0.

Required range: x >= 0
Example:

0

Response

Firewall rule created

data
object