Skip to content
Letterhead Letterhead Letterhead Help Center
Admin Tools

Count contacts in a segment

GET
/api/v3/contacts/segments/{segmentId}/count
curl --request GET \
--url 'https://api.tryletterhead.com/api/v3/contacts/segments/1/count?api=true' \
--header 'Authorization: Bearer <token>'

Returns the number of contacts that currently match a segment’s criteria.

This is a company-level (v3) read. Authenticate with a company API key as a Bearer token.

Response

200 OK with an empty items array. The match count is returned in the response envelope’s total, not in items.

segmentId
required
integer

The segment’s identifier. This is the numeric id returned by List segments — not a UUID.

api
required
boolean

Set to true.

channel
string

Count only contacts subscribed to the given channel identifier (slug). Omit for the full company audience.

200 OK

Media type application/json
object
items
Array<object>
object
message
string
total
integer
Example
{
"items": [],
"message": "Segment count retrieved.",
"total": 1284
}

Still can’t find what you need? Contact support.