Browse the docs

Deploy

Outbound campaigns

A campaign dials a queue of contacts with one agent, from one number. You fill the queue, start it, and read the results as calls end.

Lifecycle

  1. Create

    POST/v1/campaigns with a name, an agentId and a phoneId. It starts inactive unless you send isActive: true.

  2. Add contacts

    POST/v1/campaigns/{campaignId}/contacts creates or updates each contact by phone number and queues one call per contact.

  3. Start

    PATCH the campaign with isActive: true. Queued calls are dialed within the trunk's calls per second, and contacts added later are dialed as they arrive.

  4. Follow

    Read the totals with GET/v1/campaigns/{campaignId} and the calls with GET /v1/calls?campaignId=.

  5. Retry

    POST/v1/campaigns/{campaignId}/retry creates a new, inactive campaign for the contacts you did not reach and who never called back.

Add contacts

JSON
{
  "contacts": [
    {
      "salutation": "ms",
      "firstName": "Ada",
      "lastName": "Lovelace",
      "phoneNumber": "+33612345678",
      "email": "ada@example.com",
      "metadata": { "plan": "pro", "renewal": "2026-11-15" }
    }
  ]
}
  • phoneNumber is required, in E.164: normalise numbers before you send them.
  • An email that is present but empty or malformed fails the whole request with a 400: leave the field out when you are not sure of it. error.issues[].path points at the faulty contact, such as ["contacts", 0, "email"].
  • metadata takes any JSON object and reaches the agent's prompt (see Variables).
Active campaigns dial at once

When the campaign is active, the calls start as soon as the contacts are added. Send a test batch of one or two internal numbers first.

Start, stop and calling hours

isActive starts and stops the campaign. A campaign has no calling window of its own: to respect legal calling hours, schedule the switch on your side, at the start and the end of each window.

Automatic stop on declined calls

A campaign stops itself when too many of its recent calls are declined as soon as they are placed, which usually means the carrier is blocking the number. Recent calls are its last 40 ended in the last 10 minutes, counted once 30 have ended. declinedStopRatio sets the threshold, from 0.35 (14 calls out of 40) to 0.7 (28 out of 40), 0.5 by default. It is an advanced setting: an account it is not enabled on gets a 403; ask your account manager.

Remove queued calls

DELETE/v1/campaigns/{campaignId}/calls with ?status=READY deletes calls still waiting to be dialed: all of them, or those of the phoneNumbers you send. Calls already placed are never touched. The campaign's totals are computed from the calls that remain.

Opt-outs

When a contact asks not to be called again, POST/v1/contact-opted-out marks their number. Their queued and future calls end with contact-opted-out, without being dialed. A boolean entry such as Asked to opt out in the agent's information to collect lets your webhook do it automatically.