Skip to main content
POST
Close a continuous campaign

Authorizations

Authorization
string
header
required

Project API key (sk_api_…).

Path Parameters

campaignId
string<uuid>
required

Response

The campaign, with closedAt stamped.

campaignId
string<uuid>
organizationId
string<uuid>
projectId
string<uuid>
name
string
Maximum string length: 120
state
enum<string>

Where the campaign is in its lifecycle:

  • draft — created, nothing dials
  • scheduled — the platform launches it at config.schedule.scheduledFor
  • launching — the contact list is being materialized into a run; transient
  • launch_failed — materialization failed; lastError says which phase, and launching again retries it
  • running — the dialer is placing calls
  • paused — no new dials; calls already in flight run to their end
  • draining — closed to new work, waiting only on in-flight calls
  • completed — terminal
Available options:
draft,
scheduled,
launching,
launch_failed,
running,
paused,
draining,
completed
mode
enum<string>

Fixed at create. bounded snapshots the contact list at launch and completes itself once the queue empties; continuous keeps accepting appended contacts and completes only after a close. Absent on older campaigns; read that as bounded.

Available options:
bounded,
continuous
config
object

Returned exactly as stored — a section never set is absent rather than filled in with defaults.

closedAt
string<date-time>

When the campaign was closed to new work. Continuous campaigns only; closing does not change state, so expect running until the drain begins.

currentRunId
string<uuid>

The single run created at first launch; a retried launch reuses it.

runStartedAt
string<date-time>

First launch. Unchanged by pauses, resumes and launch retries.

lastError
object

Why the last launch failed. Cleared by a launch that gets further.

statusMessage
string

Set when the platform acts on its own, and says why. Expect Paused: out of credits, or Paused: assistant version not found when the campaign's assistant was deleted. The assistant can't be changed after launch, so a resume won't fix that one. Cleared on resume.

Example:

"Paused: out of credits"

hasGradedCall
boolean

True once any call has been graded, after which config.scorecard is frozen. Absent until then.

trigger
object

How the campaign takes work. Always {"kind": "list"} today.

steps
string[]

What each contact goes through. Always ["call"] today.

createdAt
string<date-time>
updatedAt
string<date-time>
version
integer

Increments on every accepted write — compare it across reads to tell a real change from an unchanged poll.