:doc:`QBusiness <../../qbusiness>` / Client / batch_delete_document

*********************
batch_delete_document
*********************



.. py:method:: QBusiness.Client.batch_delete_document(**kwargs)

  

  Asynchronously deletes one or more documents added using the ``BatchPutDocument`` API from an Amazon Q Business index.

   

  You can see the progress of the deletion, and any error messages related to the process, by using CloudWatch.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/BatchDeleteDocument>`_  


  **Request Syntax**
  ::

    response = client.batch_delete_document(
        applicationId='string',
        indexId='string',
        documents=[
            {
                'documentId': 'string'
            },
        ],
        dataSourceSyncId='string'
    )
    
  :type applicationId: string
  :param applicationId: **[REQUIRED]** 

    The identifier of the Amazon Q Business application.

    

  
  :type indexId: string
  :param indexId: **[REQUIRED]** 

    The identifier of the Amazon Q Business index that contains the documents to delete.

    

  
  :type documents: list
  :param documents: **[REQUIRED]** 

    Documents deleted from the Amazon Q Business index.

    

  
    - *(dict) --* 

      A document deleted from an Amazon Q Business data source connector.

      

    
      - **documentId** *(string) --* **[REQUIRED]** 

        The identifier of the deleted document.

        

      
    

  :type dataSourceSyncId: string
  :param dataSourceSyncId: 

    The identifier of the data source sync during which the documents were deleted.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'failedDocuments': [
              {
                  'id': 'string',
                  'error': {
                      'errorMessage': 'string',
                      'errorCode': 'InternalError'|'InvalidRequest'|'ResourceInactive'|'ResourceNotFound'
                  },
                  'dataSourceId': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **failedDocuments** *(list) --* 

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

        
        

        - *(dict) --* 

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

          
          

          - **id** *(string) --* 

            The identifier of the document that couldn't be removed from the Amazon Q Business index.

            
          

          - **error** *(dict) --* 

            An explanation for why the document couldn't be removed from the index.

            
            

            - **errorMessage** *(string) --* 

              The message explaining the Amazon Q Business request error.

              
            

            - **errorCode** *(string) --* 

              The code associated with the Amazon Q Business request error.

              
        
          

          - **dataSourceId** *(string) --* 

            The identifier of the Amazon Q Business data source connector that contains the failed document.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`QBusiness.Client.exceptions.InternalServerException`

  
  *   :py:class:`QBusiness.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`QBusiness.Client.exceptions.ConflictException`

  
  *   :py:class:`QBusiness.Client.exceptions.ThrottlingException`

  
  *   :py:class:`QBusiness.Client.exceptions.ValidationException`

  
  *   :py:class:`QBusiness.Client.exceptions.AccessDeniedException`

  