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
}
'import requests
url = "https://console.cloudblast.io/api/v2/security-groups/{id}/rules"
payload = {
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://console.cloudblast.io/api/v2/security-groups/{id}/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://console.cloudblast.io/api/v2/security-groups/{id}/rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.cloudblast.io/api/v2/security-groups/{id}/rules"
payload := strings.NewReader("{\n \"type\": \"inbound\",\n \"action\": \"ACCEPT\",\n \"protocol\": \"tcp\",\n \"source\": \"0.0.0.0/0\",\n \"destination\": \"<string>\",\n \"source_port\": \"<string>\",\n \"destination_port\": \"443\",\n \"comment\": \"Allow HTTPS\",\n \"priority\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://console.cloudblast.io/api/v2/security-groups/{id}/rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"inbound\",\n \"action\": \"ACCEPT\",\n \"protocol\": \"tcp\",\n \"source\": \"0.0.0.0/0\",\n \"destination\": \"<string>\",\n \"source_port\": \"<string>\",\n \"destination_port\": \"443\",\n \"comment\": \"Allow HTTPS\",\n \"priority\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.cloudblast.io/api/v2/security-groups/{id}/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"inbound\",\n \"action\": \"ACCEPT\",\n \"protocol\": \"tcp\",\n \"source\": \"0.0.0.0/0\",\n \"destination\": \"<string>\",\n \"source_port\": \"<string>\",\n \"destination_port\": \"443\",\n \"comment\": \"Allow HTTPS\",\n \"priority\": 0\n}"
response = http.request(request)
puts response.read_body{
"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
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Missing or invalid Authorization header. Use: Authorization: Bearer <token>"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Server not found."
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid.",
"details": {
"name": [
"The name field is required."
]
}
}
}Security Groups
Add Firewall Rule
Adds a firewall rule to a security group. If the group is already deployed to Proxmox, the rule will be synced automatically.
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
}
'import requests
url = "https://console.cloudblast.io/api/v2/security-groups/{id}/rules"
payload = {
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://console.cloudblast.io/api/v2/security-groups/{id}/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://console.cloudblast.io/api/v2/security-groups/{id}/rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.cloudblast.io/api/v2/security-groups/{id}/rules"
payload := strings.NewReader("{\n \"type\": \"inbound\",\n \"action\": \"ACCEPT\",\n \"protocol\": \"tcp\",\n \"source\": \"0.0.0.0/0\",\n \"destination\": \"<string>\",\n \"source_port\": \"<string>\",\n \"destination_port\": \"443\",\n \"comment\": \"Allow HTTPS\",\n \"priority\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://console.cloudblast.io/api/v2/security-groups/{id}/rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"inbound\",\n \"action\": \"ACCEPT\",\n \"protocol\": \"tcp\",\n \"source\": \"0.0.0.0/0\",\n \"destination\": \"<string>\",\n \"source_port\": \"<string>\",\n \"destination_port\": \"443\",\n \"comment\": \"Allow HTTPS\",\n \"priority\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.cloudblast.io/api/v2/security-groups/{id}/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"inbound\",\n \"action\": \"ACCEPT\",\n \"protocol\": \"tcp\",\n \"source\": \"0.0.0.0/0\",\n \"destination\": \"<string>\",\n \"source_port\": \"<string>\",\n \"destination_port\": \"443\",\n \"comment\": \"Allow HTTPS\",\n \"priority\": 0\n}"
response = http.request(request)
puts response.read_body{
"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
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Missing or invalid Authorization header. Use: Authorization: Bearer <token>"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Server not found."
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid.",
"details": {
"name": [
"The name field is required."
]
}
}
}Authorizations
API token from your CloudBlast account settings. Pass as Authorization: Bearer <token>.
Path Parameters
Security group ID
Body
application/json
Available options:
inbound, outbound Example:
"inbound"
Available options:
ACCEPT, REJECT, DROP Example:
"ACCEPT"
Protocol (e.g., tcp, udp, icmp)
Maximum string length:
20Example:
"tcp"
Source IP/CIDR
Example:
"0.0.0.0/0"
Destination IP/CIDR
Source port or range
Maximum string length:
50Destination port or range (e.g., 80, 8000:9000, 80,443)
Maximum string length:
50Example:
"443"
Optional description
Example:
"Allow HTTPS"
Rule priority (lower = higher priority). Defaults to 0.
Required range:
x >= 0Example:
0
Response
Firewall rule created
Show child attributes
Show child attributes
⌘I