Preview who a campaign will call
Read the audience of a campaign and preview who it matches now: audience (null when the campaign calls only the recipients added to it), summary (one plain line a rule), and preview { matched, doNotCall, willJoin, sample }, where matched counts every contact the rules match, doNotCall those on the do-not-call list, willJoin the rest, and sample up to 20 of them in phone number order. Pass audience to preview a different filter without saving it, then save it with update_campaign while the campaign is a draft. An audience picks recipients by filtering the workspace's contacts: { rules: [...] }, and every rule must hold. A rule is { kind: 'tags', op: 'any' | 'none', tags: [...] }, or { kind: 'field', key, op, ... } on a contact field (see list_contact_fields): a text field takes equals or contains with a text value (ignoring case), or is_set or is_empty; a number field takes eq, gt, gte, lt or lte with a number value; a yes or no field takes is or is_not with true or false; a choice field takes any_of with values from its options. No rules matches every contact. Numbers on the do-not-call list are always left out. The matches join the campaign as recipients when it launches, or at its scheduled start, alongside any recipients you add (one row a number; an added recipient keeps their variables), each with the contact's name and fields as variables. The list is then locked, unless autoEnroll keeps adding contacts who start to match.
Authorization
bearerAuth A personal access token from Settings > API tokens.
In: header
Path Parameters
Workspace slug (GET /me lists yours).
Query Parameters
A filter to preview in place of the saved one. Nothing is saved.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X GET "https://example.com/workspaces/string/campaigns/string/audience"{
"saved": true,
"status": "string",
"preview": {
"property1": null,
"property2": null
},
"property1": null,
"property2": null
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}Duplicate a campaign POST
Copy a campaign of any status into a new DRAFT named '<name> (copy)', with the same agent, brief, opener, caller number, calling window, voicemail, double dial, limits, dialling rules and converted outcomes, and no scheduled start. recipients picks what else comes across: none (the default, settings only), all (every recipient), or unreached (everyone the campaign didn't speak to, except recipients that were stopped or removed by a do-not-call check). Copied recipients keep their variables, notes, time zone and state, and pass the do-not-call list again. Returns the new campaign and, unless recipients is none, { inserted, skipped, suppressed, invalid }. The copy dials nothing until launch_campaign.
Get a recipient GET
Read one campaign recipient with every call, newest first, and whether the campaign counts them as converted. Each call has its attempt number, callback (true for a callback the person asked for, which uses no attempt) and redial: a double dial's second call, rung straight after an unanswered first ring, has redial true and shares the attempt number of the call before it, since it uses no attempt. Each call also has its time, result (connected, no_answer, busy, voicemail, invalid_number, failed, or calling while it rings), the carrier's hangup cause, talk time, the call's outcome and summary, whether it has a recording, and its session id for get_transcript. The recipient carries its variables, note, time zone and state, next scheduled attempt, callbackAt and callbackNote when a callback is booked (change it with set_campaign_recipient_callback), and stoppedAt when an operator stopped them. Find the recipient with list_campaign_recipients, or pass their phone number.