Cancel a campaign

Updated

Ends a campaign permanently.

Preview documentation

You're reading the Conversational AI Platform (Preview) docs. Switch to Main.
POST
https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}/campaigns/{campaign_id}:cancel

Canceling is permanent. Contacts that haven't been called change to canceled and are never dialed, and you can't resume the campaign.

Path Parameters

appidstring
Required

The App ID of your project.

campaign_idstring
Required

The ID of the campaign, returned in campaign_id when you create the campaign.

Response Body

The campaign was canceled. The response body contains the campaign.

Response Headers

Agora-Request-Idstring

A unique ID for the request. Include it when you contact Agora support.

ETagstring

The current version of the resource. Pass this value in the If-Match header of your next update or delete request for this resource.

campaign_idstring

The ID of the campaign, a UUID.

namestring

The name of the campaign.

statusstring

The status of the campaign:

  • scheduled: The campaign is waiting for its start time.
  • running: The campaign is dialing, or can dial during its schedule.
  • paused: You paused the campaign.
  • completed: The campaign has finished.
  • canceled: You canceled the campaign.
  • failed: The campaign failed. The details are in failure.
agent_idstring

The ID of the agent that makes the calls.

transportobject
lifecycleobject

When each session the campaign starts ends on its own.

scheduleImmediate | Scheduled

When the campaign dials. Pass the fields of one schedule mode only.

countsobject

The number of contacts in each state. Retrieve the campaign to get current counts.

create_tsinteger

The time the campaign was created, as a Unix timestamp in seconds.

start_tsinteger | null

The time the campaign started dialing, as a Unix timestamp in seconds. null before it starts.

complete_tsinteger | null

The time the campaign finished, as a Unix timestamp in seconds. null until it finishes.

failureobject | null

Details of the failure when status is failed. Otherwise null.

Authorization

This endpoint requires authentication.

Request examples

Example Request
curl -X POST 'https://preview.ai.agora.io/conversational-ai/v1/projects/string/campaigns/497f6eca-6276-4993-bfeb-53cbbbba6f08:cancel'

Response example

Example Response
{  "campaign_id": "b4f0581e-f138-43a2-851c-a8f8d228bb37",  "name": "q3-renewals",  "status": "canceled",  "agent_id": "3f6c2a9e-8d1b-4e7a-9c55-0b2f7d1e4a10",  "transport": {    "type": "telephony",    "from": [      "92e68758-3d3a-4f27-8b93-3fd8d834467c"    ]  },  "schedule": {    "mode": "scheduled",    "timezone": "America/New_York",    "start": "2026-11-02T09:00",    "end": "2026-11-13T17:00"  },  "counts": {    "contacts": 1,    "pending": 0,    "calling": 0,    "completed": 0,    "failed": 0,    "canceled": 1  },  "create_ts": 1787673602,  "start_ts": null,  "complete_ts": 1787680000,  "failure": null}