Skip to main content
GET
Get campaign
Returns one campaign with agent, from_phone_number and stop_dispositions expanded to the full objects they reference. Archived campaigns return 404. For progress counters (how many contacts are pending, dialing, exhausted) use GET /campaigns/{id}/stats instead — this endpoint returns configuration and engine state, not a per-contact breakdown. Required scope: campaigns:read.

Path parameters

Configuration fields

Every field below is writable via POST /campaigns and PATCH /campaigns/{id}. See the create page for ranges, defaults and guidance. A setting never sent reads null, except three that are never null: stop_disposition_ids holds the suggested stop set when POST /campaigns left it out (and [] when you sent []), variables is {}, and calling_window is {} when the campaign follows the workspace calling hours.

Read-only fields

Engine-owned. Sending any of these to POST or PATCH is a 400.

Example request

Example response

agent, from_phone_number and stop_dispositions are abbreviated above; in a real response each is the complete object. agent (and split_agent, when the campaign runs an A/B test) is the same object GET /agents/{id} returns for that agent — read the script the campaign will actually use from GET /agents/{id}/workflow, not from the campaign. Deleting a disposition that is a stop rule on an active campaign is refused — take it out of that campaign’s stop_disposition_ids first. Once a campaign is finished, deleting the disposition also drops its ID from stop_disposition_ids, so a historical campaign can show fewer stop rules than it actually ran with.

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

A paced bulk-outbound dialing job over enrolled contacts.

A campaign is an admission-only scheduler. It decides when each enrolled contact becomes eligible, then performs one ordinary outbound call — the same queue, the same priority, and the same concurrency limits as a call placed with POST /calls. The pacing fields below only control how fast a campaign hands calls to that queue; a campaign call never takes precedence over anything else.

Campaigns are always created as draft and are launched with POST /campaigns/{id}/launch.

Two independent per-contact stop conditions apply, whichever fires first: max_attempts, and the stop-disposition set (stop_disposition_ids plus the stop_on_* booleans). Landing a stop disposition retires that contact permanently; any other outcome retries until the attempt cap.

Fields marked Engine-owned are written by the campaign engine and are never writable. Sending one on create or update returns 400, as does any field name that isn't on the writable list — a misspelled stop_dispositions is rejected rather than silently ignored, so you can never believe a kill switch is armed when it is not.

id
string<uuid>
company_id
string<uuid>
name
string
Example:

"July reactivation"

description
string | null
status
enum<string>

Engine-owned. Move it with the transition endpoints (launch / pause / resume / stop), never with PATCH.

draft — created, not dialing. scheduled — not entered today. A campaign launched before its starts_at reads running and places no call until that moment. running — admitting contacts. paused — paused by you. A manual pause is never lifted automatically; it survives a top-up. paused_insufficient_credit — balance is below the minimum needed to place a call. Auto-resumes shortly after the balance is topped up. paused_budget — budget_cents reached, or the workspace's own monthly spending limit reached; pause_reason says which. paused_infra — the safeguard: one contact's call could not be placed more times than max_infra_retries allows (nobody's phone rang). Calls already under way finish normally and every contact keeps its place; nothing new is dialed until you resume. Not lifted automatically. paused_config — a permanent configuration problem (from-number no longer active, agent missing a call-duration cap, no reachable calling window). completed — every enrolled contact reached a terminal state. stopped — stopped by you. Terminal. archived — soft-deleted by DELETE /campaigns/{id}. Terminal.

Available options:
draft,
scheduled,
running,
paused,
paused_insufficient_credit,
paused_budget,
paused_infra,
paused_config,
completed,
stopped,
archived
pause_reason
enum<string> | null

Why the campaign is paused, or null when it is not. Read-only. manual (paused), insufficient_credit (paused_insufficient_credit), campaign_budget or workspace_spend_limit (both paused_budget — this campaign's budget_cents, or the workspace's monthly limit from PATCH /billing), call_placement_failures (paused_infra), configuration (paused_config).

Available options:
manual,
insufficient_credit,
campaign_budget,
workspace_spend_limit,
call_placement_failures,
configuration,
null
agent_id
string<uuid> | null

Agent that runs the calls. Required before launch.

agent
object | null

The Agent for agent_id. For a key holding agents:read it is the same object, field for field, that GET /agents/{id} returns for it. For a key without agents:read it is { id, name } only: the campaign never shows a key more of an agent than GET /agents/{id} would.

split
object | null

The A/B test on this campaign's calls, or null when every contact is called by agent_id.

percent is the share of contacts that go to the SECOND agent (agent_id inside the object). agent_id on the campaign takes the rest.

A contact is assigned once, on its first admission, and keeps that agent for every later attempt — a no-answer redial is the same conversation and not a fresh coin toss. Changing percent afterwards therefore only affects contacts that have not been dialed yet. Changing either agent, or sending null, does reach contacts already dialed: an assignment to an agent the campaign no longer runs is released, and that contact is assigned again on its next attempt. Both agents must have a maximum call duration set and be able to take calls, or launch refuses.

Both agents are screened against the do-not-call list at enrolment, so a contact is never assigned an agent that is not allowed to call it.

split_agent
object | null

The Agent for the second agent in split, read like agent: the object GET /agents/{id} returns for a key holding agents:read, { id, name } for a key without it.

from_phone_number_id
string<uuid> | null

The number the campaign calls from, when it names one. null (the default) calls from the agent's own number: a number the agent calls from (its outbound agent, or either half of the number's outbound split), else one it answers on; a Yappr number before one on your own Telnyx account. An A/B split calls from the first agent's number for both halves. A create or edit that leaves it null on an agent with no number is 400 CAMPAIGN_REQUEST_INVALID (invalid_from_number at /from_phone_number_id); at launch the number must still be active. If this number is released, the campaign calls from its agent's own number from then on.

