Skip to main content
A campaign calls a list of contacts with one of your assistants, from one of your phone numbers. Verbeo places the calls, retries the contacts it did not reach, and keeps a result for every contact. The contacts do not travel in the request that creates the campaign. You upload them first, as one NDJSON file, then create the campaign with that file. Verbeo imports it in the background, and the campaign can start once the import is done.
This is version 2 of the campaigns API, and the one to build on. Integrations built on version 1 keep working.

Endpoints

Every path is under https://api.verbeo.ai/v2. The workspace comes from your API key, so no endpoint asks you for a workspace id.
The two lists are POSTs because a list query is a document: page, size and filters arrive typed as themselves rather than coerced from a query string. They read, and change nothing.

How it works

1

Write the contacts file

One JSON object a line, each with the number to call in +E.164. See The contacts file.
contacts.ndjson
2

Reserve an upload

Send the file’s name and its size in bytes, which wc -c < contacts.ndjson prints (Reserve an upload):
The answer’s import.id names the upload, and upload.signed_url is where the file goes. The link works for 2 hours.
3

Upload the file

One PUT of the whole file to upload.signed_url, exactly as the answer gave it:
The link goes to Verbeo’s file storage, not to api.verbeo.ai, and takes no API key. Use --data-binary: curl’s -d strips the newlines between the contacts.
4

Create the campaign

Name the upload, the assistant and the number to call from (Create campaign):
The campaign is a draft, and its import is queued.
5

Wait for the import

Read the campaign every few seconds (Get campaign) until import.status is done:
import.lines_read of import.total_lines is how far it has got, and import.skipped lists the lines it passed over, with why. If the import is failed, import.error_message says why, and Retry import runs it again from where it stopped.
6

Start it

A campaign created with a scheduled_at needs no start: it becomes scheduled when its import is done, and starts at that time. Follow the calls with List contacts and Contact counts.

The contacts file

NDJSON: one JSON object a line, in UTF-8, each line ending in \n or \r\n. Upload it with Content-Type: application/x-ndjson.
contacts.ndjson
Any other key on a line is ignored. The numbers must already be in +E.164: the import does not read a number without a country code. How the lines are read:
  • A blank line (empty, or only whitespace) is passed over. It is neither a contact nor a skipped line.
  • A line that breaks a rule is skipped with its reason, and the import goes on. rows_skipped counts every skipped line; skipped keeps the first 100 with their line numbers (line 1 is the file’s first).
  • A number on two lines is called twice. Duplicates are kept.

Limits

The campaign object

Every route that returns a campaign returns this. List campaigns returns it with a shorter import.
string
required
UUID of the campaign.
string
required
UUID of your workspace.
string
required
Its name, 1 to 255 characters.
string | null
required
The assistant that places the calls. null only on a finished campaign whose assistant has since been deleted.
string | null
required
The number the calls come from: the caller ID. null only on a finished campaign whose number has since been deleted.
string
required
number
required
The contacts in the campaign. It grows while the import runs.
number
required
Contacts that are finished: reached, failed or cancelled.
number
required
Contacts reached.
number
required
Contacts that failed or were cancelled.
number
required
How many more times a contact that was not reached is called: 0 to 6.
number[]
required
Minutes to wait before each retry, the first retry first. A retry with no interval of its own waits 5 minutes.
string | null
required
When the campaign starts on its own.
string | null
required
When it was first started.
string | null
required
When it finished, or was cancelled.
object | null
required
When calls may be placed, as Create campaign takes it. null: any time.
string | null
required
A two-letter country code stored with the campaign.
string | null
required
When a dormant campaign wakes.
string | null
required
When it last began to warm up.
string
required
ISO 8601 timestamp with a UTC offset.
string
required
The last change, in the same format.
object | null
required
Its contacts file and how far its import has got: the import object. null for a campaign made without one, before version 2 or through version 1.

The import object

string
required
The upload’s UUID: the import_id the campaign was created with.
string
required
string
required
The name you gave the file.
number
required
Its size in bytes: as you declared it, then as stored once the campaign is created.
number | null
required
The contact_count you gave, for a progress bar before the lines are counted.
number | null
required
The file’s lines, blank ones included. null until Verbeo has counted them.
number
required
The lines saved so far: contacts, skipped and blank lines alike. A retry resumes after them.
number
required
Contacts imported.
number
required
Lines skipped.
object[]
required
The first 100 skipped lines, each { "line", "reason" }.
string | null
required
Why the import failed.
number
required
Runs started. More than 1 when a run was cut off and resumed; the import fails after 5 runs that did not finish.
A list item’s import carries id, status, expected_count, total_lines, lines_read, contacts_added, rows_skipped and error_message.

Import statuses

Why an import fails, in error_message:

Campaign statuses

Who may do what

An API key acts as its workspace’s owner, so it may call every route. The same routes serve the dashboard, where each member’s role decides: A member without the role gets 403 FORBIDDEN, naming the roles that would have worked. Campaigns are a Pro feature. The workspace’s latest subscription must be on a plan with campaigns, and active, trialing or past due. Without it, reserving, creating, starting, resuming and giving a draft a time to start are refused with 402 PAYMENT_REQUIRED: Campaigns are a Pro feature. Upgrade this workspace to the Pro plan to create or start a campaign. Pausing and cancelling are never refused for it.

Good to know

  • The upload link expires 2 hours after the reserve (upload.expires_at). After that, creating with it is refused (409) and the upload is removed: reserve again and upload again.
  • A campaign cannot start until its import is done. It is a draft meanwhile, and starting it is refused with 409; so is starting one with no contacts.
  • Start and resume need the Pro plan (402), and so does an update that gives a draft a time to start, since a scheduled campaign starts by itself. Pause and cancel do not.
  • Only a campaign that never started can be deleted. One that has started keeps its history: deleting it is refused with 409. Cancel it instead.
  • Contacts saved in the same batch come back in no set order. The import saves the file 5,000 lines that are not blank at a time (fewer when the lines are long). List contacts returns the batches in order, but not each batch in file order. To match a contact to your own record, put your id in its custom_data.
  • A failed import resumes where it stopped. Retry import carries on after the last line saved, so no contact is added twice.
  • Cancelling or deleting a campaign while its contacts import stops the import.
  • The dashboard uploads the same file another way. It sends it in pieces through the resumable (TUS) link the reserve also answers with. An integration can use the plain PUT to upload.signed_url.

Errors every route can give

The error envelope is on the Errors page.