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 }]'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/gpu/security_groups/{security_group_id}/rules/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json=[ { "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, }, ],)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/security_groups/{security_group_id}/rules/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify([ { "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 } ]),});console.log(await response.json());Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”security_group_id
required
integer
Security Group ID
Query Parameters
Section titled “Query Parameters”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
Location
Request Body
Section titled “Request Body”Media typeapplication/json
List of security group rules to update or create
Array<object>
object
id
Existing rule ID (omit for new rules)
integer
Example
40729rule_type
required
string
Example
inboundprotocol
required
string
Example
TCPprotocol_type
required
string
Example
CustomTCPnetwork_type
required
string
Example
anyports
required
Array<integer>
Example
[ 22]cidr_ip
CIDR IP (required when network_type is manual)
string
Example
1.1.1.1cidr_subnet
integer
Example
32description
string
Example
isNew
Indicates a newly added rule
boolean
Example
trueResponses
Section titled “Responses”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
cidr_subnet
integer
description
string
network_type
string
network_details
object
my_account_project_id
integer
my_account_location
string
vpc_id
integer
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"}