---
title: "Delete a campaign"
method: DELETE
path: "/v1/ads/campaigns/{campaignId}"
tags: ["Ad Campaigns"]
---

# Delete a campaign

`DELETE /v1/ads/campaigns/{campaignId}`

Deletes the whole campaign on the platform, cascading to its ad sets
and ads. Locally, all Ad documents for this campaign are marked
`status: cancelled`.

**Empty campaigns.** A campaign with zero ads has no local Ad documents
to resolve, so it is invisible to `/v1/ads/tree` and this endpoint would
404. That state is produced by the two-step create flow (campaign, then
ads via `existingCampaignId`) whenever Meta rejects the ad step. To
delete such a shell, send `accountId` in the body: we skip the local
lookup entirely and forward the delete to Meta. `accountId` is ignored
when the campaign does have ads.

## Path parameters

- `campaignId` string, required

## Request body

- object
  - `platform` 'facebook' | 'instagram', required
  - `accountId` string — Zernio SocialAccount id owning the ad account. Required only to delete an EMPTY campaign (zero ads), which has no local Ad documents to resolve a token from.

## Response `200`

Campaign deleted

- object
  - `deleted` boolean
  - `adCount` integer — Number of local Ad docs marked cancelled

## Other responses

- `401` — Unauthorized
- `404` — Campaign not found
- `501` — Operation not supported on this platform

---

[API](https://skmtc.net/zernio/apis/zernio-api.md) · [All operations](https://skmtc.net/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zernio/zernio-api/revisions/875093317201/schema)
