Skip to content
AdCrunch
Esc
navigateopen⌘Jpreview

Delete a Campaign Plan

Deletes a Campaign Plan and its Line Items. Send the base_revision you read. The slug becomes free again.

AdCrunch keeps the record of what those lines already created. Those provider objects are live in an ad account, and the deletion of a planning row does not remove them.

The answer is 409 with error=revision_mismatch if the plan changed after you read it.

DELETE/context/campaign-plans/{slug}
Authorization
AuthorizationBearer token · headerrequired

Send Authorization: Bearer <credential>. Two credentials work.

An API key (acr_…) is what a server integration uses. Create one in the AdCrunch console under Settings → API keys — see https://docs.adcrunch.dev/account/api-keys. A key is bound to the organization that was active when you created it, and it keeps acting on that organization whatever you do later. It carries the permissions of the member who created it.

A session issued by the AdCrunch sign-in flow also works, which is how the console calls this service from the browser.

Either way the organization comes from the credential. There is no organization parameter.

Path parameters
slugstringrequired
Query parameters
base_revisionintegerrequired
min -9007199254740991 · max 9007199254740991
Responses
204

Deleted, with its Line Items. What those lines already created is kept: those provider objects are live in somebody’s ad account and were never ours to withdraw.

401

No credential, or one that does not resolve. Send an API key or a session. See the security scheme. error is unauthorized.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:unauthorized
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

403

The caller does not hold campaign_plan:write. error is forbidden.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:forbidden
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

404

No Campaign Plan with that slug. error is not_found.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

409

The plan moved since you read it. error is revision_mismatch. Deleting a Line Item moves the plan too, so re-read before deleting the plan.

currentRevisionnumberrequired

The revision the row holds now. Re-read, re-apply your edit on top, and send this back as base_revision.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:revision_mismatch
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

422

The request did not match this operation’s schema. This is the framework’s own shape, not the error/message one.

errorsobject[]required

One entry per failing field.

foundanyrequired

What was sent.

messagestringrequired
onstringrequired

Which part of the request failed: body, query or params.

propertystringrequired

The field that failed.

typestringrequired
Allowed:validation
Request
curl -X DELETE "https://api.adcrunch.dev/context/campaign-plans/string?base_revision=-9007199254740991" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
Deleted, with its Line Items. What those lines already created is **kept**: those provider objects are live in somebody’s ad account and were never ours to withdraw.