Skip to navigation

Create a campaign

View as Markdown

Create a campaign

Authentication

AuthorizationBearer

API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.

Request

This endpoint expects an object.
namestringRequired<=40 characters
The name of the campaign
audienceIdstringRequired
The ID of the audience
agentIdstringRequired
The ID of the agent
descriptionstringOptional
The description of the campaign
fromNumberslist of stringsOptional

The caller IDs this campaign presents, E.164 with the leading +, each matched against numbers your organization owns. Several numbers rotate positionally across calls; retries reuse the number the recipient already saw. The list is frozen on the campaign at creation. A campaign cannot be created without at least one resolvable number (400 "Choose at least one number to call from"); one bad number fails the whole request.

scheduledAtdatetimeOptional

Optional ISO-8601 timestamp for when the campaign should start dialing. Must be in the future. If provided, the campaign is created in scheduled status; otherwise it starts in draft status and must be started manually.

maxRetriesintegerOptional0-10Defaults to 3

Maximum number of times a failed call is retried before the participant is marked as failed. 0 disables retries.

retryDelayintegerOptional1-1440Defaults to 15
Delay in minutes between retry attempts for a failed call.
phoneNumberIdslist of stringsOptionalDeprecated

Legacy alias for fromNumbers: caller-ID phone number IDs, resolved to their numbers at creation. Ignored when fromNumbers is present. Prefer fromNumbers.

Response

Campaign created successfully. Note: agentId and audienceId are plain id strings in this response, not the nested objects the GET endpoints return.

statusbooleanOptional
dataobjectOptional

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
500
Internal Server Error