:doc:`ManagedGrafana <../../grafana>` / Client / list_workspace_service_account_tokens

*************************************
list_workspace_service_account_tokens
*************************************



.. py:method:: ManagedGrafana.Client.list_workspace_service_account_tokens(**kwargs)

  

  Returns a list of tokens for a workspace service account.

   

  .. note::

    

    This does not return the key for each token. You cannot access keys after they are created. To create a new key, delete the token and recreate it.

    

   

  Service accounts are only available for workspaces that are compatible with Grafana version 9 and above.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/grafana-2020-08-18/ListWorkspaceServiceAccountTokens>`_  


  **Request Syntax**
  ::

    response = client.list_workspace_service_account_tokens(
        maxResults=123,
        nextToken='string',
        serviceAccountId='string',
        workspaceId='string'
    )
    
  :type maxResults: integer
  :param maxResults: 

    The maximum number of tokens to include in the results.

    

  
  :type nextToken: string
  :param nextToken: 

    The token for the next set of service accounts to return. (You receive this token from a previous ``ListWorkspaceServiceAccountTokens`` operation.)

    

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

    The ID of the service account for which to return tokens.

    

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

    The ID of the workspace for which to return tokens.

    

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

    
    ::

      {
          'nextToken': 'string',
          'serviceAccountId': 'string',
          'serviceAccountTokens': [
              {
                  'createdAt': datetime(2015, 1, 1),
                  'expiresAt': datetime(2015, 1, 1),
                  'id': 'string',
                  'lastUsedAt': datetime(2015, 1, 1),
                  'name': 'string'
              },
          ],
          'workspaceId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The token to use when requesting the next set of service accounts.

        
      

      - **serviceAccountId** *(string) --* 

        The ID of the service account where the tokens reside.

        
      

      - **serviceAccountTokens** *(list) --* 

        An array of structures containing information about the tokens.

        
        

        - *(dict) --* 

          A structure that contains the information about a service account token.

          
          

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

            When the service account token was created.

            
          

          - **expiresAt** *(datetime) --* 

            When the service account token will expire.

            
          

          - **id** *(string) --* 

            The unique ID of the service account token.

            
          

          - **lastUsedAt** *(datetime) --* 

            The last time the token was used to authorize a Grafana HTTP API.

            
          

          - **name** *(string) --* 

            The name of the service account token.

            
      
    
      

      - **workspaceId** *(string) --* 

        The ID of the workspace where the tokens reside.

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

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

  
  *   :py:class:`ManagedGrafana.Client.exceptions.ConflictException`

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

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

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

  