Delete an ad set
Deletes the ad set on the platform, cascading to its ads only (never the
campaign). Locally, every Ad document under the ad set is marked
status: cancelled.
Delete is soft on platforms that have no hard delete: LinkedIn moves the
campaign to PENDING_DELETION, Pinterest archives the ad group, and X
soft-flags the line item. Google removes the ad group. All remain readable
for reporting.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Platform ad set ID
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.adcampaigns.deleteAdSet({ path: { adSetId: 'adset_abc123', },});console.log(data);{
"deleted": true,
"adCount": 0
}{
"error": "Unauthorized"
}Delete a campaign DELETE
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.
Cancel an ad DELETE
Cancels the ad on the platform and marks it as cancelled in the database. The ad is preserved for history. OpenAI Ads has no delete API; the ad is archived instead (a terminal state, the closest equivalent).