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

# Delete Campaign

> Permanently delete a campaign

<Warning>
  Campaigns with status `sending` cannot be deleted. All other statuses (`scheduled`, `sent`, `partially_sent`, `failed`) can be deleted.
</Warning>

## Headers

<ParamField header="Authorization" type="string" required>
  `Bearer YOUR_API_KEY`
</ParamField>

<ParamField header="X-Project-ID" type="string">
  Your project UUID. Not required if the API key already encodes the project.
</ParamField>

## Path Parameters

<ParamField path="campaignId" type="string" required>
  Campaign UUID to delete
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  `true` on successful deletion
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable confirmation
</ResponseField>

<ResponseField name="campaignId" type="string">
  ID of the deleted campaign
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "X-Project-ID: YOUR_PROJECT_ID"
  ```

  ```typescript SDK theme={null}
  import { GatelyCampaigns } from '@gately/sdk'

  const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
  await campaigns.delete('CAMPAIGN_ID')
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "success": true,
    "message": "Campaign deleted successfully",
    "campaignId": "a1b2c3d4-e5f6-4789-abcd-ef1234567890"
  }
  ```

  ```json Currently sending theme={null}
  {
    "error": "Cannot delete campaign that is currently sending"
  }
  ```

  ```json Not found theme={null}
  {
    "error": "Campaign not found"
  }
  ```
</ResponseExample>
