Skip to main content
POST
Create a campaign
Before creating a campaign, check Before you start. Working hours use your company’s timezone, and windows can run past midnight. See Working hours.
The new campaign is nested one level deeper than in the other endpoints: it’s at data.data, not data.
If you leave isActive out, the campaign is saved active and starts dialing within about five minutes, skipping the credit check and the free-lines check that "isActive": true gets. Always send isActive explicitly. In the playground, set it before you press Send.
If your company doesn’t have enough credits, a campaign created with isActive: true is saved paused, without an error. Check isActive in the response. When you’ve topped up, start it with Update a campaign.
Creating with "isActive": true but no agentId is accepted; the campaign won’t call anyone until you add an agent. Common causes of a 422 validation error:
  • name is missing, empty or longer than 100 characters.
  • workingDays is missing, empty, or has a value that isn’t a day name.
  • maxLines, maxRetries or retryDuration is outside its range.
  • An ID in agentId or customerListIds isn’t a valid UUID.

Authorizations

X-API-KEY
string
header
required

Body

application/json
name
string
required

Surrounding spaces are trimmed.

Required string length: 1 - 100
Example:

"September renewals"

workingDays
enum<string>[]
required

Days the campaign may call.

Minimum array length: 1
Available options:
monday,
tuesday,
wednesday,
thursday,
friday,
saturday,
sunday
Example:
isActive
boolean
default:false
required

Whether to start dialing as soon as the campaign is created. The API accepts it missing, but then saves the campaign active and starts dialing within minutes, so always send it.

Example:

false

agentId
string<uuid>

The outbound agent that makes the calls. Needed before the campaign can dial.

Example:

"0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10"

customerListIds
string<uuid>[]

The customer lists to call. Needed before the campaign can dial.

Example:
workingStartTime
string

Time of day calls may start, as HH:mm (24-hour).

Example:

"09:00"

workingEndTime
string

Time of day calls must stop, as HH:mm. If it's earlier than workingStartTime, the window runs past midnight.

Example:

"17:00"

continueOvernight
boolean

Which day the hours after midnight belong to. See Overnight windows. Defaults to false.

Example:

false

maxLines
integer

How many contacts the campaign dials in each batch. No more than your company's line limit. Defaults to 1.

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

5

maxRetries
integer

How many more times to call a contact who didn't answer. Defaults to 1.

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

2

retryDuration
integer

Seconds to wait before retrying a contact. If you leave it out, the wait isn't guaranteed, so set it explicitly.

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

3600

description
string

Free text for your own reference.

Response

The new campaign, at data.data.

message
string
Example:

"Campaign created successfully"

data
object

The new campaign is one level deeper, at data.data.