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

Delete a document

Deletes a document and its bytes. This operation takes no base_revision: a Document holds no prose for two people to write over. 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>.

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
documentIdstringrequired
matches ^doc_[\s\S]{0,}$
slugstringrequired
Responses
204

Deleted. If this Document was the Brand’s nominated logo, AdCrunch clears that nomination — in the application rather than in the database, because the row is soft-deleted and a delete action would never fire. Clearing it moves the revision of the Brand, so a base_revision you read before this call now answers 409.

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 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.pr-701.adcrunch.dev/context/brands/string/documents/string" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
Deleted. If this Document was the Brand’s nominated logo, AdCrunch clears that nomination — in the application rather than in the database, because the row is soft-deleted and a delete action would never fire. **Clearing it moves the `revision` of the Brand**, so a `base_revision` you read before this call now answers `409`.