:doc:`LexRuntimeV2 <../../lexv2-runtime>` / Client / delete_session

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



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

  

  Removes session information for a specified bot, alias, and user ID.

   

  You can use this operation to restart a conversation with a bot. When you remove a session, the entire history of the session is removed so that you can start again.

   

  You don't need to delete a session. Sessions have a time limit and will expire. Set the session time limit when you create the bot. The default is 5 minutes, but you can specify anything between 1 minute and 24 hours.

   

  If you specify a bot or alias ID that doesn't exist, you receive a ``BadRequestException.``

   

  If the locale doesn't exist in the bot, or if the locale hasn't been enables for the alias, you receive a ``BadRequestException``.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/DeleteSession>`_  


  **Request Syntax**
  ::

    response = client.delete_session(
        botId='string',
        botAliasId='string',
        localeId='string',
        sessionId='string'
    )
    
  :type botId: string
  :param botId: **[REQUIRED]** 

    The identifier of the bot that contains the session data.

    

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

    The alias identifier in use for the bot that contains the session data.

    

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

    The locale where the session is in use.

    

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

    The identifier of the session to delete.

    

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

    
    ::

      {
          'botId': 'string',
          'botAliasId': 'string',
          'localeId': 'string',
          'sessionId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **botId** *(string) --* 

        The identifier of the bot that contained the session data.

        
      

      - **botAliasId** *(string) --* 

        The alias identifier in use for the bot that contained the session data.

        
      

      - **localeId** *(string) --* 

        The locale where the session was used.

        
      

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

        The identifier of the deleted session.

        
  
  **Exceptions**
  
  *   :py:class:`LexRuntimeV2.Client.exceptions.AccessDeniedException`

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

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

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

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

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

  