---
title: "Delete a document"
method: DELETE
path: "/context/brands/{slug}/documents/{documentId}"
tags: ["Documents"]
---

# Delete a document

`DELETE /context/brands/{slug}/documents/{documentId}`

## Request

- Base URL: `https://api.adcrunch.dev`
- URL: `https://api.adcrunch.dev/context/brands/{slug}/documents/{documentId}`
- Auth: HTTP bearer

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.

## Path parameters

- `documentId` string, required
- `slug` string, required

## Response `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`.

## Other responses

- `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.
- `401`: No API key, or one that does not resolve. See the security scheme. `error` is `unauthorized`.
- `402`: The organization has no active subscription. An owner subscribes at `paywallUrl`. `error` is `organization_unentitled`.
- `403`: The caller does not hold `brand:write`. `error` is `forbidden`.
- `404`: No such Document on this Brand. `error` is `not_found`.

---

[API](https://skmtc.dev/adcrunch/apis/adcrunch-api.md) · [All operations](https://skmtc.dev/adcrunch/apis/adcrunch-api/llms.txt) · [OpenAPI document](https://skmtc.dev/adcrunch/apis/adcrunch-api/revisions/a420ba80914f?raw)
