Create Campaign V2

Authentication

AuthorizationBearer
Authenticate server-side requests with a private Vapi API key. Create or copy a key from the [Vapi Dashboard](https://dashboard.vapi.ai) and send it in the `Authorization` header as `Bearer <token>`. Keep private API keys out of client-side code and public repositories.

Request

This endpoint expects an object.
namestringRequired
This is the name of the campaign. This is just for your own reference.
assistantIdstringOptional

This is the assistant ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used.

workflowIdstringOptional

This is the workflow ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used.

squadIdstringOptional

This is the squad ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used.

phoneNumberIdstringOptional

This is the phone number ID that will be used for the campaign calls. Required if dialPlan is not provided. Note: phoneNumberId and dialPlan are mutually exclusive.

dialPlanlist of objectsOptional

This is a list of dial entries, each specifying a phone number and the customers to call using that number. Use this when you want different phone numbers to call different sets of customers. Note: phoneNumberId and dialPlan are mutually exclusive.

schedulePlanobjectOptional

This is the schedule plan for the campaign. Calls will start at startedAt and continue until your organization’s concurrency limit is reached. Any remaining calls will be retried for up to one hour as capacity becomes available. After that hour or after latestAt, whichever comes first, any calls that couldn’t be placed won’t be retried.

customerslist of objectsOptional
These are the customers that will be called in the campaign. Required if dialPlan is not provided. Maximum of 10000 customers per campaign.
maxConcurrencydoubleOptional>=1
This is the maximum number of concurrent calls that will be made for the campaign. Defaults to 10.
assistantOverridesobjectOptional

These are the overrides for the assistant’s settings and template variables for the campaign. Use this when the campaign targets an assistantId.

squadOverridesobjectOptional

These are the overrides for the squad and template variables for the campaign. Use this when the campaign targets a squadId. Per-contact squadOverrides are deep-merged on top of this at dispatch time.

serverobjectOptional

This is the server (URL, auth headers, timeout, etc.) for the campaign webhooks.

serverMessagesenumOptional
These are the messages that will be sent to your Server URL.
predialPlanobjectOptional

This opts the campaign into the blocking campaign.predial eligibility webhook. When set, every contact triggers a campaign.predial POST to the Server URL before dialing, and the response { eligible: boolean } decides whether the call is placed. Requires server. When unset, no pre-dial webhook is sent.

duplicateFromCampaignIdstringOptional

Optional campaign ID to duplicate config from. Provided fields in the request override the source. If customers is omitted, contacts are copied from the source.

Response

statusenum
This is the status of the campaign.
namestring
This is the name of the campaign. This is just for your own reference.
idstring
This is the unique identifier for the campaign.
orgIdstring
This is the unique identifier for the org that this campaign belongs to.
createdAtdatetime

This is the ISO 8601 date-time string of when the campaign was created.

updatedAtdatetime

This is the ISO 8601 date-time string of when the campaign was last updated.

callsobject
This is a map of call IDs to campaign call details.
callsCounterScheduleddouble
This is the number of calls that have been scheduled.
callsCounterQueueddouble
This is the number of calls that have been queued.
callsCounterInProgressdouble
This is the number of calls that have been in progress.
callsCounterEndedVoicemaildouble
This is the number of calls whose ended reason is 'voicemail'.
callsCounterEndeddouble
This is the number of calls that have ended.
endedReasonenumOptional
This is the explanation for how the campaign ended.
assistantIdstringOptional

This is the assistant ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used.

workflowIdstringOptional

This is the workflow ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used.

squadIdstringOptional

This is the squad ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used.

phoneNumberIdstringOptional

This is the phone number ID that will be used for the campaign calls. Required if dialPlan is not provided. Note: phoneNumberId and dialPlan are mutually exclusive.

dialPlanlist of objectsOptional

This is a list of dial entries, each specifying a phone number and the customers to call using that number. Use this when you want different phone numbers to call different sets of customers. Note: phoneNumberId and dialPlan are mutually exclusive.

schedulePlanobjectOptional

This is the schedule plan for the campaign. Calls will start at startedAt and continue until your organization’s concurrency limit is reached. Any remaining calls will be retried for up to one hour as capacity becomes available. After that hour or after latestAt, whichever comes first, any calls that couldn’t be placed won’t be retried.

customerslist of objectsOptional
These are the customers that will be called in the campaign. Required if dialPlan is not provided. Maximum of 10000 customers per campaign.
maxConcurrencydoubleOptional>=1
This is the maximum number of concurrent calls that will be made for the campaign. Defaults to 10.
assistantOverridesobjectOptional

These are the overrides for the assistant’s settings and template variables for the campaign. Use this when the campaign targets an assistantId.

squadOverridesobjectOptional

These are the overrides for the squad and template variables for the campaign. Use this when the campaign targets a squadId. Per-contact squadOverrides are deep-merged on top of this at dispatch time.

serverobjectOptional

This is the server (URL, auth headers, timeout, etc.) for the campaign webhooks.

serverMessagesenumOptional
These are the messages that will be sent to your Server URL.
predialPlanobjectOptional

This opts the campaign into the blocking campaign.predial eligibility webhook. When set, every contact triggers a campaign.predial POST to the Server URL before dialing, and the response { eligible: boolean } decides whether the call is placed. Requires server. When unset, no pre-dial webhook is sent.