Skip to content
AdCrunch
Esc
navigateopen⌘Jpreview

Delete a document

Deletes a document and its bytes. AdCrunch deletes the record first. Therefore a failure in the middle leaves bytes with no record, and never a record with no bytes.

DELETE/context/brands/{slug}/documents/{documentId}
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
documentIdstringrequired
matches ^doc_[\s\S]{0,}$
slugstringrequired
Responses
204

Deleted. If this Document was the Brand’s nominated logo, that nomination is cleared — the clearing is done here rather than by the database, because the row is soft-deleted and a delete action would never fire.

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 brand: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 Document on this Brand. 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.

Request
curl -X DELETE "https://api.adcrunch.dev/context/brands/string/documents/string" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
Deleted. If this Document was the Brand’s nominated logo, that nomination is cleared — the clearing is done here rather than by the database, because the row is soft-deleted and a delete action would never fire.