Skip to content

Update Security Group Rules

PUT
/security_groups/{security_group_id}/rules/
curl --request PUT \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/security_groups/{security_group_id}/rules/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '[
{
"id": 40729,
"rule_type": "inbound",
"protocol": "TCP",
"protocol_type": "CustomTCP",
"network_type": "any",
"ports": [
22
],
"cidr_ip": "1.1.1.1",
"cidr_subnet": 32,
"description": "",
"isNew": true
}
]'
security_group_id
required
integer

Security Group ID

project_id
required
integer

Project ID

active_iam
integer

Active IAM ID (To access contact person account) Find your Active IAM ID here

location
required
string
Allowed values: Delhi Chennai

Location

Media typeapplication/json

List of security group rules to update or create

Array<object>
object
id

Existing rule ID (omit for new rules)

integer
nullable

Example

40729
rule_type
required
string
Allowed values: inbound outbound

Example

inbound
protocol
required
string
Allowed values: TCP UDP All

Example

TCP
protocol_type
required
string
Allowed values: CustomTCP CustomUDP AllTraffic

Example

CustomTCP
network_type
required
string
Allowed values: any manual

Example

any
ports
required
Array<integer>

Example

[
22
]
cidr_ip

CIDR IP (required when network_type is manual)

string
nullable

Example

1.1.1.1
cidr_subnet
integer
nullable

Example

32
description
string

Example

isNew

Indicates a newly added rule

boolean
nullable

Example

true

Security group fetched successfully

Media typeapplication/json
object
code
integer
data
object
id
integer
name
string
description
string
location
string
rules
Array<object>
object
id
integer
rule_type
string
protocol_type
string
protocol
string
ports
Array<integer>
cidr_ip
string
nullable
cidr_subnet
integer
description
string
network_type
string
network_details
object
my_account_project_id
integer
nullable
my_account_location
string
nullable
vpc_id
integer
nullable
created_at
string format: date-time
updated_at
string format: date-time
is_ssh_security_group
boolean
is_active
boolean
created_by
object
id
integer
name
string
email
string
username
string
attached_services
object
notebook
Array
inference_service
Array
distributed_job
Array
is_ssh_port_enabled
boolean
created_at
string format: date-time
updated_at
string format: date-time
errors
object
message
string

Example

{
"code": 200,
"data": {
"id": 19293,
"name": "tir-sg-26020516370",
"description": "",
"location": "Delhi",
"rules": [
{
"id": 40737,
"rule_type": "inbound",
"protocol_type": "CustomUDP",
"protocol": "UDP",
"ports": [
2000
],
"cidr_ip": null,
"cidr_subnet": 32,
"description": "",
"network_type": "any",
"network_details": {},
"my_account_project_id": null,
"my_account_location": null,
"vpc_id": null,
"created_at": "2026-02-05T11:13:04.204445Z",
"updated_at": "2026-02-05T11:13:04.204461Z"
}
],
"is_ssh_security_group": false,
"is_active": true,
"created_by": {
"id": 9266,
"name": "Sahil Verma",
"email": "sahil+new@e2enetworks.com",
"username": "sahil+new@e2enetworks.com"
},
"is_ssh_port_enabled": true,
"created_at": "2026-02-05T11:08:08.327727Z",
"updated_at": "2026-02-05T11:08:08.327751Z"
},
"errors": {},
"message": "Success"
}