Skip to main content
POST
/
api
/
segments
/
count
Get Count of Users in Include and Exclude Segment
curl --request POST \
  --url https://api.embedreach.com/api/segments/count \
  --header 'Content-Type: application/json' \
  --data '
{
  "includeSegments": [
    "<string>"
  ],
  "excludeSegments": [
    "<string>"
  ],
  "automationId": "<string>",
  "search": "<string>",
  "limit": 100,
  "filter": "all",
  "cursor": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "count": 123,
    "recipients": [
      {
        "firstName": "<string>",
        "lastName": "<string>",
        "email": "<string>",
        "phone": "<string>",
        "id": "<string>",
        "externalId": "<string>",
        "emailOptedOut": true,
        "smsOptedOut": true
      }
    ],
    "pagination": {
      "hasNextPage": true,
      "cursor": "<string>"
    }
  }
}

Headers

reach-tenant-id
string

If using a platform scoped JWT, you can pass in a header to impersonate a specific tenant to impersonate the request as.

Body

application/json
includeSegments
string[]

The segments to include

excludeSegments
string[]

The segments to exclude

automationId
string

The id of the automation

Search query to filter recipients by name, email, or phone

limit
number
default:100

Maximum number of recipients to return (defaults to 100 for performance)

Required range: 1 <= x <= 1000
filter
enum<string>
default:all

Filter recipients by contact method: all, email, or phone

Available options:
all,
email,
phone
cursor
string

Cursor for pagination (from previous response)

Response

Status 200 response

success
boolean
required
message
string
data
object