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
| Parameter | Type | Required | Description |
|---|---|---|---|
segment_id | integer | required | The ID of the segment to retrieve contacts for. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | optional | Page number for pagination. Defaults to 1. |
limit | integer | optional | Number 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
| Field | Type | Description |
|---|---|---|
id | string | Unique contact ID |
status | string | Contact status. One of SUBSCRIBED, UNSUBSCRIBED, UNCONFIRMED, BOUNCED, COMPLAINED. |
tags | array | Tags assigned to the contact. Each item has id (integer) and name (string). |
data | object | Key-value map of contact field values, keyed by merge_tag. |
statistics | object | Engagement statistics — total_opens, total_clicks, total_bounces, total_delivered. |
last_opened_at | string | null | RFC 3339 timestamp of the last email open. |
last_clicked_at | string | null | RFC 3339 timestamp of the last link click. |
created_at | string | RFC 3339 timestamp of contact creation. |
updated_at | string | RFC 3339 timestamp of last update. |