Skip to content

Create Security Group

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": ""
}
]
}'
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
object
name
required

Name of the security group

string

Example

tir-sg-26020516370
description

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
Allowed values: inbound outbound

Example

inbound
protocol
required

Network protocol

string
Allowed values: TCP UDP All

Example

TCP
protocol_type
required

Protocol category

string
Allowed values: CustomTCP CustomUDP AllTraffic

Example

CustomTCP
network_type
required

Source/Destination network type

string
Allowed values: any manual

Example

any
ports
required

List of ports for the rule

Array<integer>

Example

[
22
]
cidr_ip

CIDR IP address (required when network_type is manual)

string
nullable

Example

1.1.1.1
cidr_subnet

CIDR subnet mask

integer
nullable

Example

32
description

Rule description

string

Example

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
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": 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"
}