# Delete a campaign (/en/api-reference/api-ref/conversational-ai/platform/delete-campaign)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

> Documentation: Conversational AI API.
> Documentation version: Preview.
> This document describes only this version. [Version index](/llms/doc-versions-convoai-api-v2.txt).


Deletes a finished campaign and its contacts.

- OpenAPI: /openapi/conversational-ai/rest-api-platform.en.yaml
- Operation ID: delete-campaign
- Method: DELETE
- Path: /v1/projects/{appid}/campaigns/{campaign_id}
- Endpoint: https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}/campaigns/{campaign_id}

## Servers

- https://preview.ai.agora.io/conversational-ai

You can't delete a campaign that is `scheduled`, `running`, or `paused`. [Cancel it](/en/api-reference/api-ref/conversational-ai/platform/cancel-campaign) first.


## Authorization

This endpoint requires authentication.

- `tokenAuth`
- `basicAuth`

## Parameters

- `appid` (path, required, string) - The App ID of your project.
- `campaign_id` (path, required, string) - The ID of the campaign, returned in `campaign_id` when you create the campaign.
  - Format: `uuid`

## Request body

No request body.

## Responses

### 200

The campaign was deleted.

- `deleted` (boolean, required) - Always `true`. The resource is deleted.
### 401

Authentication is missing or invalid. The reason is `InvalidPermission`.

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).
### 404

The resource in the path doesn't exist. The reason is `ResourceNotFound`.

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).
### 409

`CampaignActive`: The campaign is `scheduled`, `running`, or `paused`, or it still has calls in progress. Cancel it, and wait for its calls to end before you delete it.

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).
### default

The request failed. The response body contains the `reason` and `detail` of the failure. For possible reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).
