> ## Documentation Index
> Fetch the complete documentation index at: https://docs.weya.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Campaign

> Delete a completed campaign and remove it from your campaign list.

## Overview

Delete a campaign you no longer need. Only a `completed` campaign can be deleted; a campaign that is still running, paused or waiting for its calling window can't.

A deleted campaign no longer appears in [Get Campaigns](https://docs.weya.ai/api-reference/Campaigns/getBatch.md) and can't be retrieved or restored through the API. Any Google Sheet connected to it is disconnected.

## Prerequisites

* An API key for your workspace
* A `completed` campaign created by the user who owns the API key

## Request

**x-api-key** `string` *required*

Your workspace API key. Create one from the profile menu in the dashboard → **API Keys**.

**batchId** `string` *required*

ID of the campaign to delete.

```bash cURL theme={null}
curl --location --request DELETE 'https://api.weya.live/backend/api/call/delete-batch/6880bac05860c9b91c53c790' \
  --header 'x-api-key: YOUR_API_KEY'
```

## Response

```json 200 OK theme={null}
{
  "status": true,
  "code": 200,
  "message": "Batch deleted successfully",
  "errorMessage": null,
  "data": []
}
```

**status** `boolean` *required*

`true` when the campaign was deleted.

**message** `string` *required*

`Batch deleted successfully`.

## Error Handling

Errors return `status: false`, with the reason in `errorMessage`.

* **400 Bad Request**
  * `Invalid Batch ID`.
  * `Batch is not completed or stopped` – the campaign hasn't finished. Wait until it is `completed`.
* **401 Unauthorized** – Missing or invalid API key.
* **404 Not Found** – `Batch not found`: the campaign doesn't exist, is already deleted, or wasn't created by the user who owns the API key.
* **500 Internal Server Error** – Unexpected server error.

> [!WARNING]
>
> This can't be undone through the API. If you need the call data, export it first with `GET /api/call/export/csv?batchId={batchId}&format=csv&columns=[...]`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.