Skip to main content
PUT
/
api
/
v1
/
accounts
/
{accountId}
/
projects
/
{projectId}
/
security-groups
/
{securityGroupId}
Update a security group
curl --request PUT \
  --url https://api.aion.xyz/api/v1/accounts/{accountId}/projects/{projectId}/security-groups/{securityGroupId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "web-servers-sg-updated",
  "description": "Updated security group for web servers",
  "rules": [
    {
      "external_id": "sgr-existing123-v1",
      "direction": "ingress",
      "protocol": "tcp",
      "port_range_min": 8080,
      "port_range_max": 8080,
      "remote_ip_prefix": "0.0.0.0/0",
      "description": "Updated: Allow traffic on port 8080"
    },
    {
      "direction": "ingress",
      "protocol": "tcp",
      "port_range_min": 3000,
      "port_range_max": 3000,
      "remote_ip_prefix": "10.0.0.0/8",
      "description": "New rule: Allow internal API traffic"
    }
  ]
}
'
{
  "security_group": {
    "id": "sg-abc123xyz-v1",
    "account_id": "<string>",
    "project_id": "<string>",
    "name": "<string>",
    "description": "<string>",
    "status": "active",
    "metadata": {},
    "rules": [
      {
        "id": "sgr-abc123xyz-v1",
        "security_group_id": "<string>",
        "direction": "ingress",
        "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
  },
  "message": "Security group updated successfully"
}

Authorizations

Authorization
string
header
required

JWT token from authentication service

Headers

x-account-id
string

Account ID from authentication (must match path accountId)

x-user-id
string

User ID performing the action

X-Request-ID
string

Unique request ID for tracing

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$
securityGroupId
string
required

Security group external ID

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

Body

application/json
name
string

Updated security group name

Required string length: 1 - 255
description
string

Updated description

rules
object[]

Rules to create or update

metadata
object

Updated metadata

Response

Security group updated successfully

security_group
object
message
string
Example:

"Security group updated successfully"