Update an L2 Segment
An L2 Segment can be updated by sending a PUT request to /v1/l2_segments/{l2_segment_id}. Identify a needed L2 Segment with an ID in the path parameter. You can manage members of the segment and change their modes using parameters in the body schema; in this case, API replies with the 202 code. To add a new member, list existing ones with a member to be added. To remove a member, list existing ones without a member to be deleted. To change only the name or labels, it's not necessary to fill in the members parameter; in this case, the 200 status code will be sent.
Authorization
bearerAuth In: header
Path Parameters
| Field | Details |
|---|---|
l2_segment_id | stringA unique identifier of an L2 Segment. |
Request Body
| Field | Details |
|---|---|
name? | stringA name cannot have more than 255 characters. |
array<object>Specify servers that you need to add to the L2 Segment. Existing members should be listed as well; otherwise, they will be removed from the 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
application/json
curl -X PUT "https://example.com/v1/l2_segments/YQdJ62dO" \ -H "Content-Type: application/json" \ -d '{ "name": "name925", "members": [ { "id": "MvbmMEbY", "mode": "native" }, { "id": "openNYe7", "mode": "native" } ], "labels": { "environment": "production", "service": "my-web-app", "example.com/project": "my-project", "example.com/owner": "my-team" } }'{ "id": "YQdJ62dO", "name": "name933", "type": "public", "status": "active", "location_group_id": 60, "location_group_code": "location1972", "labels": { "environment": "production", "service": "my-web-app", "example.com/project": "my-project", "example.com/owner": "my-team" }, "updated_at": "2026-05-28T07:01:08Z", "created_at": "2026-05-28T07:01:06Z"}