from_phone_number
object | null

The PhoneNumber for from_phone_number_id. For a key holding phone_numbers:search it is exactly the object GET /phone-numbers returns, and only that. For a key without it, it is { id, friendly_name, number: null }: which number, and what it costs, are that scope's to show (friendly_name is null too when it spells the number). The carrier account's own plumbing (provider and order ids, SIP trunk/credential identifiers, SIP usernames and secrets) is never part of it.

from_number
string | null

Engine-owned. E.164 number the campaign calls from: from_phone_number's, or its agent's own number when from_phone_number_id is null. Written on create, edit and launch, and on every dialling round, so it follows the agent onto a new number; kept for audit even if the number is later released. null until the campaign has an agent or a number that can call, and for a key without phone_numbers:search, as from_phone_number.number is.

Example:

"+972551234567"

variables
object

Values for the agent's {{placeholders}} on every call this campaign places. FirstName and FullName are filled on each call from its contact's own name (the first word of it, and the whole of it; a household, a title or half of a given name keeps the whole name under FirstName: "משפחת כהן"); the value here is what a contact with no name hears. {} when none are set.

calling_window
object

Optional campaign-level narrowing of the workspace calling hours. Omit to inherit the workspace schedule (GET /call-windows). A campaign can only ever dial inside the workspace window — this field cannot widen it. { tz, days: [0..6], start: "HH:MM", end: "HH:MM" }. tz is an IANA zone name and is required whenever days, start or end is present: hours without a zone are ambiguous, so they are refused rather than read against a zone you did not pick. days lists each day once and is never empty; start and end come together and end is later than start (no zero-minute window, none past midnight). Anything else is 400 CAMPAIGN_REQUEST_INVALID, naming the value.

stop_disposition_ids
string<uuid>[]

Disposition IDs that retire a contact permanently when assigned — the campaign's kill switch. Always IDs, never labels: labels are renameable, and a rename would silently disarm the rule.

No Answer, Failed, Voicemail and Unclassified are refused here with 400. The platform assigns them by itself (No Answer on every unanswered ring), so listing one retires the contact the first time it lands, before any retry, and Voicemail or Unclassified can land on a call someone answered. Use stop_on_no_answer, stop_on_voicemail and stop_on_unclassified instead.

Must contain dispositions belonging to your company; anything else is rejected with 400.

stop_dispositions
object[]

Full Disposition objects for stop_disposition_ids.

stop_on_no_answer
boolean

Retire a contact the first time a call goes unanswered.

Example:

false

stop_on_voicemail
boolean

Retire a contact the first time a call reaches an answering machine.

Example:

false

stop_on_unclassified
boolean

What to do when the outcome that arrives is Unclassified — the call happened but could not be matched to any of your outcomes. false retries the contact, true retires it. This is not a timeout. A call's outcome is authoritative and a contact is never advanced without one: if classification is slow, only that contact waits while the campaign keeps calling everyone else.

Example:

false

max_attempts
integer

Per-contact dial cap. One of the two independent stop conditions — the other is the stop-disposition set.

Required range: 1 <= x <= 999
Example:

3

max_infra_retries
integer

