Update an L2 Segment

PUT/v1/l2_segments/{l2_segment_id}

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
AuthorizationBearer <token>

In: header

Path Parameters

l2_segment_id*string

A unique identifier of an L2 Segment.

Request Body

application/json

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"}
{  "id": "46dBBXd7",  "name": "name925",  "type": "public",  "status": "pending",  "location_group_id": 56,  "location_group_code": "location1932",  "labels": {    "environment": "production",    "service": "my-web-app",    "example.com/project": "my-project",    "example.com/owner": "my-team"  },  "updated_at": "2026-05-28T07:01:02Z",  "created_at": "2026-05-28T07:01:00Z"}
{  "message": "Rescue mode is active on \"\"\\nOS reinstallation is running on \"\"",  "code": "L2_OPERATION_UNAVAILABLE"}
{  "message": "Validation failed",  "code": "UNPROCESSABLE_ENTITY",  "errors": {    "members.0.id": "server has no public network feature"  }}