# Delete campaign

> Delete a campaign with its ad sets and ads.

Canonical: <https://www.tryadeli.com/docs/api/ads/delete-campaign>

`DELETE https://app.tryadeli.com/api/v1/ads/campaigns/{campaignId}`

Authorization: `Bearer <API key>` — see [Authentication](https://www.tryadeli.com/docs/authentication)

Deletes a campaign together with its ad sets and ads, which stops any delivery
immediately. It cannot be undone. The campaign must belong to `adAccountId`;
otherwise the response is `404 campaign_not_found` and nothing is deleted.
Responds `204`. Adeli's record of a campaign it created is marked `deleted`.

**Path parameters**

| Name         | Type     | Required | Description         |
| ------------ | -------- | -------- | ------------------- |
| `campaignId` | `string` | Yes      | A Meta campaign id. |

**Query parameters**

| Name          | Type     | Required | Description                                              |
| ------------- | -------- | -------- | -------------------------------------------------------- |
| `adAccountId` | `string` | Yes      | The ad account the campaign belongs to.                  |
| `accountId`   | `uuid`   |          | A connected Facebook account. Defaults to the profile's. |

## Request examples

**cURL**

```bash
curl --fail-with-body -X DELETE "https://app.tryadeli.com/api/v1/ads/campaigns/120210000000000001?adAccountId=act_1234567890&accountId=00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer $ADELI_API_KEY"
```

**JavaScript**

```javascript
const response = await fetch("https://app.tryadeli.com/api/v1/ads/campaigns/120210000000000001?adAccountId=act_1234567890&accountId=00000000-0000-0000-0000-000000000000", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.ADELI_API_KEY}`,
  },
});
console.log(response.status); // 204: no body
```

**Python**

```python
import os

import requests

response = requests.delete(
    "https://app.tryadeli.com/api/v1/ads/campaigns/120210000000000001",
    headers={"Authorization": f"Bearer {os.environ['ADELI_API_KEY']}"},
    params={
        "adAccountId": "act_1234567890",
        "accountId": "00000000-0000-0000-0000-000000000000",
    },
)
print(response.status_code)  # 204: no body
```

## Responses

### 204 No Content

```text
(empty body)
```

### 404

```json
{
  "error": {
    "code": "campaign_not_found",
    "message": "That campaign does not belong to this ad account"
  }
}
```
