Skip to content

Cancel a campaign

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

Sets the campaign to CANCELLED. This cannot be undone. You can cancel a campaign that is DRAFT, SCHEDULED, RUNNING or PAUSED.

  • Calls waiting to be dialled become CANCELLED. No webhook is sent for them.
  • Calls already ringing or in a conversation finish normally, and their results are still delivered.
  • To only stop for a while, use pause instead.
Name Description
id The campaign ID.

No request body.

curl -X POST "https://api.voice-agent.gowajee.ai/api/campaign/eac2489c-672c-455e-ab8c-4e0ecd18d7dc/cancel" \
-H "X-API-Key: $GOWAJEE_API_KEY"
{
"success": true,
"message": "Campaign status updated to CANCELLED successfully",
"data": {
"id": "eac2489c-672c-455e-ab8c-4e0ecd18d7dc",
"status": "CANCELLED"
}
}

data.status is the campaign’s status after the request.

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 cancel a <STATUS> campaign A COMPLETED or EXPIRED campaign can’t be cancelled. It has already finished. See State rules.