BatchDeleteDocument - Amazon Kendra


Removes one or more documents from an index. The documents must have been added with the BatchPutDocument operation.

The documents are deleted asynchronously. You can see the progress of the deletion by using AWS CloudWatch. Any error messages related to the processing of the batch are sent to you CloudWatch log.

Request Syntax

{ "DataSourceSyncJobMetricTarget": { "DataSourceId": "string", "DataSourceSyncJobId": "string" }, "DocumentIdList": [ "string" ], "IndexId": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.


Maps a particular data source sync job to a particular data source.

Type: DataSourceSyncJobMetricTarget object

Required: No


One or more identifiers for documents to delete from the index.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 10 items.

Length Constraints: Minimum length of 1. Maximum length of 2048.

Required: Yes


The identifier of the index that contains the documents to delete.

Type: String

Length Constraints: Fixed length of 36.

Pattern: [a-zA-Z0-9][a-zA-Z0-9-]*

Required: Yes

Response Syntax

{ "FailedDocuments": [ { "ErrorCode": "string", "ErrorMessage": "string", "Id": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


A list of documents that could not be removed from the index. Each entry contains an error message that indicates why the document couldn't be removed from the index.

Type: Array of BatchDeleteDocumentResponseFailedDocument objects


For information about the errors that are common to all actions, see Common Errors.


HTTP Status Code: 400


HTTP Status Code: 400


HTTP Status Code: 500


HTTP Status Code: 400


HTTP Status Code: 400


HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: