Skip to main content
Every campaign exposes a live stats endpoint and links each call attempt back to a conversation. Use the stats to watch progress in aggregate, and use the per-contact attempts to drill into individual transcripts and recordings.

Campaign stats

Fetch a snapshot of contact and attempt counts for a campaign.
curl https://api.anyreach.ai/campaign/campaigns/{campaign_id}/stats \
  -H "Authorization: Bearer <token>" \
  -H "X-Anyreach-Org: <organization_id>"
Requires the campaigns:read or campaigns:manage scope. The X-Anyreach-Org header is only needed for user PATs (pat_); org API keys (ak_) carry their org implicitly. The response groups contacts by lifecycle bucket and reports attempt totals plus current concurrency:
{
  "campaign_id": "...",
  "status": "active",
  "contacts": {
    "total": 1240,
    "pending": 310,
    "in_progress": 8,
    "completed": 902,
    "exhausted": 20
  },
  "attempts": {
    "total": 1730,
    "average_per_contact": 1.39
  },
  "active_calls": 8,
  "concurrency_limit": 10
}

Response fields

FieldTypeDescription
campaign_idstringThe campaign this snapshot belongs to.
statusstringCurrent campaign status (for example active).
contacts.totalintegerSum of all contacts across buckets.
contacts.pendingintegerContacts not yet attempted.
contacts.in_progressintegerContacts currently being dialed (includes locked and in-progress contacts).
contacts.completedintegerContacts that reached a terminal completed state.
contacts.exhaustedintegerContacts that ran out of retry attempts.
attempts.totalintegerTotal call attempts made across all contacts.
attempts.average_per_contactnumberattempts.total divided by contacts.total, rounded to two decimals. 0.0 when there are no contacts or attempts.
active_callsintegerCalls in flight at the moment of the request.
concurrency_limitintegerThe org-level cap on simultaneous calls. Defaults to 10 when no org setting exists.
active_calls and concurrency_limit together tell you how much headroom the campaign has. When active_calls reaches concurrency_limit, the dialer waits for a call to finish before starting the next one. See Dialing and retries.

Live polling

The campaign Overview tab calls the stats endpoint on load and then polls it every 5 seconds while the campaign status is active and the browser tab is visible. Polling stops when the tab is hidden or the campaign is no longer active, and resumes when the tab becomes visible again. Use the refresh control to fetch on demand at any time.

Attempts and conversations

Each call attempt links to a conversation through its conversation_id. List a campaign’s contacts to see their attempts:
curl "https://api.anyreach.ai/campaign/campaigns/{campaign_id}/contacts?limit=50&offset=0" \
  -H "Authorization: Bearer <token>" \
  -H "X-Anyreach-Org: <organization_id>"
limit defaults to 50 (max 200) and offset defaults to 0. Pass status to filter contacts by bucket. Each contact carries an attempts array, and every attempt includes:
FieldTypeDescription
idstringAttempt identifier.
contact_idstringThe contact this attempt belongs to.
phone_numberstringThe number dialed for this attempt.
conversation_idstring | nullThe linked conversation, or null if no conversation was created.
started_atdatetimeWhen the attempt started.
ended_atdatetime | nullWhen the attempt ended, if finished.
statusstringThe attempt’s status.
resultobject | nullPer-conversation evaluation outcomes (see below).

Conversation outcomes

When an attempt produced a conversation, the contacts list enriches that attempt with its evaluation outcome. For each attempt with a conversation_id, the server looks up completed evaluation runs for that conversation and populates the attempt’s result object, keyed by <metric_key>.<criterion_key>. Attempts whose conversation has no completed evaluation, or no conversation at all, leave result as null. To review the full transcript and recording for any attempt, open the linked conversation by its conversation_id in Conversations.

Conversations

Read transcripts and listen to recordings for every linked conversation.

Dialing and retries

Understand how attempts, retries, and concurrency drive the stats buckets.