POST
/security_groups/
curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/security_groups/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "name": "tir-sg-26020516370", "description": "", "rules": [ { "rule_type": "inbound", "protocol": "TCP", "protocol_type": "CustomTCP", "network_type": "any", "ports": [ 22 ], "cidr_ip": "1.1.1.1", "cidr_subnet": 32, "description": "" } ]}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/security_groups/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "name": "tir-sg-26020516370", "description": "", "rules": [ { "rule_type": "inbound", "protocol": "TCP", "protocol_type": "CustomTCP", "network_type": "any", "ports": [ 22, ], "cidr_ip": "1.1.1.1", "cidr_subnet": 32, "description": "", }, ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/security_groups/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "tir-sg-26020516370", "description": "", "rules": [ { "rule_type": "inbound", "protocol": "TCP", "protocol_type": "CustomTCP", "network_type": "any", "ports": [ 22 ], "cidr_ip": "1.1.1.1", "cidr_subnet": 32, "description": "" } ] }),});console.log(await response.json());Parameters
Section titled “Parameters”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
object
name
required
Name of the security group
string
Example
tir-sg-26020516370description
Description of the security group
string
Example
rules
required
List of inbound and outbound security rules
Array<object>
object
rule_type
required
Direction of traffic
string
Example
inboundprotocol
required
Network protocol
string
Example
TCPprotocol_type
required
Protocol category
string
Example
CustomTCPnetwork_type
required
Source/Destination network type
string
Example
anyports
required
List of ports for the rule
Array<integer>
Example
[ 22]cidr_ip
CIDR IP address (required when network_type is manual)
string
Example
1.1.1.1cidr_subnet
CIDR subnet mask
integer
Example
32description
Rule description
string
Example
Responses
Section titled “Responses”Security group created 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": 201, "data": { "id": 19272, "name": "tir-sg-260205155743", "description": "", "location": "Delhi", "rules": [ { "id": 40689, "rule_type": "inbound", "protocol_type": "CustomTCP", "protocol": "TCP", "ports": [ 22 ], "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-05T10:28:04.156794Z", "updated_at": "2026-02-05T10:28:04.156805Z" } ], "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-05T10:28:04.154448Z", "updated_at": "2026-02-05T10:28:04.154467Z" }, "errors": {}, "message": "Created Successfully"}