Skip to content

Start a campaign

POSThttps://api.voice-agent.gowajee.ai/api/campaign/:id/schedule

Starts a campaign. In one request you decide:

  • when calls may happen: the start time, an optional deadline, and the daily calling hours,
  • how often to try each person: attempts and the wait between them,
  • whether to call back people who ask for it during a call (Smart Callback),
  • which phone numbers the customer sees, and which AI voices the agent uses (one of each, or several to shuffle).

The campaign goes from DRAFT to SCHEDULED, one call is prepared for each recipient, and dialling begins once the start time arrives inside a calling window. Only startDateTime is required. Everything else has a default. Any field not listed below is rejected with 400. That includes maxConcurrentCalls: the number of calls at the same time is set per organization, not per request.

A campaign can be started once, from DRAFT. Starting it again returns 409. To call the same people again, create a new campaign.

Name Description
id The campaign ID (campaignId from Create a campaign).
Field Type Required Default Description
startDateTime string (ISO-8601, UTC) ✅ The earliest time to start calling. A time in the past means “now”.
endDateTime string (ISO-8601, UTC) or null null The deadline. Anyone not called by then becomes EXPIRED. null means no deadline.
timeWindows object[] Mon–Fri 09:00–19:00, Sat–Sun 10:00–19:00 The days, and the hours in Bangkok time, when calls may start. More

Each timeWindows item:

Field Type Description
dayOfWeek integer 1–7 1 = Monday … 7 = Sunday. Days not listed get no calls.
time object[] One or more { "start": "HH:MM", "end": "HH:MM" } ranges in Bangkok time, with start before end. Hours need two digits: 09:00, not 9:00. It can’t be empty.
Field Type Default Description
maxAttempts integer, 1 or more 1 Total calls per recipient, counting the first. 3 = 1 call + up to 2 retries.
retryInterval integer (milliseconds) 3600000 (1 hour) when maxAttempts is more than 1, otherwise 0 Minimum wait after a call ends before the retry. When maxAttempts is more than 1 it must be at least 300000 (5 minutes). Otherwise send 0, or leave it out. 7200000 = 2 hours, 14400000 = 4 hours. More

NO_ANSWER, BUSY and FAILED are retried. So is CANCELLED (for example a call that waited too long in the queue), and that doesn’t use up an attempt. Someone who was reached is not retried. The only call after that is one Smart Callback, when it is on and the customer asked for it.

Field Type Default Description
smartCallbackEnabled boolean false Call the customer back when they ask for it during a reached call, for example “ไม่สะดวก ค่อยโทรมาใหม่” or “บ่าย 2 ได้ไหม”. Works with or without retries.
smartCallbackDefaultDelayMinutes integer: 30, 60, 120 or 180 60 When the customer asks for a callback but gives no time, call back this many minutes after the call ended.
smartCallbackAllowNextDay boolean false Allow the callback to be tomorrow. Off = same day only. A callback is never later than tomorrow.

A field you leave out keeps the campaign’s current value. A new campaign starts with false / 60 / false; a campaign duplicated in the dashboard with its retry settings keeps the values it copied.

How the callback time is chosen (all times in Bangkok time):

  • The customer named a time (“บ่าย 2”, “อีกครึ่งชั่วโมง”): that time. If that time has already passed today, the same time tomorrow (only if smartCallbackAllowNextDay is on). If it is outside the calling hours, there is no callback.
  • The customer named a part of the day (“ช่วงเย็น”): the start of that part — morning 09:00, afternoon 13:00, evening 16:00, night 18:00. If the call ended inside that part of the day, the next full hour. Outside the calling hours, the callback moves to the next calling range that day.
  • No time: the call’s end time plus smartCallbackDefaultDelayMinutes, moved to the next calling range that day if needed. “Tomorrow” with no time means the start of tomorrow’s calling hours.
  • Tomorrow needs smartCallbackAllowNextDay: true. Later than tomorrow (“next week”), or after endDateTime: no callback.

Each recipient gets at most one callback per round (each Call again starts a new round). It isn’t retried if missed, and it doesn’t use up maxAttempts. You see what happened in the smartCallback object of each call. The Scheduling guide has the full rules and worked examples.

