Delete documents

POST /indexes/{indexUid}/documents/delete-batch

Delete a selection of documents based on array of document id's.

Headers

  • Content-Type string Required

    Payload content-type

    Value is application/json.

Path parameters

  • indexUid string Required

    Index Unique Identifier

application/json

Body Required

array[string | number] array[string | number]

An array of document ids to delete

Responses

  • 202 application/json

    Accepted

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
  • 404

    Not Found

POST /indexes/{indexUid}/documents/delete-batch
curl \
 -X POST https://example.meilisearch.com:7700/indexes/movies/documents/delete-batch \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '[1,2,3,"a string id"]'
Request example
# Headers
Content-Type: application/json

# Payload
[
  1,
  2,
  3,
  "a string id"
]
Response examples (202)
{
  "taskUid": 0,
  "indexUid": "movies",
  "status": "enqueued",
  "type": "documentDeletion",
  "enqueuedAt": "2021-01-01T09:39:00.000000Z"
}
Response examples (401)
{
  "message": "The Authorization header is missing. It must use the bearer authorization method.",
  "code": "missing_authorization_header",
  "type": "auth",
  "link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}