List security groups
Retrieve security groups and their rules.
Security groups control inbound and outbound traffic to your instances.
Endpoint
GET /v1/security_groupsExample
cURL
curl https://api.redu.cloud/v1/security_groups \
-H "x-api-key: YOUR_API_KEY"Successful response
{
"items": [
{
"id": "1c62ad45-128d-45d9-b164-6cefdf5e8739",
"name": "default",
"description": "Allow SSH, HTTP, and HTTPS access",
"rules": [
{
"id": "rule_01",
"direction": "ingress",
"protocol": "tcp",
"port": 22,
"cidr": "0.0.0.0/0"
},
{
"id": "rule_02",
"direction": "egress",
"protocol": "all"
}
]
}
],
"next_cursor": null
}Fields
Security group
| Field | Type | Description |
|---|---|---|
| id | string | Unique security group ID |
| name | string | Security group name |
| description | string | Description |
| rules | array | List of rules |
Rule
| Field | Type | Description |
|---|---|---|
| id | string | Rule ID |
| direction | string | ingress or egress |
| protocol | string | tcp, udp, icmp, or all |
| port | number | Port (for single-port rules) |
| cidr | string | CIDR range (e.g. 0.0.0.0/0) |
Errors
401 Unauthorized
{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}403 Forbidden
The API key does not have access to the requested resource.
Last updated on