Field Type Default Description
callerIds string[] The agent’s numbers, or else Gowajee’s shared number Outbound phone numbers, written exactly as on System → Settings → Phone Numbers. One number = every call uses it. Several = shuffled per call, and a retry never repeats the previous number. More
sipAccountId string (UUID) Legacy. The ID of the SIP account that holds sipCallerId. It must be one of your organization’s SIP accounts.
sipCallerId string (UUID) Legacy. The ID of one caller number. Pins every call to it. Prefer callerIds. If you send both, callerIds wins.
Field Type Default Description
ttsVoiceKeys string[] The agent’s own voice setup AI voice keys from the voice catalog. One key = every call uses it. Several = shuffled per call. Sending this switches the calls to the TTS V2 voices. Listen first at Voice Lab. More
Field Type Default Description
removeDuplicates boolean false Before dialling, remove anyone this agent already reached (COMPLETED) within your Duplicate Call Alert window. More
curl -X POST "https://api.voice-agent.gowajee.ai/api/campaign/eac2489c-672c-455e-ab8c-4e0ecd18d7dc/schedule" \
-H "X-API-Key: $GOWAJEE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"startDateTime": "2026-10-01T02:00:00.000Z",
"endDateTime": "2026-10-07T11:00:00.000Z",
"timeWindows": [
{ "dayOfWeek": 1, "time": [{ "start": "09:00", "end": "12:00" }, { "start": "13:00", "end": "18:00" }] },
{ "dayOfWeek": 2, "time": [{ "start": "09:00", "end": "18:00" }] },
{ "dayOfWeek": 3, "time": [{ "start": "09:00", "end": "18:00" }] },
{ "dayOfWeek": 4, "time": [{ "start": "09:00", "end": "18:00" }] },
{ "dayOfWeek": 5, "time": [{ "start": "09:00", "end": "18:00" }] }
],
"maxAttempts": 3,
"retryInterval": 14400000,
"callerIds": ["+6621234567", "+6621234568"],
"ttsVoiceKeys": ["nicha", "suda"],
"smartCallbackEnabled": true,
"smartCallbackDefaultDelayMinutes": 60,
"smartCallbackAllowNextDay": true
}'
{
"success": true,
"message": "Campaign schedule updated successfully",
"data": {
"id": "eac2489c-672c-455e-ab8c-4e0ecd18d7dc",
"status": "SCHEDULED"
}
}

With removeDuplicates: true the response also has "removedRecipients": 12.

The body is the usual error envelope. The checks run in this order, and the first one that fails decides the response:

  1. Your organization is approved to make calls (403). This runs before anything else, so until Gowajee approves your organization every start request gets 403, whatever the body or id.
  2. The body shape (400). A malformed body gets 400 even on a campaign that was already started.
  3. The campaign (404).
  4. The campaign is DRAFT (409). A well-formed body on a started campaign always gets 409.
  5. The schedule rules (400).
  6. Duplicate removal (400), only when you send removeDuplicates: true.
Status code message Cause
400 INVALID_ID id must be a valid UUID The id in the path isn’t a UUID.
400 VALIDATION_FAILED property <x> should not exist A field that isn’t listed above, for example maxConcurrentCalls or retryIntervalMs.
400 VALIDATION_FAILED startDateTime must be a valid ISO 8601 date string startDateTime is missing or isn’t a valid date. The same check applies to endDateTime.
400 VALIDATION_FAILED timeWindows.0.time.0.start must be HH:MM (24-hour, two-digit hour) A time isn’t two-digit HH:MM, for example 9:00. The path in the message points to the item.
400 VALIDATION_FAILED timeWindows.0.dayOfWeek must not be greater than 7 dayOfWeek isn’t a whole number from 1 to 7.
400 VALIDATION_FAILED maxAttempts must not be less than 1 maxAttempts must be a whole number, 1 or more.
400 VALIDATION_FAILED callerIds should not be empty / ttsVoiceKeys should not be empty You sent []. Leave the field out instead.
400 VALIDATION_FAILED sipAccountId must be a UUID The same for sipCallerId.
400 VALIDATION_FAILED smartCallbackEnabled must be a boolean value The same for smartCallbackAllowNextDay. Send true or false, not a string.
400 VALIDATION_FAILED smartCallbackDefaultDelayMinutes must be one of the following values: 30, 60, 120, 180 Any other number, or a string such as "60".
400 VALIDATION_FAILED Start date must be before end date
400 VALIDATION_FAILED At least one time window must be provided timeWindows is [].
400 VALIDATION_FAILED Time ranges must be provided for day N A day has "time": [].
400 VALIDATION_FAILED Start time must be before end time for day N
400 VALIDATION_FAILED retryInterval must be at least 300000 ms (5 minutes) when maxAttempts is more than 1 Retries are on and retryInterval is under 5 minutes. With retries off, a value from 1 to 299999 is also rejected (the message ends in (or 0)): send 0 or leave it out.
400 VALIDATION_FAILED Unknown voice: <key> A ttsVoiceKeys entry isn’t in the voice catalog.
400 VALIDATION_FAILED Unknown caller ID: <number> A callerIds entry isn’t one of your organization’s numbers.
400 VALIDATION_FAILED Unknown SIP account sipAccountId isn’t one of your organization’s SIP accounts.
400 VALIDATION_FAILED Cannot set caller ID without specifying a SIP account sipCallerId was sent without sipAccountId.
400 VALIDATION_FAILED The specified caller ID does not belong to the selected SIP account sipCallerId isn’t in that SIP account.
400 VALIDATION_FAILED Duplicate call alert is not enabled for this organization removeDuplicates: true, but the feature is off.
400 VALIDATION_FAILED All recipients are duplicates within the configured window removeDuplicates would leave nobody to call. The campaign stays DRAFT.
404 CAMPAIGN_NOT_FOUND Campaign not found Wrong id, or the campaign belongs to another organization.
409 CAMPAIGN_ALREADY_STARTED Campaign has already been started (current status: …) The campaign isn’t DRAFT. A campaign can be started once. Create a new one to call people again.
403 CALLING_NOT_ALLOWED Your organization is not allowed to make calls. Gowajee hasn’t approved your organization to make calls yet, or calling was turned off. Contact Gowajee. See Before your organization is approved.