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

***********
end_session
***********



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

  

  Ends the session. After you end a session, you can still access its content but you can’t add to it. To delete the session and it's content, you use the DeleteSession API operation. 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/EndSession>`_  


  **Request Syntax**
  ::

    response = client.end_session(
        sessionIdentifier='string'
    )
    
  :type sessionIdentifier: string
  :param sessionIdentifier: **[REQUIRED]** 

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

    

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

    
    ::

      {
          'sessionArn': 'string',
          'sessionId': 'string',
          'sessionStatus': 'ACTIVE'|'EXPIRED'|'ENDED'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The Amazon Resource Name (ARN) of the session you ended.

        
      

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

        The unique identifier of the session you ended.

        
      

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

        The current status of the session you ended.

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

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

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

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

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

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

  