Campaign lifecycle
Campaign statuses
Section titled “Campaign statuses”| Status | Meaning | What you can do |
|---|---|---|
| DRAFT | Created, not started. No calls exist yet. | Start, cancel |
| SCHEDULED | Started, waiting for startDateTime or its first calling window. |
Pause, cancel |
| RUNNING | Calling. It stays RUNNING between calling windows and while retries wait. |
Pause, cancel |
| PAUSED | Stopped by you. Waiting calls are kept. | Resume, cancel |
| COMPLETED | Everyone has a final result and no retries are left. | — |
| CANCELLED | Stopped by you, for good. | — |
| EXPIRED | endDateTime passed before the campaign completed. |
— |
COMPLETED, CANCELLED and EXPIRED are final. Nothing leaves them: no action or scheduler run changes the
status again.
The colors match the ones in the Gowajee dashboard.
State rules
Section titled “State rules”Each action is allowed only from some statuses:
| Action | Moves the campaign to | Allowed from | Already there (returns 200, changes nothing) |
Any other status |
|---|---|---|---|---|
| Pause | PAUSED |
SCHEDULED, RUNNING |
PAUSED |
409 INVALID_CAMPAIGN_STATE |
| Resume | SCHEDULED |
PAUSED |
SCHEDULED, RUNNING |
409 INVALID_CAMPAIGN_STATE |
| Cancel | CANCELLED |
DRAFT, SCHEDULED, RUNNING, PAUSED |
CANCELLED |
409 INVALID_CAMPAIGN_STATE |
- Already there means the campaign is already in the status you asked for. The request succeeds and nothing
changes: no calls are touched. Resume on a
RUNNINGcampaign counts as already there.data.statusin the response tells you the status it is in. - The
409message names the action and the current status, for exampleCannot pause a COMPLETED campaign. - If two requests race (for example pause and cancel at the same time), one wins. The other gets
200if the campaign ended up in the status it asked for, and409otherwise.
Gowajee’s scheduler makes the other moves:
| Move | From | When |
|---|---|---|
to RUNNING |
SCHEDULED |
startDateTime has passed and it is inside a calling window. |
to COMPLETED |
RUNNING |
No call is waiting or in progress, and nobody is due a retry. See below. |
to EXPIRED |
SCHEDULED, RUNNING, PAUSED |
endDateTime has passed. |
Start is its own endpoint: it moves DRAFT to SCHEDULED, once.
Starting a campaign
Section titled “Starting a campaign”POST /api/campaign/:id/schedule moves a DRAFT campaign to SCHEDULED and prepares one
call per recipient. About every 30 seconds, Gowajee’s scheduler picks up campaigns whose start time has passed. It
dials as many recipients at once as your organization’s limit allows, and only inside the calling hours. The limit is
shared by all your running campaigns.
Pause, resume, cancel
Section titled “Pause, resume, cancel”| Action | What happens to calls |
|---|---|
| Pause | Calls that are still waiting (SCHEDULED, QUEUED, INITIATED) go back to SCHEDULED. Calls already ringing or talking finish normally. |
| Resume | The campaign goes back to SCHEDULED, and the waiting calls and due retries are dialled on the next scheduler run inside a calling window. Use it on a paused campaign. |
| Cancel | Waiting calls become CANCELLED, and no webhook is sent for them. Calls already ringing or talking finish normally. This can’t be undone. |
When does a campaign complete?
Section titled “When does a campaign complete?”A RUNNING campaign becomes COMPLETED when both are true:
- no call is waiting or in progress (including
ANALYZING), and - nobody is still due a retry. A retry is due when someone’s latest call is
NO_ANSWER,BUSY,FAILEDorCANCELLED, they still have attempts left, and they haven’t been reached in this campaign.
While the last retries wait for their interval, the campaign stays RUNNING.
The scheduler checks this only inside the calling hours. So if the last call ends near the end of the last calling
window before endDateTime, the campaign can become EXPIRED even though every call has finished.
Recipient status
Section titled “Recipient status”A recipient’s latestCallStatus is the status of their newest call, and callAttempt counts how many times they
have been dialled. GET /api/campaign/:id/recipients returns both for everyone in a
campaign. See Statuses for every call status, and
Call lifecycle for how one call moves and what triggers each change.