Create an L2 Segment
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 In: header
Request Body
| Field | Details |
|---|---|
name? | stringA name cannot have more than 255 characters. |
type | stringValue in: The type determines if an L2 Segment is in the |
location_group_id? | integerA 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
| |
labels? | objectSpecify 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"}