List security groups
GET/api/v1/security-groups
The firewalls of the account. A server goes into the default group when Create a VM names none.
Example request
curl -X GET "https://platform.serverscamp.com/api/v1/security-groups" \
-H "Authorization: Bearer $API_TOKEN"import os, requests
token = os.environ["API_TOKEN"]
r = requests.get(
f"https://platform.serverscamp.com/api/v1/security-groups",
headers={"Authorization": f"Bearer {token}"},
)
r.raise_for_status()
print(r.json())const r = await fetch(`https://platform.serverscamp.com/api/v1/security-groups`, {
method: 'GET',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}` },
});
console.log(r.status, await r.json());Answer
Status 200 with this body.
| Field | Type | Description |
|---|---|---|
| items | list of SecurityGroupResponserequired | List of security groups |
| items[].id | integerrequired | Internal ID |
| items[].sg_uuid | stringrequired | Security group UUID |
| items[].name | string, optional | User-defined name |
| items[].sg_name | string, optional | Internal name (sg-xxx format) |
| items[].description | string, optional | Group description |
| items[].created_at | stringrequired | Creation timestamp |
| items[].updated_at | stringrequired | Last update timestamp |
| total | integerrequired | Total count |
{
"items": [
{
"id": 7,
"sg_uuid": "0e9d8c7b-6a5f-4e3d-2c1b-0a9f8e7d6c5b",
"name": "default",
"sg_name": "sg-0e9d8c7b",
"description": "Default security group",
"created_at": "2026-10-20T10:00:00Z",
"updated_at": "2026-10-20T10:00:00Z"
}
],
"total": 1
}Errors
| Status | When |
|---|---|
401 | No token, or a token that is not valid |
422 | The body or a parameter is not what the operation takes |
Every operation can also answer 401 without a valid token. All errors