Skip to main content
POST

Overview

Add contacts to an existing campaign. Each contact needs a phoneNumber; any other fields are stored with the contact and passed to the agent as variables. Contacts are queued for calling straight away and are called during the campaign’s calling hours. You don’t need to call Start Campaign afterwards. A completed campaign is moved back to pending so the new contacts get called.

Prerequisites

  • An outbound or mixed campaign and its batchId, created by the user who owns the API key. Contacts can’t be added to inbound campaigns.
  • The campaign’s calling numbers have an outbound agent assigned.

Request

string
required
Your workspace API key. Create one from the profile menu in the dashboard → API Keys.
string
required
ID of the campaign, from Create Campaign or Get Campaigns.
array[object]
required
Contacts to add, up to 10,000 per request. Each object must include phoneNumber in E.164 format, for example +919876543210. Other fields are stored with the contact.
  • timezone – optional per-contact timezone. Defaults to the campaign’s timezone.
  • Agent variables you leave out are stored as null. They are not rejected.
  • These field names are reserved and rejected: call_status, retry_count, call_duration, insertuuid, _id, x_weya_transliterated_name, x_weya_transliterated_language.

Response

This endpoint returns a summary object, not the standard status/data wrapper. Errors use the standard wrapper (see below).
boolean
required
true when every chunk was saved.
integer
required
Number of new contacts added. Contacts whose phone number is already in the campaign are updated instead and aren’t counted.
array[string]
required
IDs of the contacts added or updated by this request. All of them are queued for calling.
object
required
Contacts are saved in chunks of 1,000: totalChunks, successfulChunks, failedChunks (a count) and skippedRows (rows skipped because the phone number was invalid).
string
required
All calls processed successfully, Calls saved but with warnings (some rows were skipped), or Partial success: Some chunks failed.
boolean
true when some chunks failed. The HTTP status is then 207.
array[object]
Present when chunks failed: each { chunkNum, error }. Send the contacts of those chunks again.
array[object]
Present when rows were skipped: each { rowNumber, phoneNumber, error }. rowNumber is the 1-based position in callData.

Error Handling

Errors return status: false, with the reason in errorMessage.
  • 400 Bad Request
    • Valid callData is required – callData is missing or empty.
    • Upload exceeds the maximum of 10,000 rows… – split the contacts into several requests.
    • Call data contains restricted headers: … – a contact uses a reserved field name.
    • No valid phone numbers in callData… – every phone number was invalid.
    • Cannot add lead data to an inbound batch.
    • Batch has no calling numbers.
  • 401 Unauthorized – Missing or invalid API key.
  • 403 Forbidden – Batch not found or not authorized for this user: the campaign doesn’t exist, was deleted, or wasn’t created by the user who owns the API key.
  • 404 Not Found – Agent not found for the provided calling numbers: no calling number has an outbound agent.
  • 500 Internal Server Error – Unexpected server error.
Duplicates:
  • When the same phone number appears more than once in callData, only the first is kept.
  • When a phone number is already in the campaign, that contact’s data is replaced with the new values and it becomes callable again: its retry counter is reset to 0 and it is no longer expired. Its earlier call history is kept.