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

**************
list_documents
**************



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

  

  A list of documents attached to an index.

  

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


  **Request Syntax**
  ::

    response = client.list_documents(
        applicationId='string',
        indexId='string',
        dataSourceIds=[
            'string',
        ],
        nextToken='string',
        maxResults=123
    )
    
  :type applicationId: string
  :param applicationId: **[REQUIRED]** 

    The identifier of the application id the documents are attached to.

    

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

    The identifier of the index the documents are attached to.

    

  
  :type dataSourceIds: list
  :param dataSourceIds: 

    The identifier of the data sources the documents are attached to.

    

  
    - *(string) --* 

    

  :type nextToken: string
  :param nextToken: 

    If the ``maxResults`` response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of documents.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of documents to return.

    

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

    
    ::

      {
          'documentDetailList': [
              {
                  'documentId': 'string',
                  'status': 'RECEIVED'|'PROCESSING'|'INDEXED'|'UPDATED'|'FAILED'|'DELETING'|'DELETED'|'DOCUMENT_FAILED_TO_INDEX',
                  'error': {
                      'errorMessage': 'string',
                      'errorCode': 'InternalError'|'InvalidRequest'|'ResourceInactive'|'ResourceNotFound'
                  },
                  'createdAt': datetime(2015, 1, 1),
                  'updatedAt': datetime(2015, 1, 1)
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **documentDetailList** *(list) --* 

        A list of document details.

        
        

        - *(dict) --* 

          The details of a document within an Amazon Q Business index.

          
          

          - **documentId** *(string) --* 

            The identifier of the document.

            
          

          - **status** *(string) --* 

            The current status of the document.

            
          

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

            An error message associated with the document.

            
            

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

              The message explaining the Amazon Q Business request error.

              
            

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

              The code associated with the Amazon Q Business request error.

              
        
          

          - **createdAt** *(datetime) --* 

            The timestamp for when the document was created.

            
          

          - **updatedAt** *(datetime) --* 

            The timestamp for when the document was last updated.

            
      
    
      

      - **nextToken** *(string) --* 

        If the ``maxResults`` response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of documents.

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

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

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

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

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

  