---
title: "Delete a Document"
description: "Use this endpoint with the DELETE* method to delete one document from the database:"
url: "https://docs.ravendb.net/6.2/client-api/rest-api/document-commands/delete-document"
version: "6.2"
---

# Delete a Document

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## Delete a Document

> **Note**
>
> - Use this endpoint with the `**DELETE**` method to delete one document from the database:  
>   `<server URL>/databases/<database name>/docs?id=<document ID>`
>
> - In this page:
>   - [Example](#example)
>   - [Request Format](#request-format)
>   - [Response Format](#response-format)

## Example

This is a cURL request to delete the document "employees/1-A" from a database named "Example" on our
[playground server](http://live-test.ravendb.net):

```bash
curl -X DELETE "http://live-test.ravendb.net/databases/Example/docs?id=employees/1-A"
```

Response:

```http
HTTP/1.1 204
status: 204
Server: nginx
Date: Tue, 27 Aug 2019 11:40:12 GMT
Connection: keep-alive
Raven-Server-Version: 4.2.3.42
```

## Request Format

This is the general format of the cURL request:

```bash
curl -X DELETE "<server URL>/databases/<database name>/docs?id=<document ID>"
--header "If-Match: <expected change vector>"
```

| Query Parameters | Description | Required |
| - | - | - |
| **id** | ID of a document to be deleted. | Yes |

| Headers | Description | Required |
| - | - | - |
| **If-Match** | Expected [change vector](https://docs.ravendb.net/6.2/server/clustering/replication/change-vector.md). If it matches the server-side change vector the document is deleted, if they don't match a concurrency exception is thrown. | No |

## Response Format

| Header | Description |
| - | - |
| **Content-Type** | MIME media type and character encoding. This should always be: `application/json; charset=utf-8`. |
| **Raven-Server-Version** | Version or RavenDB the responding server is running |

| HTTP Status Code | Description |
| - | - |
| `204` | The document was successfully deleted, *or* no document with the specified ID exists. |
| `409` | The change vector submitted did not match the server-side change vector. A concurrency exception is thrown. |
