Skip to content
gist.link ↗

previewAudience

Query Campaigns API — POST https://campaigns.api.gist.link/graphql

Live-compiles the given structured query against its data source and returns a small sample of matching contacts plus an estimated total count — the core “query layer” preview used by the audience builder UI. Any org member.

campaigns:query:previewAudience

The calling IAM key must hold this permission (or a wildcard that covers it: campaigns:query:* or campaigns:*) and the access token must have been minted with audience=campaigns. See Permissions.

type Query {
previewAudience(query: JSON!, first: Int): AudiencePreview!
}
Argument Type Required Description
query JSON! Yes —
first Int No —

AudiencePreview! — see the Campaigns types reference.

Terminal window
curl https://campaigns.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "query PreviewAudience($query: JSON!, $first: Int) { previewAudience(query: $query, first: $first) { estimatedCount exactCount } }",
"variables": {
"query": {},
"first": 10
}
}
JSON