---
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 `200`

The request was successfully processed

- object
  - `status` integer

## Other responses

- `401` — The request was not successfully authenticated using JWT, 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

- **2026-07-17** `5b0d424433e1` — 1 info
  - the endpoint scheme security `accessToken` was removed from the API
- **2021-01-07** `8252719e8e34` — 1 breaking, 8 info
  - removed the success response with the status `204`
  - the endpoint scheme security `accessToken` was added to the API
  - the endpoint scheme security `jwtoken` was added to the API
  - the endpoint scheme security `apiKeyAuth` was removed from the API
  - …5 more
- **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-service-production.skmtc.workers.dev/v1/apis/nightscout/nightscout-api/revisions/5b0d424433e1/schema)
