List L2 Segments

GET/v1/l2_segments

A GET request sent to /v1/l2_segments will show a list of all the L2 Segments within your account.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

FieldDetails
label_selector?
string

This parameter will filter results by labels. More details in the Labels section.

per_page?
integer

Default: 20

Range: 1–100

The number of results [ 1 .. 100 ] displayed on a page. By default, 20 results are shown.

page?
integer

Default: 1

Min: 1

The number of a page (>= 1) that will be returned. By default, it's 1.

sorting?
string

Value in: "id", "created_at", "updated_at"

Default: "id"

This parameter sorts items. By default, it's id.

direction?
string

Value in: "ASC", "DESC"

Default: "ASC"

This parameter defines if items are sorted in an ascending ASC or descending DESC order. By default, ASC is set up.

Response Body

application/json

curl -X GET "https://example.com/v1/l2_segments"
[  {    "id": "X7axk9ey",    "name": "name1351",    "type": "public",    "status": "active",    "location_group_id": 50,    "location_group_code": "location2756",    "labels": {      "environment": "production",      "service": "my-web-app",      "example.com/project": "my-project",      "example.com/owner": "my-team"    },    "updated_at": "2025-12-31T00:00:00Z",    "created_at": "2025-12-31T00:00:00Z"  },  {    "id": "zPdyP7bQ",    "name": "name1352",    "type": "public",    "status": "active",    "location_group_id": 50,    "location_group_code": "location2756",    "labels": {      "environment": "production",      "service": "my-web-app",      "example.com/project": "my-project",      "example.com/owner": "my-team"    },    "updated_at": "2025-12-31T00:00:00Z",    "created_at": "2025-12-31T00:00:00Z"  },  {    "id": "xkazpYdJ",    "name": "name1353",    "type": "public",    "status": "active",    "location_group_id": 50,    "location_group_code": "location2756",    "labels": {      "environment": "production",      "service": "my-web-app",      "example.com/project": "my-project",      "example.com/owner": "my-team"    },    "updated_at": "2025-12-31T00:00:00Z",    "created_at": "2025-12-31T00:00:00Z"  }]