Skip to Content
APINetworksSecurity GroupsList Security Groups

List security groups

Retrieve security groups and their rules.

Security groups control inbound and outbound traffic to your instances.


Endpoint

GET /v1/security_groups

Example

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

FieldTypeDescription
idstringUnique security group ID
namestringSecurity group name
descriptionstringDescription
rulesarrayList of rules

Rule

FieldTypeDescription
idstringRule ID
directionstringingress or egress
protocolstringtcp, udp, icmp, or all
portnumberPort (for single-port rules)
cidrstringCIDR 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