Skip to main content
GET
Get campaign stats
Progress counters for one campaign, plus the diagnostic fields that answer “why is nothing happening right now”. Counts are computed live at request time, not read from a cache, so they always agree with GET /campaigns/{id}/leads. Required scope: campaigns:read.

Path parameters

There is no query parameter and no request body.

Response fields

Contact statuses in leads_by_status

pending, scheduled, dialing and awaiting_disposition are the live states. When all four reach zero the campaign auto-completes.

Reading last_tick_result

This is the field to check first when a running campaign appears idle. Most values are normal pacing, not faults. If last_tick_at is more than a few minutes old on a running campaign, the campaign is not being evaluated at all — that is an infrastructure problem rather than a configuration one.

Example request

Example response

attempts_total exceeds completed_success + exhausted because retries count as attempts: with max_attempts: 3, one contact can contribute up to three.

Errors

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Path Parameters

id
string<uuid>
required

Response

Campaign stats

Live progress for one campaign, plus the engine's own account of what it last did. When a running campaign appears to be doing nothing, last_tick_result and last_error are the fields that explain it.

campaign_id
string<uuid>
status
string

Same value as Campaign.status.

pause_reason
string | null

Same value as Campaign.pause_reason: why it is paused, or null.

leads_by_status
object

Contact counts keyed by CampaignContact.status. Statuses with no contacts are omitted.

Example:
leads_total
integer
attempts_total
integer

Every dial attempt this campaign has made, including platform-side retries.

attempts_in_flight
integer

Attempts not yet settled — dialing, live, or awaiting classification.

calls_today
integer

Calls handed to the queue in the current day window.

max_calls_per_day
integer
spent_cents
integer
reserved_cents
integer
estimate_cents
integer | null
budget_cents
integer | null
last_tick_at
string<date-time> | null
last_tick_result
string | null

Machine-readable reason the last evaluation admitted, or did not admit, a call. blocked means another operation held this campaign during that evaluation and it is retried on the next one.

last_error
string | null
company_id
string<uuid>