Skip to main content

List Contacts in Segment

Retrieve a paginated list of contacts belonging to a specific segment.


Endpoint

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

Path Parameters

ParameterTypeRequiredDescription
segment_idintegerrequiredThe ID of the segment to retrieve contacts for.

Query Parameters

ParameterTypeRequiredDescription
pageintegeroptionalPage number for pagination. Defaults to 1.
limitintegeroptionalNumber of contacts per page. Min 10, max 250.

Sample Request

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

Response

Success — 200 OK

{
"data": {
"contacts": [
{
"id": "64f1a2b3c4d5e6f7a8b9c0d1",
"status": "SUBSCRIBED",
"tags": [
{
"id": 1,
"name": "newsletter"
}
],
"data": {
"email_address": "joffrey@example.com",
"first_name": "Joffrey Baratheon"
},
"statistics": {
"total_opens": 12,
"total_clicks": 3,
"total_bounces": 0,
"total_delivered": 10
},
"last_opened_at": "2024-02-14T09:00:00Z",
"last_clicked_at": null,
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-02-14T09:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 1024
}
}
}

Contact Object Fields

FieldTypeDescription
idstringUnique contact ID
statusstringContact status. One of SUBSCRIBED, UNSUBSCRIBED, UNCONFIRMED, BOUNCED, COMPLAINED.
tagsarrayTags assigned to the contact. Each item has id (integer) and name (string).
dataobjectKey-value map of contact field values, keyed by merge_tag.
statisticsobjectEngagement statistics — total_opens, total_clicks, total_bounces, total_delivered.
last_opened_atstring | nullRFC 3339 timestamp of the last email open.
last_clicked_atstring | nullRFC 3339 timestamp of the last link click.
created_atstringRFC 3339 timestamp of contact creation.
updated_atstringRFC 3339 timestamp of last update.