Skip to main content
PUT

Overview

Update an existing campaign to change its name, calling numbers, calling schedule, retry settings, DNC setting, holiday list or call outcome tracking. You can also add more calls to the campaign in the same request by attaching a CSV file. The request can be sent in two ways:
  • JSON (application/json) – to update settings only.
  • Form data (multipart/form-data) – to update settings and add calls from a CSV file in one request.

Prerequisites

  • An API key for your workspace
  • An existing campaign and its batchId. The campaign must have been created by the user who owns the API key.
  • The campaign must be paused or completed. Pause a running campaign before updating it.
  • Voice campaigns only. Chat campaigns can’t be edited with this endpoint.

Endpoint

Request

string
required
Your workspace API key. Create one from the profile menu in the dashboard → API Keys.
string
required
Unique identifier of the campaign to update.

Request Body

Request Parameters

All settings are optional. Send only the fields you want to change; fields you leave out keep their current values.
string
Name of the campaign.
array[string]
IDs of the phone numbers used to place calls. Replaces the campaign’s current list, so send every number the campaign should use. Calls are handled by the agent assigned to each number. Get the IDs from Get Phone Numbers.
string
Timezone used for the calling schedule. Example: Asia/Kolkata.
object
Daily calling window in 24-hour HH:MM format. Both start and end are required. Example: { "start": "09:00", "end": "17:00" }.
array[string]
Days of the week calls can be placed on. Example: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"].
integer
Maximum attempts per contact. Use a value from 1 to 10, the range the dashboard allows. The API does not check the range.
integer
Delay in minutes between attempts to the same contact. Use a value from 5 to 1440, the range the dashboard allows. The API does not check the range.
boolean
The campaign’s DNC setting. Can be true only when DNC is enabled for your organization. Numbers on your organization’s DNC list are skipped in every campaign whatever this value is.
string
ID of a holiday list in your organization. Send an empty string or null to remove the holiday list.
array[object]
Destinations call outcomes are sent to after each call. Replaces the current list. Send an empty array to stop tracking. A webhook or Google Sheet added here receives only calls that end after the update; earlier calls are not sent. Each item has:
  • type – one of standard (HubSpot/Zoho), custom, webhook or gsheet
  • schemaId – ID of the form or schema. For gsheet, the Google Sheet integration ID.
  • crmId – ID of the connection or webhook. For custom it must equal schemaId; for gsheet it is set to schemaId.
A campaign can have at most one Google Sheet, and a Google Sheet already connected to another active campaign can’t be added.

CSV Upload Parameters

Send these as multipart/form-data to add calls to the campaign. When using form data, send object and array fields (callingNumbers, callingHour, allowedDays, pushingCrms) as JSON strings, and enableDNC as "true" or "false". The settings are saved first, then the file is processed. If the file is rejected, the settings change is still saved, and a paused campaign stays paused. The file uses the same columns as Upload Campaign CSV. New calls use the campaign’s settings after this update.
file
File of contacts to add: .csv, .xls or .xlsx. Existing calls in the campaign are not removed. Not supported for inbound campaigns.
string
JSON array of variables that every row must have a value for. Example: ["customer_name"].
string
"true" to skip invalid rows and upload only the valid ones. "false" (default) to reject the upload if any row is invalid. A file with no valid rows is always rejected.

Response

boolean
required
Indicates whether the request completed successfully.
integer
required
HTTP status code.
string
required
Human-readable success message. It is always Batch updated and resumed successfully, even when the campaign was not paused or did not resume. Check data.queue_status for the campaign’s status.
object
required
The updated campaign. The example shows the main fields; the response includes the full campaign record.
string
Unique identifier of the campaign.
string
Name of the campaign.
string
Campaign type: outbound, inbound or mixed.
array[string]
IDs of the calling numbers.
object
Daily calling window.
array[string]
Days calls are placed on.
integer
Maximum attempts per contact.
integer
Minutes between attempts.
string
Campaign status after the update:
  • A paused campaign resumes: in-progress, pending, or freezed when outside its calling window. It stays paused if the automatic resume failed; call Resume Campaign in that case.
  • A completed campaign becomes pending when the file added calls, and otherwise stays completed.

Error Handling

Errors return status: false, with the reason in errorMessage.
  • 400 Bad Request
    • Invalid Batch ID – batchId is not a valid ID.
    • Batch is currently running. Please pause this batch before updating.
    • A chat campaign cannot be edited here… – the campaign is a chat campaign.
    • callingHour is missing start or end, or they are not in HH:MM format.
    • Invalid JSON format for … – a form field that must be a JSON string could not be parsed.
    • enable DNC must be … in organization settings – enableDNC: true was sent but DNC is not enabled for your organization.
    • Invalid holidayListId or Holiday list not found – the holiday list ID is malformed or not in your organization.
    • A pushingCrms entry is invalid: Invalid CRM type, Invalid CRM schemaId, Invalid CRM crmId, Custom CRM crmId must equal schemaId, more than one Google Sheet, or a Google Sheet already connected to another active campaign.
    • CSV upload is not allowed for inbound batches.
    • The file is empty, is not CSV or Excel, or has no valid rows.
    • The file has invalid rows and type is "false". data contains:
      • code – INVALID_CSV_ROWS
      • totalInvalidRows – number of invalid rows
      • validRows – rows that would be uploaded if invalid rows are skipped
      • truncated – true if invalidRows lists only some of the rows
      • invalidRows – list of { rowNumber, phoneNumber, reason }
      Fix the rows, or resend with type set to "true" to skip them.
  • 401 Unauthorized – Missing or invalid API key.
    • Unauthorized: Invalid API Key – the x-api-key value is wrong, the key was deleted, or it was created in a different environment (for example the dev dashboard).
    • Unauthorized: No API Key OR Token Provided – the x-api-key header was not sent.
  • 404 Not Found
    • Batch not found – no campaign with this ID was created by the user who owns the API key, or it was deleted.
    • A pushingCrms entry points to something that does not exist: CRM schema not found, CRM not found, Custom CRM schema not found or Google Sheets integration not found.
  • 500 Internal Server Error – Unexpected server error.
A campaign that was paused resumes automatically after a successful update. You do not need to call the resume endpoint unless data.queue_status is still paused.
The campaign type (outbound, inbound or mixed) and scheduled start date are set when the campaign is created and cannot be changed with this endpoint. In this request, type is the skip-invalid-rows flag described above, not the campaign type.
After updating a campaign, you can:
  • GET /api/call/batch-details/{batchId} to retrieve the updated campaign details.
  • POST /api/call/addCallsToBatch to add more calls without changing settings.
  • POST /api/call/start-calling to start calling.
  • DELETE /api/call/delete-batch/{batchId} to delete the campaign.