:doc:`IdentityStore <../../identitystore>` / Client / list_groups

***********
list_groups
***********



.. py:method:: IdentityStore.Client.list_groups(**kwargs)

  

  Lists all groups in the identity store. Returns a paginated list of complete ``Group`` objects. Filtering for a ``Group`` by the ``DisplayName`` attribute is deprecated. Instead, use the ``GetGroupId`` API action.

   

  .. note::

    

    If you have access to a member account, you can use this API operation from the member account. For more information, see `Limiting access to the identity store from member accounts <https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-accounts.html#limiting-access-from-member-accounts>`__ in the *IAM Identity Center User Guide*.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/identitystore-2020-06-15/ListGroups>`_  


  **Request Syntax**
  ::

    response = client.list_groups(
        IdentityStoreId='string',
        MaxResults=123,
        NextToken='string',
        Filters=[
            {
                'AttributePath': 'string',
                'AttributeValue': 'string'
            },
        ]
    )
    
  :type IdentityStoreId: string
  :param IdentityStoreId: **[REQUIRED]** 

    The globally unique identifier for the identity store, such as ``d-1234567890``. In this example, ``d-`` is a fixed prefix, and ``1234567890`` is a randomly generated string that contains numbers and lower case letters. This value is generated at the time that a new identity store is created.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to be returned per request. This parameter is used in the ``ListUsers`` and ``ListGroups`` requests to specify how many results to return in one page. The length limit is 50 characters.

    

  
  :type NextToken: string
  :param NextToken: 

    The pagination token used for the ``ListUsers`` and ``ListGroups`` API operations. This value is generated by the identity store service. It is returned in the API response if the total results are more than the size of one page. This token is also returned when it is used in the API request to search for the next page.

    

  
  :type Filters: list
  :param Filters: 

    A list of ``Filter`` objects, which is used in the ``ListUsers`` and ``ListGroups`` requests.

    

  
    - *(dict) --* 

      A query filter used by ``ListUsers`` and ``ListGroups``. This filter object provides the attribute name and attribute value to search users or groups.

      

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

        The attribute path that is used to specify which attribute name to search. Length limit is 255 characters. For example, ``UserName`` is a valid attribute path for the ``ListUsers`` API, and ``DisplayName`` is a valid attribute path for the ``ListGroups`` API.

        

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

        Represents the data for an attribute. Each attribute value is described as a name-value pair.

        

      
    

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

    
    ::

      {
          'Groups': [
              {
                  'GroupId': 'string',
                  'DisplayName': 'string',
                  'ExternalIds': [
                      {
                          'Issuer': 'string',
                          'Id': 'string'
                      },
                  ],
                  'Description': 'string',
                  'CreatedAt': datetime(2015, 1, 1),
                  'UpdatedAt': datetime(2015, 1, 1),
                  'CreatedBy': 'string',
                  'UpdatedBy': 'string',
                  'IdentityStoreId': 'string'
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Groups** *(list) --* 

        A list of ``Group`` objects in the identity store.

        
        

        - *(dict) --* 

          A group object that contains the metadata and attributes for a specified group.

          
          

          - **GroupId** *(string) --* 

            The identifier for a group in the identity store.

            
          

          - **DisplayName** *(string) --* 

            The display name value for the group. The length limit is 1,024 characters. This value can consist of letters, accented characters, symbols, numbers, punctuation, tab, new line, carriage return, space, and nonbreaking space in this attribute. This value is specified at the time the group is created and stored as an attribute of the group object in the identity store.

             

            Prefix search supports a maximum of 1,000 characters for the string.

            
          

          - **ExternalIds** *(list) --* 

            A list of ``ExternalId`` objects that contains the identifiers issued to this resource by an external identity provider.

            
            

            - *(dict) --* 

              The identifier issued to this resource by an external identity provider.

              
              

              - **Issuer** *(string) --* 

                The issuer for an external identifier.

                
              

              - **Id** *(string) --* 

                The identifier issued to this resource by an external identity provider.

                
          
        
          

          - **Description** *(string) --* 

            A string containing a description of the specified group.

            
          

          - **CreatedAt** *(datetime) --* 

            The date and time the group was created.

            
          

          - **UpdatedAt** *(datetime) --* 

            The date and time the group was last updated.

            
          

          - **CreatedBy** *(string) --* 

            The identifier of the user or system that created the group.

            
          

          - **UpdatedBy** *(string) --* 

            The identifier of the user or system that last updated the group.

            
          

          - **IdentityStoreId** *(string) --* 

            The globally unique identifier for the identity store.

            
      
    
      

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

        The pagination token used for the ``ListUsers`` and ``ListGroups`` API operations. This value is generated by the identity store service. It is returned in the API response if the total results are more than the size of one page. This token is also returned when it is used in the API request to search for the next page.

        
  
  **Exceptions**
  
  *   :py:class:`IdentityStore.Client.exceptions.ResourceNotFoundException`

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

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

  
  *   :py:class:`IdentityStore.Client.exceptions.InternalServerException`

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

  