curl --location --request PUT 'https://api.weya.live/backend/api/call/update-batch/6806382f98da85ec32fac955' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"batchName": "Sales Campaign - July",
"callingNumbers": ["6889c4ab7c7d3f9876543210"],
"timezone": "Asia/Kolkata",
"callingHour": { "start": "09:00", "end": "17:00" },
"allowedDays": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"retry": 3,
"delay": 30
}'
curl --location --request PUT 'https://api.weya.live/backend/api/call/update-batch/6806382f98da85ec32fac955' \
--header 'x-api-key: YOUR_API_KEY' \
--form 'batchName="Sales Campaign - July"' \
--form 'callingNumbers="[\"6889c4ab7c7d3f9876543210\"]"' \
--form 'retry="3"' \
--form 'delay="30"' \
--form 'file=@"/path/to/new-leads.csv"' \
--form 'mandatoryVariables="[\"customer_name\"]"' \
--form 'type="false"'
{
"status": true,
"code": 200,
"message": "Batch updated and resumed successfully",
"errorMessage": null,
"data": {
"_id": "6806382f98da85ec32fac955",
"batchName": "Sales Campaign - July",
"type": "outbound",
"callingNumbers": ["6889c4ab7c7d3f9876543210"],
"timezone": "Asia/Kolkata",
"callingHour": { "start": "09:00", "end": "17:00" },
"allowedDays": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"retry": 3,
"delay": 30,
"holidayListId": null,
"pushingCrms": [],
"queue_status": "pending"
}
}
Campaign Management
Update Campaign
Edit an existing calling campaign’s settings, and optionally add more calls to it from a CSV file.
PUT
/
api
/
call
/
update-batch
/
{batchId}
curl --location --request PUT 'https://api.weya.live/backend/api/call/update-batch/6806382f98da85ec32fac955' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"batchName": "Sales Campaign - July",
"callingNumbers": ["6889c4ab7c7d3f9876543210"],
"timezone": "Asia/Kolkata",
"callingHour": { "start": "09:00", "end": "17:00" },
"allowedDays": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"retry": 3,
"delay": 30
}'
curl --location --request PUT 'https://api.weya.live/backend/api/call/update-batch/6806382f98da85ec32fac955' \
--header 'x-api-key: YOUR_API_KEY' \
--form 'batchName="Sales Campaign - July"' \
--form 'callingNumbers="[\"6889c4ab7c7d3f9876543210\"]"' \
--form 'retry="3"' \
--form 'delay="30"' \
--form 'file=@"/path/to/new-leads.csv"' \
--form 'mandatoryVariables="[\"customer_name\"]"' \
--form 'type="false"'
{
"status": true,
"code": 200,
"message": "Batch updated and resumed successfully",
"errorMessage": null,
"data": {
"_id": "6806382f98da85ec32fac955",
"batchName": "Sales Campaign - July",
"type": "outbound",
"callingNumbers": ["6889c4ab7c7d3f9876543210"],
"timezone": "Asia/Kolkata",
"callingHour": { "start": "09:00", "end": "17:00" },
"allowedDays": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"retry": 3,
"delay": 30,
"holidayListId": null,
"pushingCrms": [],
"queue_status": "pending"
}
}
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
curl --location --request PUT 'https://api.weya.live/backend/api/call/update-batch/6806382f98da85ec32fac955' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"batchName": "Sales Campaign - July",
"callingNumbers": ["6889c4ab7c7d3f9876543210"],
"timezone": "Asia/Kolkata",
"callingHour": { "start": "09:00", "end": "17:00" },
"allowedDays": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"retry": 3,
"delay": 30
}'
curl --location --request PUT 'https://api.weya.live/backend/api/call/update-batch/6806382f98da85ec32fac955' \
--header 'x-api-key: YOUR_API_KEY' \
--form 'batchName="Sales Campaign - July"' \
--form 'callingNumbers="[\"6889c4ab7c7d3f9876543210\"]"' \
--form 'retry="3"' \
--form 'delay="30"' \
--form 'file=@"/path/to/new-leads.csv"' \
--form 'mandatoryVariables="[\"customer_name\"]"' \
--form 'type="false"'
Request Body
{
"batchName": "Sales Campaign - July",
"callingNumbers": ["6889c4ab7c7d3f9876543210"],
"timezone": "Asia/Kolkata",
"callingHour": { "start": "09:00", "end": "17:00" },
"allowedDays": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"retry": 3,
"delay": 30,
"holidayListId": "68a1f2c3b7c7d3f123456789",
"pushingCrms": [
{
"type": "webhook",
"schemaId": "68b2e3d4b7c7d3f123456789",
"crmId": "68b2e3d4b7c7d3f123456789"
}
]
}
Request Parameters
All settings are optional. Send only the fields you want to change; fields you leave out keep their current values.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.
Daily calling window in 24-hour
HH:MM format. Both start and end are required. Example: { "start": "09:00", "end": "17:00" }.Days of the week calls can be placed on. Example:
["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"].Maximum attempts per contact. Use a value from 1 to 10, the range the dashboard allows. The API does not check the range.
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.
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.ID of a holiday list in your organization. Send an empty string or
null to remove the holiday list.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 ofstandard(HubSpot/Zoho),custom,webhookorgsheetschemaId– ID of the form or schema. Forgsheet, the Google Sheet integration ID.crmId– ID of the connection or webhook. Forcustomit must equalschemaId; forgsheetit is set toschemaId.
CSV Upload Parameters
Send these asmultipart/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 of contacts to add:
.csv, .xls or .xlsx. Existing calls in the campaign are not removed. Not supported for inbound campaigns."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
{
"status": true,
"code": 200,
"message": "Batch updated and resumed successfully",
"errorMessage": null,
"data": {
"_id": "6806382f98da85ec32fac955",
"batchName": "Sales Campaign - July",
"type": "outbound",
"callingNumbers": ["6889c4ab7c7d3f9876543210"],
"timezone": "Asia/Kolkata",
"callingHour": { "start": "09:00", "end": "17:00" },
"allowedDays": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"retry": 3,
"delay": 30,
"holidayListId": null,
"pushingCrms": [],
"queue_status": "pending"
}
}
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.The updated campaign. The example shows the main fields; the response includes the full campaign record.
Campaign status after the update:
- A paused campaign resumes:
in-progress,pending, orfreezedwhen outside its calling window. It stayspausedif the automatic resume failed; call Resume Campaign in that case. - A completed campaign becomes
pendingwhen the file added calls, and otherwise stayscompleted.
Error Handling
Errors returnstatus: false, with the reason in errorMessage.
- 400 Bad Request
-
Invalid Batch ID–batchIdis 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. -
callingHouris missingstartorend, or they are not inHH:MMformat. -
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: truewas sent but DNC is not enabled for your organization. -
Invalid holidayListIdorHoliday list not found– the holiday list ID is malformed or not in your organization. -
A
pushingCrmsentry 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
typeis"false".datacontains:code–INVALID_CSV_ROWStotalInvalidRows– number of invalid rowsvalidRows– rows that would be uploaded if invalid rows are skippedtruncated–trueifinvalidRowslists only some of the rowsinvalidRows– list of{ rowNumber, phoneNumber, reason }
typeset to"true"to skip them.
-
- 401 Unauthorized – Missing or invalid API key.
Unauthorized: Invalid API Key– thex-api-keyvalue 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– thex-api-keyheader 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
pushingCrmsentry points to something that does not exist:CRM schema not found,CRM not found,Custom CRM schema not foundorGoogle 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/addCallsToBatchto add more calls without changing settings.POST /api/call/start-callingto start calling.DELETE /api/call/delete-batch/{batchId}to delete the campaign.
Was this page helpful?

