Skip to main content
DELETE
Archive campaign
Archives a campaign. This is a soft delete: the campaign and its history are retained for reporting, the campaign leaves the default GET /campaigns list (it is listed with ?status=archived) and stops being returned by GET /campaigns/{id}. It cannot be edited, resumed or re-launched while archived; restore it to bring it back — a draft as a draft with its contacts, a campaign that had launched as stopped. Archiving is also a stop. In one operation it:
  1. Sets the campaign’s status to archived and marks it deleted.
  2. Retires every contact that was still live (pending, scheduled, dialing, awaiting_disposition) to excluded.
  3. Cancels every call this campaign had waiting to be dialed.
Step 3 is best-effort by design: a call the dispatcher has already picked up belongs to the dispatcher and will complete normally, then settle. So archiving stops the campaign offering new calls immediately, while at most max_in_flight calls already on their way may still connect. If you need a clean stop with the campaign left readable, use POST /campaigns/{id}/stop instead. Required scope: campaigns:manage.

Path parameters

There is no request body and no query parameter. Archiving works from any status, including draft and already-terminal campaigns.

Archive or stop?

Campaign names do not have to be unique, archived or not: “Follow-up” is a fine name for this month’s and last month’s.

Example request

Example response

A short acknowledgement rather than the full campaign object, because the campaign is no longer readable:
Calling it again returns 404 — the operation is not idempotent in its response, only in its effect.

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

Acknowledgement, not the full campaign object — the campaign is no longer readable.

id
string<uuid>
status
enum<string>
Available options:
archived
company_id
string<uuid>