Core
API v2.x
2

delete #

Deletes a document.


Query Syntax #

HTTP #

Copied to clipboard!
URL: http://kuzzle:7512/<index>/<collection>/<documentId>[?refresh=wait_for][&source][&silent]
Method: DELETE

Other protocols #

Copied to clipboard!
{
  "index": "<index>",
  "collection": "<collection>",
  "controller": "document",
  "action": "delete",
  "_id": "<documentId>"
}

Arguments #

  • collection: collection name
  • documentId: document unique identifier
  • index: index name

Optional: #

  • refresh: if set to wait_for, Kuzzle will not respond until the deletion has been indexed
  • source: if set to true Kuzzle will return the deleted document body in the response.
  • silent: if set, then Kuzzle will not generate notifications
    Available since 2.9.2

Response #

Returns information about the deleted document:

  • _id: document unique identifier
  • _source: deleted document source, only if option source is set to true
Copied to clipboard!
{
  "status": 200,
  "error": null,
  "index": "<index>",
  "collection": "<collection>",
  "controller": "document",
  "action": "delete",
  "requestId": "<unique request identifier>",
  "result": {
    "_id": "<documentId>",
    "_source": "<deleted document>" // If `source` option is set to true
  }
}