Delete a campaign
Changed onDeletes a campaign on its platform, including a campaign that never got any ads.
Only the campaign itself is sent to the platform. Meta, Google, TikTok, LinkedIn and X delete it; OpenAI, Reddit and Pinterest have no campaign delete and archive it instead (see below). 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 or the query string: we skip the local lookup entirely and forward the delete to the platform of that connection. Google, TikTok, LinkedIn, Pinterest and Reddit take the ad account from the synced campaign (OpenAI needs none); when the campaign was never synced (or is synced under several ad accounts) the answer is 409 invalid_resource_state on campaignId and nothing is deleted: sync the ad account and retry. Before deleting on Google, TikTok, LinkedIn, Pinterest, OpenAI or Reddit, Zernio asks the platform whether the campaign still holds ad groups or ads (Google asset groups count; on LinkedIn, campaigns inside the campaign group). If it does, or the platform cannot confirm it has none (a TikTok Smart+ campaign), the answer is 409 invalid_resource_state on campaignId and nothing is deleted: sync the ad account and delete the campaign again so its ads are cancelled with it, or delete them on the platform first. On X the ad account comes from the synced campaign, which wins over adAccountId; when the campaign was never synced, send adAccountId too. Before deleting, Zernio asks X whether the campaign still holds undeleted line items (ads not synced yet); if it does the answer is 409 invalid_field_value on campaignId and nothing is deleted. Sync the ad account and retry when those line items hold promoted posts; line items without promoted posts never sync, so delete them in X Ads Manager first. accountId is ignored when the campaign does have ads.
Reddit Ads has no delete: the campaign is archived instead (configured_status ARCHIVED), which stops delivery for good. Its ad groups and ads keep their own switches but cannot deliver under an archived campaign.
OpenAI Ads has no delete either: the campaign is archived (state archive). Its ad groups and ads are not touched on OpenAI.
Request
- Base URL: https://zernio.com/api
- URL: https://zernio.com/api/v1/ads/campaigns/{campaignId}
- Auth: HTTP bearer
Path parameters
Platform campaign ID
Request body
Response
Campaign deleted
Changes
- info
added the non-success response with the status
- info
- info
added the new optional request property
- info
added the new
linkedinenum value to the request property - info
added the new
openaienum value to the request property - info
added the new
pinterestenum value to the request property - info
added the new
redditenum value to the request property - info
added the new
tiktokenum value to the request property - info
added the new
twitterenum value to the request property
- info