---
search:
  tags:
    - Documents
    - DELETE
seo:
  description: >-
    Deletes a document and its bytes. This operation takes… Reference for the
    DELETE /context/brands/{slug}/documents/{documentId} endpoint in the
    AdCrunch API.
sidebar:
  label: Delete a document
  badge: DELETE
title: Delete a document
type: openapi-operation
---
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}`

**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.
- `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\`.
