---
title: "DELETE: Deletes a document from the collection"
method: DELETE
path: "/{collection}/{identifier}"
tags: ["generic"]
---

# DELETE: Deletes a document from the collection

`DELETE /{collection}/{identifier}`

If the document has already been deleted, the operation will succeed anyway. Normally, documents are not really deleted from the collection but they are only marked as deleted. For special cases the deletion can be irreversible using `permanent` parameter.

This operation provides autopruning of the collection (if autopruning is enabled).

This operation requires `delete` permission for the API and the collection (e.g. `api:treatments:delete`)

## Query parameters

- `permanent` boolean

## Response `204`

Successful operation - empty response

## Other responses

- `401` — The request was not successfully authenticated using access token or JWT, or the request has missing `Date` header or it contains an expired timestamp, so that the request cannot continue due to the security policy.
- `403` — Insecure HTTP scheme used or the request has been successfully authenticated, but the security subject is not authorized for the operation.
- `404` — The collection or document specified was not found.
- `422` — The client request is well formed but a server validation error occured. Eg. when trying to modify or delete a read-only document (having `isReadOnly=true`).

## Changes

- **2019-11-02** `6b2eb690f4ab` — 1 info
  - added the non-success response with the status `422`
- **2019-10-09** `e3a793475629` — 4 breaking, 7 info
  - removed the media type `application/json` for the response with the status `401`
  - removed the media type `application/json` for the response with the status `403`
  - removed the media type `application/json` for the response with the status `404`
  - removed the success response with the status `200`
  - …7 more

[Change history](https://skmtc.dev/nightscout/apis/nightscout-api/changes/:collection/:identifier/delete.md)

---

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