Create an L7 Load Balancer

POST/v1/load_balancers/l7

Send a POST request to /v1/load_balancers/l7 to create a new Load Balancer. Fill in the required parameters to specify details.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

FieldDetails
name
string

Give a name to a balancer.

location_id
integer

Specify a location where you want to create a balancer. A request for location IDs is in the Location section.

cluster_id?
string

A unique identifier of a dedicated Load Balancer cluster. A Load Balancer will be created on a specified dedicated cluster. If this parameter is not mentioned, a balancer will be created in a shared cluster. A request to list cluster IDs.

network_type?
string

Value in: "public", "private"

Specify whether the balancer should use a public or private network. Accepts public or private.

store_logs?
boolean

Default: false

If you need the storing logs option, fill this parameter in with the true value.

store_logs_region_id?
integer

A cloud region ID of the cloud storage for logs. You can list all region IDs in the relevant request.

geoip?
boolean

Default: false

To enable the GeoIP feature, write true in this attribute.

array<object>

A vhost zone is a forwarding rule to be applied to a balancer.

array<object>

An upstream zone is a group of upstream servers with predefined parameters.

labels?
object

Specify labels you want to attach to the resource. Refer to the Labels section for more details.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/load_balancers/l7" \  -H "Content-Type: application/json" \  -d '{    "name": "name1717",    "location_id": 1722,    "network_type": "public",    "store_logs": true,    "store_logs_region_id": 0,    "geoip": "true",    "vhost_zones": [      {        "id": "name1718",        "ports": [          585        ],        "ssl": true,        "http2": false,        "ssl_certificate_id": "5xe7kye7",        "domains": [          "example-2152.com"        ],        "location_zones": [          {            "location": "/path141",            "upstream_path": "/path142",            "upstream_id": "name1719"          }        ],        "real_ip_header": {          "name": "forwarded_for",          "networks": [            "127.0.0.1/16",            "192.168.0.1/32"          ]        }      }    ],    "upstream_zones": [      {        "id": "name1719",        "upstreams": [          {            "ip": "10.0.8.4",            "port": 586,            "weight": 1          }        ]      }    ],    "labels": {      "environment": "production",      "service": "my-web-app",      "example.com/project": "my-project",      "example.com/owner": "my-team"    }  }'
{  "id": "l9avgrbG",  "name": "name1727",  "type": "l7",  "status": "in_process",  "network_type": "public",  "external_addresses": [],  "internal_addresses": [],  "location_id": 1726,  "redirect_http": false,  "geoip": true,  "geoip_enabled": true,  "store_logs": true,  "domains": [    "127.0.5.1"  ],  "vhost_zones": [    {      "ssl": true,      "http2": false,      "http2_push_preload": false,      "http_to_https_redirect": false,      "proxy_request_headers": [],      "id": "name1728",      "ports": [        597      ],      "domains": [        "127.0.5.1"      ],      "location_zones": [        {          "upstream_path": "/path146",          "location": "/path145",          "upstream_id": "name1729"        }      ],      "real_ip_header": {        "name": "forwarded_for",        "networks": [          "127.0.0.1/16",          "192.168.0.1/32"        ]      },      "ssl_certificate_id": "WPe9mBeL"    }  ],  "upstream_zones": [    {      "method": "random.least_conn",      "hc_interval": 5,      "hc_jitter": 5,      "hc_fails": 1,      "hc_passes": 3,      "grpc": false,      "sticky": true,      "ssl": false,      "hc_path": "/",      "hc_method": "GET",      "id": "name1729",      "hc_domain": "127.0.5.1",      "upstreams": [        {          "ip": "10.0.8.4",          "port": 598,          "weight": 1,          "max_conns": 63000,          "max_fails": 0,          "fail_timeout": 30,          "status": "unknown"        }      ]    }  ],  "labels": {    "environment": "production",    "service": "my-web-app",    "example.com/project": "my-project",    "example.com/owner": "my-team"  },  "cluster_id": null,  "shared_cluster": true,  "created_at": "2025-12-31T00:00:00Z",  "updated_at": "2025-12-31T00:00:00Z"}