Skip to main content

Delete Multiple Documents from an Index

Use this API endpoint to remove multiple documents from your AddSearch index in a single request.

Endpoint

DELETE /v2/indices/{index_public_key}/documents:batch

Replace {index_public_key} with your specific index public key.

Request Payload

Send a JSON object containing an array of document IDs to delete. Each document ID should be the MD5 hash of the document's URL or the stored document identifier.

{
"documents": [
"a9b9f04336ce0181a08e774e01113b31",
"68486f8ffd0f928de748de19b663c60a"
]
}
FieldDescriptionTypeNotes
documentsArray of document IDs to deleteArray of StringsEach ID is typically an MD5 hash of the document URL.

Response

  • Success: Returns HTTP status 202 Accepted to indicate the deletion request has been queued.

  • Errors: Returns appropriate HTTP error codes and messages if the request is invalid or if authentication fails.

Notes

  • Ensure you include proper authentication headers as required by the AddSearch API.
  • Check your plan limits for batch sizes or rate restrictions.

Example cURL Request

curl -X DELETE "https://api.addsearch.com/v2/indices/{index_public_key}/documents:batch" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"documents": [
"a9b9f04336ce0181a08e774e01113b31",
"68486f8ffd0f928de748de19b663c60a"
]
}'

Replace YOUR_API_KEY with your actual API key.

For more details on API authentication and usage, see the AddSearch API documentation.