Pause a campaign
POST
https://api.voice-agent.gowajee.ai/api/campaign/:id/pauseSets a SCHEDULED or RUNNING campaign to PAUSED. No new calls are dialled.
- Calls waiting to be dialled (
SCHEDULED,QUEUED,INITIATED) are kept asSCHEDULEDand continue after resume. Retries that are still due also continue after resume. - Calls already ringing or in a conversation finish normally. Pause never hangs up on a customer.
Path parameters
Section titled “Path parameters”| Name | Description |
|---|---|
id |
The campaign ID. |
No request body.
Request
Section titled “Request”curl -X POST "https://api.voice-agent.gowajee.ai/api/campaign/eac2489c-672c-455e-ab8c-4e0ecd18d7dc/pause" \ -H "X-API-Key: $GOWAJEE_API_KEY"const res = await fetch(`https://api.voice-agent.gowajee.ai/api/campaign/${campaignId}/pause`, { method: 'POST', headers: { 'X-API-Key': process.env.GOWAJEE_API_KEY },});res = requests.post( f"https://api.voice-agent.gowajee.ai/api/campaign/{campaign_id}/pause", headers={"X-API-Key": os.environ["GOWAJEE_API_KEY"]}, timeout=30,)Response
Section titled “Response”{ "success": true, "message": "Campaign status updated to PAUSED successfully", "data": { "id": "eac2489c-672c-455e-ab8c-4e0ecd18d7dc", "status": "PAUSED" }}data.status is the campaign’s status after the request.
{ "success": true, "message": "Campaign is already PAUSED", "data": { "id": "eac2489c-672c-455e-ab8c-4e0ecd18d7dc", "status": "PAUSED" }}Pausing a campaign that is already PAUSED succeeds and changes nothing, so it is safe to send twice.
{ "success": false, "statusCode": 409, "code": "INVALID_CAMPAIGN_STATE", "message": "Cannot pause a COMPLETED campaign", "errors": ["Cannot pause a COMPLETED campaign"]}{ "success": false, "statusCode": 404, "code": "CAMPAIGN_NOT_FOUND", "message": "Campaign not found", "errors": ["Campaign not found"]}Errors
Section titled “Errors”The body is the usual error envelope.
| Status | code |
message |
Cause |
|---|---|---|---|
400 |
INVALID_ID |
id must be a valid UUID |
The id in the path isn’t a UUID. |
404 |
CAMPAIGN_NOT_FOUND |
Campaign not found |
Wrong id, or the campaign belongs to another organization. |
409 |
INVALID_CAMPAIGN_STATE |
Cannot pause a <STATUS> campaign |
Only a SCHEDULED or RUNNING campaign can be paused. DRAFT, COMPLETED, CANCELLED and EXPIRED can’t. See State rules. |