Delete a Document


  • 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

This is a cURL request to delete the document "employees/1-A" from a database named "Example" on our playground server:

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

Response:

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:

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. 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.