:doc:`AgentsforBedrockRuntime <../../bedrock-agent-runtime>` / Client / update_session

**************
update_session
**************



.. py:method:: AgentsforBedrockRuntime.Client.update_session(**kwargs)

  

  Updates the metadata or encryption settings of a session. For more information about sessions, see `Store and retrieve conversation history and context with Amazon Bedrock sessions <https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/UpdateSession>`_  


  **Request Syntax**
  ::

    response = client.update_session(
        sessionIdentifier='string',
        sessionMetadata={
            'string': 'string'
        }
    )
    
  :type sessionIdentifier: string
  :param sessionIdentifier: **[REQUIRED]** 

    The unique identifier of the session to modify. You can specify either the session's ``sessionId`` or its Amazon Resource Name (ARN).

    

  
  :type sessionMetadata: dict
  :param sessionMetadata: 

    A map of key-value pairs containing attributes to be persisted across the session. For example the user's ID, their language preference, and the type of device they are using.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'createdAt': datetime(2015, 1, 1),
          'lastUpdatedAt': datetime(2015, 1, 1),
          'sessionArn': 'string',
          'sessionId': 'string',
          'sessionStatus': 'ACTIVE'|'EXPIRED'|'ENDED'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The timestamp for when the session was created.

        
      

      - **lastUpdatedAt** *(datetime) --* 

        The timestamp for when the session was last modified.

        
      

      - **sessionArn** *(string) --* 

        The Amazon Resource Name (ARN) of the session that was updated.

        
      

      - **sessionId** *(string) --* 

        The unique identifier of the session you updated.

        
      

      - **sessionStatus** *(string) --* 

        The status of the session you updated.

        
  
  **Exceptions**
  
  *   :py:class:`AgentsforBedrockRuntime.Client.exceptions.ConflictException`

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

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

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

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

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

  