:doc:`Rekognition <../../rekognition>` / Client / list_collections

****************
list_collections
****************



.. py:method:: Rekognition.Client.list_collections(**kwargs)

  

  Returns list of collection IDs in your account. If the result is truncated, the response also provides a ``NextToken`` that you can use in the subsequent request to fetch the next set of collection IDs.

   

  For an example, see Listing collections in the Amazon Rekognition Developer Guide.

   

  This operation requires permissions to perform the ``rekognition:ListCollections`` action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/rekognition-2016-06-27/ListCollections>`_  


  **Request Syntax**
  ::

    response = client.list_collections(
        NextToken='string',
        MaxResults=123
    )
    
  :type NextToken: string
  :param NextToken: 

    Pagination token from the previous response.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    Maximum number of collection IDs to return.

    

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

    
    ::

      {
          'CollectionIds': [
              'string',
          ],
          'NextToken': 'string',
          'FaceModelVersions': [
              'string',
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **CollectionIds** *(list) --* 

        An array of collection IDs.

        
        

        - *(string) --* 
    
      

      - **NextToken** *(string) --* 

        If the result is truncated, the response provides a ``NextToken`` that you can use in the subsequent request to fetch the next set of collection IDs.

        
      

      - **FaceModelVersions** *(list) --* 

        Version numbers of the face detection models associated with the collections in the array ``CollectionIds``. For example, the value of ``FaceModelVersions[2]`` is the version number for the face detection model used by the collection in ``CollectionId[2]``.

        
        

        - *(string) --* 
    
  
  **Exceptions**
  
  *   :py:class:`Rekognition.Client.exceptions.InvalidParameterException`

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

  
  *   :py:class:`Rekognition.Client.exceptions.InternalServerError`

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

  
  *   :py:class:`Rekognition.Client.exceptions.ProvisionedThroughputExceededException`

  
  *   :py:class:`Rekognition.Client.exceptions.InvalidPaginationTokenException`

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

  

  **Examples**

  This operation returns a list of Rekognition collections.
  ::

    response = client.list_collections(
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'CollectionIds': [
            'myphotos',
        ],
        'ResponseMetadata': {
            '...': '...',
        },
    }

  