Preview a segment
The live count for a segment definition without saving it: how many contacts match now, how many of those are subscribed (who a campaign would reach),…
https://app.usenotix.dev/api/v1/contactBooks/{contactBookId}/segments/previewNeeds a full access key. Sending access keys cannot call this. Key permissions lists the extra rules some calls have.
The live count for a segment definition without saving it: how many contacts match now, how many of those are subscribed (who a campaign would reach), any problems that make it match nothing, and up to 5 matching contacts. Use it to show the audience before a campaign binds to a segment. Nothing is written.
Path parameters
Body parameters
One of 1.
One of all, any.
Headers
Bearer followed by your API key.
Errors
The definition is not valid, or names a campaign or journey the team does not have.
No contact book with this id for the calling team.
The definition took longer than 10 seconds to evaluate.
Every error has the same shape. See all error codes.
curl -X POST "https://app.usenotix.dev/api/v1/contactBooks/<contactBookId>/segments/preview" \
-H "Authorization: Bearer $NOTIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"definition": {
"version": 1,
"match": "all",
"conditions": [
{
"type": null,
"match": null,
"conditions": null
}
]
}
}'
{
"contactBookId": "cm1x8f3k20001qz7v5b9d2e4a",
"count": 1,
"subscribedCount": 1,
"problems": [
"string"
],
"sample": [
{
"id": "cm1x8f3k20001qz7v5b9d2e4a",
"email": "customer@example.com",
"firstName": "Acme",
"lastName": "Acme",
"subscribed": true
}
]
}