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

**************
delete_session
**************



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

  

  Deletes a session that you ended. You can't delete a session with an ``ACTIVE`` status. To delete an active session, you must first end it with the `EndSession <https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_EndSession.html>`__ 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/DeleteSession>`_  


  **Request Syntax**
  ::

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

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

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **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`

  