Skip to content
AdCrunch
Esc
↑↓navigate↵open⌘Jpreview

Delete a Line Item

Deletes a Line Item. Send the base_revision you read. If the Campaign Plan was approved, this call puts the Campaign Plan back into draft, because the allocation is no longer the one that a person approved.

AdCrunch keeps the record of what the line already created. Those provider objects are live in an ad account, and this call does not remove them.

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

Send Authorization: Bearer <credential>.

Use an API key (acr_…), from the AdCrunch console under Settings → API keys.

The credential names the organization, and no operation takes an organization parameter.

See https://docs.adcrunch.dev/api/authentication.

Path parameters
lineItemIdstringrequired
matches ^lni_[\s\S]{0,}$
slugstringrequired
Query parameters
base_revisionintegerrequired
min -9007199254740991 · max 9007199254740991
Responses
204

Deleted. An approved plan returns to draft, and the Campaign Plan’s own revision moves — so re-read it before your next guarded write against it.

400

The request does not match the schema of this operation: a field is missing or has the wrong type, or the body is not valid JSON. error is invalid_request, and issues names each field. Nothing was changed.

issuesobject[]required

One entry for each field that does not match.

Show properties
Array of object
instringrequired

The part of the request that holds the field.

Allowed:bodycookieheadersparamsquery
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.

pathstringrequired

A JSON Pointer into that part of the request, such as /filename. An empty string is the whole part.

errorstringrequired

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

Allowed:invalid_request
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.

401

No API key, or one that does not resolve. 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 such plan, or no Line Item with that id on it. 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 Line Item moved since you read it. error is revision_mismatch.

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.

Request
curl -X DELETE "https://api.pr-701.adcrunch.dev/context/campaign-plans/string/line-items/string?base_revision=-9007199254740991" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
Deleted. An approved plan returns to `draft`, and the Campaign Plan’s own revision moves — so re-read it before your next guarded write against it.