Skip to main content

List All Segments

Retrieve a paginated list of segments defined in your workspace.


Endpoint

GET https://api.campaignlark.com/v1/segments

Query Parameters

ParameterTypeRequiredDefaultDescription
pageintegeroptional1Page number.
limitintegeroptional50Items per page (1–100).

Sample Request

GET https://api.campaignlark.com/v1/segments?page=1&limit=50

Response

Success — 200 OK

{
"data": {
"segments": [
{
"id": 1,
"name": "Active Subscribers",
"filters": {
"condition": "AND",
"filters": [
{
"type": "field",
"field_id": 1,
"operator": "eq",
"value": "test@example.com"
}
]
},
"contact_count": 1500,
"last_calculated_at": "2026-04-09T02:00:00Z",
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-04-09T02:00:00Z"
}
],
"pagination": {
"current_page": 1,
"per_page": 50,
"total_pages": 1,
"total_count": 1
}
}
}

Segment Object

FieldTypeDescription
idintegerUnique identifier for the segment.
namestringDisplay name of the segment.
filtersobjectThe segment's filter configuration. See Create Segment for the full filter schema.
contact_countintegerNumber of contacts currently in the segment.
last_calculated_atstring | nullRFC 3339 timestamp of the last segment recalculation. null if never calculated.
created_atstringRFC 3339 timestamp of when the segment was created.
updated_atstringRFC 3339 timestamp of the last update.

Pagination Object

FieldTypeDescription
current_pageintegerThe current page number.
per_pageintegerNumber of items per page.
total_pagesintegerTotal number of pages.
total_countintegerTotal number of segments.