VocalDocscontracts 1.65.0

Create a Campaign

POST /v1/campaigns

PropertyValue
Operationcreate_campaign
GroupCampaigns
Scopecampaigns:write
Route classcontrol
IdempotencyIdempotency-Key required: a retry with the same key replays the first answer
AuditAudited campaigns.campaign.create (mutation)
Released in1.65.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Creates a draft Campaign at revision 1 and answers it with every default explicit (1.65.0). Its blocks are checked as a launch checks them, but for the attestation and the budget, each issue a detail of 422 validation_failed (CampaignIssueCode); marketing, app and the India cell are capability_not_available (CampaignCapabilityCode). The Idempotency-Key makes a repeated create answer the same draft.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the campaigns:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/campaigns" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "<name>",
    "purpose": "informational",
    "transport": "phone",
    "arms": [
      {
        "key": "<key>",
        "agent_id": "agt_...",
        "weight": 1
      }
    ],
    "identity": {
      "business_name": "<business_name>"
    },
    "numbers": {
      "assignment": "single",
      "phone_number_ids": [
        "pn_..."
      ]
    },
    "windows": {
      "weekly": [
        {
          "days": [
            "mon"
          ],
          "from": "<from>",
          "to": "<to>"
        }
      ]
    },
    "schedule": {
      "start_at": "2026-10-07T14:02:11.408Z",
      "end_at": "2026-10-07T14:02:11.408Z"
    },
    "pacing": {
      "calls_per_minute": 1,
      "max_concurrent": 1
    }
  }'

Parameters

NameInTypeRequiredDescription
idempotency-keyheaderstringyesA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: CampaignCreateRequest.

FieldTypeRequiredDescription
armsarray of CampaignArmInputyes
budgetCampaignBudgetInputno
consentCampaignConsentInputno
contact_capsCampaignContactCapsInputno
identityCampaignIdentityInputyes
namestringyesA label, never PHI (product terms): no patient, condition or appointment.
numbersCampaignNumbersInputyes
on_exhaustedCampaignOnExhaustedInputno
outcome_routingCampaignOutcomeRoutingInputno
pacingCampaignPacingInputyes
purposeCampaignPurposeyes
retryCampaignRetryInputno
scheduleCampaignScheduleInputyes
transportCampaignTransportyes
voicemailCampaignVoicemailInputno
windowsCampaignWindowInputyes

Responses

StatusContent typeShapeError codes
201application/jsonCampaign
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed, capability_not_available
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 201 answer

The shape is Campaign.

FieldTypeRequiredDescription
archivedbooleanyesTrue once DELETE archived an ended Campaign.
armsarray of CampaignArmyes
attestationCampaignAttestation or nullyes
budgetCampaignBudget or nullyesRequired at launch.
consentCampaignConsentyes
contact_capsCampaignContactCaps or nullyes
created_atTimestampyes
current_revisioninteger or nullyesThe frozen revision in force; null before launch.
ended_atTimestamp or nullyes
environmentEnvironmentyes
error_codestring or nullyesWhy a failed Campaign failed; null otherwise.
idCampaignIdyes
identityCampaignIdentityyes
launched_atTimestamp or nullyes
namestringyesA label, never PHI (product terms): no patient, condition or appointment.
numbersCampaignNumbersyes
object"campaign"yes
on_exhaustedCampaignOnExhausted or nullyes
organization_idOrganizationIdyes
outcome_routingCampaignOutcomeRouting or nullyes
pacingCampaignPacingyes
paused_reasonCampaignPausedReason or nullyesWhy it is paused; null otherwise.
project_idProjectId or nullyes
purposeCampaignPurposeyes
retryCampaignRetryyes
revisionintegeryesThe draft's revision, the ETag If-Match names.
scheduleCampaignScheduleyes
spend_microsintegeryesThe rated charges of the Campaign's Calls so far.
statusCampaignStatusyes
supervisor_process_idProcessInstanceId or nullyesThe supervisor Process instance; null before launch.
transportCampaignTransportyes
updated_atTimestampyes
voicemailCampaignVoicemailyes
windowsCampaignWindowyes