The safeguard: how many retries one contact gets after a platform-side failure — a call that never reached the person — before the whole campaign pauses as paused_infra. A count, not money: the money limits are budget_cents and the workspace's monthly spending limit. These retries do not consume max_attempts and are never terminal.

Required range: 0 <= x <= 20
Example:

3

retry_no_answer_seconds
integer

Delay before retrying a contact who did not answer.

Required range: 30 <= x <= 604800
Example:

3600

retry_completed_seconds
integer

Delay before retrying a contact whose call completed but landed on a non-stop disposition.

Required range: 60 <= x <= 604800
Example:

86400

randomize_retry_time
boolean

Which time of day a retry lands on. false keeps the wait exact, so a one-week wait retries at the same hour a week later. true picks a different hour inside the campaign's calling window, so repeat attempts do not always arrive at the same moment. The wait length itself is unchanged either way — a randomized retry is still never earlier than the configured wait.

Example:

false

double_dial_enabled
boolean

Ring a second time shortly after an unanswered first ring.

Example:

false

double_dial_gap_seconds
integer

Gap between the two rings when double_dial_enabled is true.

Required range: 10 <= x <= 3600
Example:

90

max_calls_per_day
integer

Daily admission cap, counted against the workspace timezone day.

Required range: 1 <= x <= 100000
Example:

200

min_seconds_between_calls
integer

Minimum spacing between two calls handed to the queue by this campaign.

Required range: 0 <= x <= 86400
Example:

30

max_in_flight
integer

Calls this campaign may have live at once. Platform concurrency limits still apply on top — raising this does not buy the campaign extra capacity.

Required range: 1 <= x <= 8
Example:

2

budget_cents
integer | null

This campaign's LIFETIME spend cap, enforced against spent_cents + reserved_cents (credits are debited when a call ends, so in-flight cost has to count) plus the next call's hold: twice the agent's max_call_duration_secs, in minutes, times the per-minute rate (the highest per-minute price of any voice model, as GET /billing/rates lists them). Counted in credits: a credit is one cent. A cap below one call's hold is refused with 400 (it would pause the campaign before its first call), and launch refuses one stored before that check. null means no cap. On hit the campaign moves to paused_budget. Distinct from the workspace's calendar-month limit (monthly_budget_cents, PATCH /billing), which covers every outbound call in the workspace and resets each month: either can pause this campaign and both report paused_budget.

Required range: x >= 1
regulatory_basis
enum<string> | null

Your lawful basis for calling this list. Required before launch — recorded on the campaign's launch audit record alongside the enrolled count. lawful_basis_confirmed is what the dashboard records: a single attestation that the caller has consent or another lawful basis for everyone on the list. The four specific values are for callers that know which one applies.

Available options:
lawful_basis_confirmed,
consent,
existing_customer,
non_marketing,
registry_screened
starts_at
string<date-time> | null

No call is placed before this moment. It does not launch the campaign: a campaign launched earlier reads running and waits.

ends_at
string<date-time> | null

No new call is placed from this moment; the campaign then moves to completed. Later than starts_at, not already passed, and the calling_window must open at least once before it.

daily_admitted_count
integer

Engine-owned. Calls handed to the queue during the current day window.

daily_window_date
string<date> | null

Engine-owned. Day daily_admitted_count belongs to.

last_admitted_at
string<date-time> | null

Engine-owned. When this campaign last handed a call to the queue.

estimate_cents
integer | null

Engine-owned. Reserved for a projected campaign cost; nothing computes it yet, so it is null.

spent_cents
integer

Engine-owned. Settled spend so far.

reserved_cents
integer

Engine-owned. Worst-case cost of in-flight calls, held against budget_cents until they settle.

last_tick_at
string<date-time> | null

Engine-owned. Last time the engine evaluated this campaign.

last_tick_result
string | null

Engine-owned. Machine-readable answer to "why is nothing happening right now" — e.g. daily cap reached, outside the calling window, waiting on in-flight calls. blocked means another operation held this campaign during the last evaluation and it is retried on the next one. Full vocabulary on the campaign stats page.

last_error
string | null

Engine-owned. Last error the engine recorded for this campaign.

started_at
string<date-time> | null

Engine-owned. First launch time.

completed_at
string<date-time> | null

Engine-owned. When the last contact reached a terminal state.

total_leads
integer

Engine-owned. Contacts currently enrolled.

stats
object

Engine-owned counter roll-up. Prefer GET /campaigns/{id}/stats.

created_at
string<date-time>
updated_at
string<date-time>
created_by
string<uuid> | null

Null when the campaign was created via the API.