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

# Delete Campaign

> Delete a campaign and all associated data.

Permanently delete a campaign and all associated data including contacts, executions, and schedules.

<Callout type="warning">
  Running campaigns cannot be deleted. Stop the campaign first using the stop endpoint.
</Callout>

<Callout type="error">
  This action is irreversible. All campaign data, contacts, and execution history will be permanently deleted.
</Callout>

### Path Parameters

* `campaign_id` (integer, required): The unique identifier of the campaign

### Response

```json Response theme={null}
{
  "message": "Campaign deleted successfully"
}
```

### What Gets Deleted

When you delete a campaign, the following data is permanently removed:

* Campaign configuration and settings
* All imported contacts
* Execution history and logs
* Schedule configurations
* Import history records

### Example Code

```bash cURL theme={null}
curl -X DELETE "https://api.burki.dev/api/v1/campaigns/42" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python Python theme={null}
import requests

response = requests.delete(
    "https://api.burki.dev/api/v1/campaigns/42",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)

if response.status_code == 200:
    print("Campaign deleted successfully")
else:
    print(f"Error: {response.json()}")
```

```javascript JavaScript theme={null}
const response = await fetch("https://api.burki.dev/api/v1/campaigns/42", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY"
  }
});

if (response.ok) {
  console.log("Campaign deleted successfully");
} else {
  const error = await response.json();
  console.error("Error:", error);
}
```

### Error Responses

| Status Code | Description                                    |
| ----------- | ---------------------------------------------- |
| 400         | Cannot delete running campaign - stop it first |
| 404         | Campaign not found                             |
| 401         | Unauthorized - invalid or missing API key      |

### Best Practices

* **Export data first** if you need to keep records of the campaign results
* **Stop running campaigns** before attempting to delete
* **Consider pausing** instead of deleting if you might need the campaign later


## OpenAPI

````yaml DELETE /api/v1/campaigns/{campaign_id}
openapi: 3.1.0
info:
  title: Burki
  description: A system that uses AI to answer customer Calls.
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/campaigns/{campaign_id}:
    delete:
      tags:
        - campaigns
      summary: Delete Campaign
      description: Delete a campaign and all associated data.
      operationId: delete_campaign_api_v1_campaigns__campaign_id__delete
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: integer
            title: Campaign Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````