Preview a segment

Preview a segment

GET/api/v1/segments/{id}/preview

GET /segments/{id}/preview
curl -X GET 'https://www.unitpost.com/api/v1/segments/seg_123/preview' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "segment_preview",
  "segment_id": "segment_123",
  "archived": false,
  "member_count": 1,
  "subscribed_count": 1,
  "sample": [
    {
      "id": "id_123",
      "email": "customer@example.com",
      "first_name": "string",
      "last_name": "string"
    }
  ]
}

How many contacts a saved segment reaches: its members, the subscribed set a campaign would mail (0 means a campaign would send nothing), and a sample (which also needs contacts:read). Requires the segments:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields6 fields
FieldTypeDescription
objectrequiredstring—
segment_idrequiredstring | nullThe saved segment, or null for an unsaved filter.
archivedrequiredboolean | nullWhether the saved segment is archived (a campaign can't target it); null for an unsaved filter.
member_countrequiredintegerContacts that match (or are members).
subscribed_countrequiredintegerOf those, the ones a campaign would mail: not unsubscribed. 0 means an empty send.
samplerequiredobject[]Up to 3 of the subscribed set. Empty without `contacts:read`.
200401403404422

Search docs and guides

Search the docs and product guides.