Skip to content

Create Load Balancer Backend Group

POST
/gateway/{gateway_id}/target-groups/
curl --request POST \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/gateway/{gateway_id}/target-groups/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"name": "api-pool",
"backend_type": "raw_ip",
"algorithm": "ROUND_ROBIN",
"port": 80,
"protocol": "HTTP",
"health_check_config": {
"protocol": "HTTP",
"path": "/healthz"
},
"request_timeout_seconds": 300,
"retry_attempts": 0,
"targets": [
{
"ip_address": "203.0.113.10",
"port": 8080,
"weight": 1,
"name": "web-1"
}
]
}'

Creates a backend group: a named set of backends with its own port, protocol, health check, timeout and retries. On an HTTP, HTTPS or gRPC Load Balancer a group gets no traffic until a Rule sends traffic to it. Needs the Create permission for Load Balancers.

gateway_id
required
integer

Load Balancer 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
object
name
required

The group’s name, up to 255 characters, not used by another group of this Load Balancer.

string

Example

api-pool
backend_type

What kind of backend the group holds; every backend in it must be of this kind. Defaults to raw_ip. autoscale is for HTTP and HTTPS Load Balancers only.

string
Allowed values: vm inference autoscale raw_ip

Example

raw_ip
algorithm

How requests are spread across the group: ROUND_ROBIN, LEAST_REQUEST, LEAST_CONNECTION, RANDOM or SOURCE_IP_HASH (the same client address always reaches the same backend). null or left out uses the Load Balancer’s algorithm.

string
nullable

Example

ROUND_ROBIN
port

The port the group’s backends listen on, 1 to 65535. Defaults to 80.

integer

Example

80
protocol

HTTP, HTTPS or GRPC, up to 16 characters. Defaults to HTTP.

string

Example

HTTP
health_check_config

How the group’s backends are checked. An empty object {} uses the Load Balancer’s own health check.

object
protocol

TCP, HTTP or GRPC.

string

Example

HTTP
path

Path to request. For HTTP only. Defaults to /.

string

Example

/healthz
expected_statuses

Status codes that count as healthy. For HTTP only. Defaults to [200].

Array<integer>
interval_seconds

Seconds between checks. Defaults to 10.

integer

Example

10
timeout_seconds

Seconds to wait for an answer. Defaults to 3.

integer

Example

3
healthy_threshold

Passed checks in a row before an unhealthy backend gets traffic again. Defaults to 2.

integer

Example

2
unhealthy_threshold

Failed checks in a row before a backend stops getting traffic. Defaults to 3.

integer

Example

3

Example

{
"protocol": "HTTP",
"path": "/healthz"
}
request_timeout_seconds

Seconds a request to the group may take before it fails. A whole number, 0 or more; null or left out keeps the default.

integer
nullable

Example

300
retry_attempts

How many times a failed request is sent again. A whole number; 0 turns retries off.

integer
nullable

Example

0
targets

The backends of the group. On update the list replaces the group’s backends, so a backend left out is removed. The same backend and port may appear once per group.

Array<object>
object
id

ID of a backend already in the group, to keep it and change it. Leave out for a new one.

integer

Example

31
ip_address

IPv4 or IPv6 address. Required when backend_type is raw_ip.

string

Example

203.0.113.10
port

Port the backend listens on, 1 to 65535. Defaults to the group’s port.

integer

Example

8080
weight

Share of the group’s traffic this backend gets, relative to the others: a whole number, 0 or more. Defaults to 1.

integer

Example

1
name

A label, up to 255 characters.

string

Example

web-1
resource_ref

Required for vm, inference and autoscale: the VM’s name, the inference ID, or the Auto Scaling Group’s pool name.

string

Example

web-01

Example

[
{
"ip_address": "203.0.113.10",
"port": 8080,
"weight": 1,
"name": "web-1"
}
]

The backend group that was created

Media typeapplication/json
object
code
integer
message
string
data
object
id
integer
name

The group’s name.

string
backend_type

What kind of backend the group holds.

string
Allowed values: vm inference autoscale raw_ip
algorithm

How requests are spread across the group. null uses the Load Balancer’s algorithm.

string
nullable
port

The port the group’s backends listen on.

integer
protocol

HTTP, HTTPS or GRPC.

string
health_check_config

How the group’s backends are checked. An empty object {} uses the Load Balancer’s own health check.

object
protocol

TCP, HTTP or GRPC.

string
path

Path to request. For HTTP only. Defaults to /.

string
expected_statuses

Status codes that count as healthy. For HTTP only. Defaults to [200].

Array<integer>
interval_seconds

Seconds between checks. Defaults to 10.

integer
timeout_seconds

Seconds to wait for an answer. Defaults to 3.

integer
healthy_threshold

Passed checks in a row before an unhealthy backend gets traffic again. Defaults to 2.

integer
unhealthy_threshold

Failed checks in a row before a backend stops getting traffic. Defaults to 3.

integer
request_timeout_seconds

Seconds a request to the group may take. null when not set.

integer
nullable
retry_attempts

Times a failed request is sent again. null when not set.

integer
nullable
targets

The backends of the group, in the order they were added.

Array<object>
object
id
integer
ip_address
string
nullable
port
integer
weight
integer
name
string
nullable
resource_ref

Set for vm, inference and autoscale backends.

string
nullable
created_at
string
updated_at
string
errors
object

Example

{
"code": 201,
"message": "Created Successfully",
"data": {
"id": 7,
"name": "api-pool",
"backend_type": "vm",
"algorithm": "ROUND_ROBIN",
"port": 80,
"protocol": "HTTP",
"health_check_config": {
"protocol": "HTTP",
"path": "/healthz",
"interval_seconds": 10
},
"request_timeout_seconds": 300,
"retry_attempts": 0,
"targets": [
{
"id": 31,
"ip_address": "203.0.113.10",
"port": 8080,
"weight": 1,
"name": "web-1",
"resource_ref": null
}
],
"created_at": "2026-10-21T11:17:29Z",
"updated_at": "2026-10-21T11:17:29Z"
},
"errors": {}
}

A field is wrong or the group could not be saved. errors is a message, or an object keyed by field, each holding a list of messages (non_field_errors for a check across fields): “A raw-IP target-group member requires ‘ip_address’.”, “A VM target-group member requires ‘resource_ref’ (the VM/pool name).”, “An inference target-group member requires ‘resource_ref’ (the inference id).”, “An autoscale target-group member requires ‘resource_ref’ (the autoscale group’s pool name).”, “Inference ‘’ was not found in this project.”, “Autoscale group ‘’ was not found in this project.”, “Autoscale-group backends are supported on L7 (HTTP/HTTPS) load balancers only.”, “Duplicate backend ‘’ on port in this group — each backend:port may appear once per group.”, “An L4 load balancer supports a single target group. Remove the existing group first.”, a field message such as “This field is required.” or “Ensure this value is less than or equal to 65535.”, or, for a name already used, the database’s own message. The same 400 is returned, with the project’s own text, when project_id is missing or not a number.

Media typeapplication/json
object
code
integer
message
string
data
object
errors
object

Example

{
"code": 400,
"message": "Bad Request",
"data": {},
"errors": {
"non_field_errors": [
"Duplicate backend '203.0.113.10' on port 8080 in this group — each backend:port may appear once per group."
]
}
}

No Load Balancer with that ID in the project and region.

Media typeapplication/json
object
code
integer
message
string
data
object
errors
string

Example

{
"code": 404,
"message": "Bad Request",
"data": {},
"errors": "Gateway not found"
}