Skip to main content
GET
/
api
/
v1
/
accounts
/
{accountId}
/
projects
/
{projectId}
/
security-groups
List security groups
curl --request GET \
  --url https://api.aion.xyz/api/v1/accounts/{accountId}/projects/{projectId}/security-groups \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.aion.xyz/api/v1/accounts/{accountId}/projects/{projectId}/security-groups"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.aion.xyz/api/v1/accounts/{accountId}/projects/{projectId}/security-groups', 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://api.aion.xyz/api/v1/accounts/{accountId}/projects/{projectId}/security-groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.aion.xyz/api/v1/accounts/{accountId}/projects/{projectId}/security-groups"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.aion.xyz/api/v1/accounts/{accountId}/projects/{projectId}/security-groups")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.aion.xyz/api/v1/accounts/{accountId}/projects/{projectId}/security-groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "security_groups": [
    {
      "id": "sg-abc123xyz-v1",
      "account_id": "<string>",
      "project_id": "<string>",
      "name": "<string>",
      "description": "<string>",
      "metadata": {},
      "rules": [
        {
          "id": "sgr-abc123xyz-v1",
          "security_group_id": "<string>",
          "protocol": "<string>",
          "port_range_min": 123,
          "port_range_max": 123,
          "remote_ip_prefix": "<string>",
          "remote_security_group_id": "<string>",
          "icmp_type": 123,
          "icmp_code": 123,
          "priority": 123,
          "description": "<string>",
          "created_at": "2023-11-07T05:31:56Z",
          "updated_at": "2023-11-07T05:31:56Z",
          "is_deleted": true
        }
      ],
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "is_deleted": true
    }
  ],
  "next_page_token": "<string>",
  "total_count": 123,
  "message": "<string>"
}
{
"error": "Validation failed: name is required",
"code": "BAD_REQUEST"
}
{
"error": "account_id mismatch between header and path",
"code": "UNAUTHORIZED"
}
{
"error": "Internal server error",
"code": "INTERNAL_ERROR"
}

Authorizations

Authorization
string
header
required

JWT token from authentication service

Headers

x-account-id
string

Account ID from authentication (must match path accountId)

Path Parameters

accountId
string
required

Account external ID

Pattern: ^acct-[a-zA-Z0-9]+-v1$
projectId
string
required

Project external ID

Pattern: ^proj-[a-zA-Z0-9]+-v1$

Query Parameters

page_size
integer
default:50

Number of items per page (max 100)

Required range: 1 <= x <= 100
page_token
string

Token for pagination

status
enum<string>

Filter by status

Available options:
active,
pending,
error,
deleting,
deleted

Response

List of security groups

security_groups
object[]
next_page_token
string

Token for next page (empty if no more pages)

total_count
integer

Total number of security groups

message
string