:doc:`WorkMail <../../workmail>` / Client / list_personal_access_tokens

***************************
list_personal_access_tokens
***************************



.. py:method:: WorkMail.Client.list_personal_access_tokens(**kwargs)

  

  Returns a summary of your Personal Access Tokens.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListPersonalAccessTokens>`_  


  **Request Syntax**
  ::

    response = client.list_personal_access_tokens(
        OrganizationId='string',
        UserId='string',
        NextToken='string',
        MaxResults=123
    )
    
  :type OrganizationId: string
  :param OrganizationId: **[REQUIRED]** 

    The Organization ID.

    

  
  :type UserId: string
  :param UserId: 

    The WorkMail User ID.

    

  
  :type NextToken: string
  :param NextToken: 

    The token from the previous response to query the next page.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum amount of items that should be returned in a response.

    

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

    
    ::

      {
          'NextToken': 'string',
          'PersonalAccessTokenSummaries': [
              {
                  'PersonalAccessTokenId': 'string',
                  'UserId': 'string',
                  'Name': 'string',
                  'DateCreated': datetime(2015, 1, 1),
                  'DateLastUsed': datetime(2015, 1, 1),
                  'ExpiresTime': datetime(2015, 1, 1),
                  'Scopes': [
                      'string',
                  ]
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The token from the previous response to query the next page.

        
      

      - **PersonalAccessTokenSummaries** *(list) --* 

        Lists all the personal tokens in an organization or user, if user ID is provided.

        
        

        - *(dict) --* 

          The summary of the Personal Access Token.

          
          

          - **PersonalAccessTokenId** *(string) --* 

            The ID of the Personal Access Token.

            
          

          - **UserId** *(string) --* 

            The user ID of the WorkMail user associated with the Personal Access Token.

            
          

          - **Name** *(string) --* 

            The name of the Personal Access Token.

            
          

          - **DateCreated** *(datetime) --* 

            The date when the Personal Access Token was created.

            
          

          - **DateLastUsed** *(datetime) --* 

            The date when the Personal Access Token was last used.

            
          

          - **ExpiresTime** *(datetime) --* 

            The date when the Personal Access Token will expire.

            
          

          - **Scopes** *(list) --* 

            Lists all the Personal Access Token permissions for a mailbox.

            
            

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

  
  *   :py:class:`WorkMail.Client.exceptions.EntityNotFoundException`

  
  *   :py:class:`WorkMail.Client.exceptions.EntityStateException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationNotFoundException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationStateException`

  