:doc:`MultipartyApproval <../../mpa>` / Client / list_sessions

*************
list_sessions
*************



.. py:method:: MultipartyApproval.Client.list_sessions(**kwargs)

  

  Returns a list of approval sessions. For more information, see `Session <https://docs.aws.amazon.com/mpa/latest/userguide/mpa-concepts.html>`__ in the *Multi-party approval User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/mpa-2022-07-26/ListSessions>`_  


  **Request Syntax**
  ::

    response = client.list_sessions(
        ApprovalTeamArn='string',
        MaxResults=123,
        NextToken='string',
        Filters=[
            {
                'FieldName': 'ActionName'|'ApprovalTeamName'|'VotingTime'|'Vote'|'SessionStatus'|'InitiationTime',
                'Operator': 'EQ'|'NE'|'GT'|'LT'|'GTE'|'LTE'|'CONTAINS'|'NOT_CONTAINS'|'BETWEEN',
                'Value': 'string'
            },
        ]
    )
    
  :type ApprovalTeamArn: string
  :param ApprovalTeamArn: **[REQUIRED]** 

    Amazon Resource Name (ARN) for the approval team.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of items to return in the response. If more results exist than the specified ``MaxResults`` value, a token is included in the response so that you can retrieve the remaining results.

    

  
  :type NextToken: string
  :param NextToken: 

    If present, indicates that more output is available than is included in the current response. Use this value in the ``NextToken`` request parameter in a next call to the operation to get more output. You can repeat this until the ``NextToken`` response element returns ``null``.

    

  
  :type Filters: list
  :param Filters: 

    An array of ``Filter`` objects. Contains the filter to apply when listing sessions.

    

  
    - *(dict) --* 

      Contains the filter to apply to requests. You can specify up to 10 filters for a request.

      

    
      - **FieldName** *(string) --* 

        Name of the filter to use.

         

        .. note::

          

          **Supported filters**

           

          The supported filters for  ListSessions are: ``ActionName``, ``SessionStatus``, and ``InitationTime``.

          

        

      
      - **Operator** *(string) --* 

        Operator to use for filtering.

         

        
        * ``EQ``: Equal to the specified value
         
        * ``NE``: Not equal to the specified value
         
        * ``GT``: Greater than the specified value
         
        * ``LT``: Less than the specified value
         
        * ``GTE``: Greater than or equal to the specified value
         
        * ``LTE``: Less than or equal to the specified value
         
        * ``CONTAINS``: Contains the specified value
         
        * ``NOT_CONTAINS``: Does not contain the specified value
         
        * ``BETWEEN``: Between two values, inclusive of the specified values.
        

         

        .. note::

          

          **Supported operators for each filter**:

           

          
          * ``ActionName``: ``EQ`` | ``NE`` | ``CONTAINS`` | ``NOT_CONTAINS``
           
          * ``SessionStatus``: ``EQ`` | ``NE``
           
          * ``InitiationTime``: ``GT`` | ``LT`` | ``GTE`` | ``LTE`` | ``BETWEEN``
          

          

        

      
      - **Value** *(string) --* 

        Value to use for filtering. For the ``BETWEEN`` operator, specify values in the format ``a AND b`` ( ``AND`` is case-insensitive).

        

      
    

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

    
    ::

      {
          'NextToken': 'string',
          'Sessions': [
              {
                  'SessionArn': 'string',
                  'ApprovalTeamName': 'string',
                  'ApprovalTeamArn': 'string',
                  'InitiationTime': datetime(2015, 1, 1),
                  'ExpirationTime': datetime(2015, 1, 1),
                  'CompletionTime': datetime(2015, 1, 1),
                  'Description': 'string',
                  'ActionName': 'string',
                  'ProtectedResourceArn': 'string',
                  'RequesterServicePrincipal': 'string',
                  'RequesterPrincipalArn': 'string',
                  'RequesterRegion': 'string',
                  'RequesterAccountId': 'string',
                  'Status': 'PENDING'|'CANCELLED'|'APPROVED'|'FAILED'|'CREATING',
                  'StatusCode': 'REJECTED'|'EXPIRED'|'CONFIGURATION_CHANGED',
                  'StatusMessage': 'string',
                  'ActionCompletionStrategy': 'AUTO_COMPLETION_UPON_APPROVAL',
                  'AdditionalSecurityRequirements': [
                      'APPROVER_VERIFICATION_REQUIRED',
                  ]
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        If present, indicates that more output is available than is included in the current response. Use this value in the ``NextToken`` request parameter in a next call to the operation to get more output. You can repeat this until the ``NextToken`` response element returns ``null``.

        
      

      - **Sessions** *(list) --* 

        An array of ``ListSessionsResponseSession`` objects. Contains details for the sessions.

        
        

        - *(dict) --* 

          Contains details for an approval session. For more information, see `Session <https://docs.aws.amazon.com/mpa/latest/userguide/mpa-health.html>`__ in the *Multi-party approval User Guide*

          
          

          - **SessionArn** *(string) --* 

            Amazon Resource Name (ARN) for the session.

            
          

          - **ApprovalTeamName** *(string) --* 

            Name of the approval team.

            
          

          - **ApprovalTeamArn** *(string) --* 

            Amazon Resource Name (ARN) for the approval team.

            
          

          - **InitiationTime** *(datetime) --* 

            Timestamp when the session was initiated.

            
          

          - **ExpirationTime** *(datetime) --* 

            Timestamp when the session was expire.

            
          

          - **CompletionTime** *(datetime) --* 

            Timestamp when the session was completed.

            
          

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

            Description for the team.

            
          

          - **ActionName** *(string) --* 

            Name of the protected operation.

            
          

          - **ProtectedResourceArn** *(string) --* 

            Amazon Resource Name (ARN) for the protected operation.

            
          

          - **RequesterServicePrincipal** *(string) --* 

            `Service principal <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services>`__ for the service associated with the protected operation.

            
          

          - **RequesterPrincipalArn** *(string) --* 

            `IAM principal <https://docs.aws.amazon.com/IAM/latest/UserGuide/intro-structure.html#intro-structure-request>`__ that made the operation request.

            
          

          - **RequesterRegion** *(string) --* 

            Amazon Web Services Region where the operation request originated.

            
          

          - **RequesterAccountId** *(string) --* 

            ID for the account that made the operation request.

            
          

          - **Status** *(string) --* 

            Status for the protected operation. For example, if the operation is ``PENDING``.

            
          

          - **StatusCode** *(string) --* 

            Status code of the session.

            
          

          - **StatusMessage** *(string) --* 

            Message describing the status for session.

            
          

          - **ActionCompletionStrategy** *(string) --* 

            Strategy for executing the protected operation. ``AUTO_COMPLETION_UPON_APPROVAL`` means the operation is executed automatically using the requester's permissions, if approved.

            
          

          - **AdditionalSecurityRequirements** *(list) --* 

            A list of ``AdditionalSecurityRequirement`` applied to the session.

            
            

            - *(string) --* 

              Additional security requirements applied to a session or invitation

               

              
              * ``APPROVER_VERIFICATION_REQUIRED``: Approvers will be required to perform an MFA challenge to vote
              

              
        
      
    
  
  **Exceptions**
  
  *   :py:class:`MultipartyApproval.Client.exceptions.AccessDeniedException`

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

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

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

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

  