Create an L2 Segment

POST/v1/l2_segments

A new L2 Segment can be created by performing a POST request to /v1/l2_segments. The parameters described below have to be filled in.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

FieldDetails
name?
string

A name cannot have more than 255 characters.

type
string

Value in: "private", "public"

The type determines if an L2 Segment is in the private or public network.

location_group_id?
integer

A unique identifier of the L2 Segment's location group. To list all location group IDs, go to the relevant request. Do not confuse with Location IDs.

array<object>

Specify servers to add to this L2 Segment. Expand members to see attributes of objects.

id - a unique identifier of a server;

mode - a mode of a server's connection in an L2 Segment: native - a server can take part only in one segment, or trunk - a server can be a member of several segments simultaneously.

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

application/json

curl -X POST "https://example.com/v1/l2_segments" \  -H "Content-Type: application/json" \  -d '{    "name": "name938",    "type": "public",    "location_group_id": 77,    "members": [      {        "id": "xkazxOdJ",        "mode": "native"      },      {        "id": "w9aA9pav",        "mode": "native"      }    ],    "labels": {      "environment": "production",      "service": "my-web-app",      "example.com/project": "my-project",      "example.com/owner": "my-team"    }  }'
{  "id": "J0dNk6eL",  "name": "name939",  "type": "public",  "status": "pending",  "location_group_id": 78,  "location_group_code": "location2039",  "labels": {    "environment": "production",    "service": "my-web-app",    "example.com/project": "my-project",    "example.com/owner": "my-team"  },  "updated_at": "2026-05-28T07:01:17Z",  "created_at": "2026-05-28T07:01:17Z"}