DeleteSession - Amazon Lex API Reference

DeleteSession

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.

Request Syntax

DELETE /bots/botId/botAliases/botAliasId/botLocales/localeId/sessions/sessionId HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

botAliasId

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

Required: Yes

botId

The identifier of the bot that contains the session data.

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

Required: Yes

localeId

The locale where the session is in use.

Length Constraints: Minimum length of 1.

Required: Yes

sessionId

The identifier of the session to delete.

Length Constraints: Minimum length of 2. Maximum length of 100.

Pattern: [0-9a-zA-Z._:-]+

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 Content-type: application/json { "botAliasId": "string", "botId": "string", "localeId": "string", "sessionId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

botAliasId

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

Type: String

botId

The identifier of the bot that contained the session data.

Type: String

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

localeId

The locale where the session was used.

Type: String

Length Constraints: Minimum length of 1.

sessionId

The identifier of the deleted session.

Type: String

Length Constraints: Minimum length of 2. Maximum length of 100.

Pattern: [0-9a-zA-Z._:-]+

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

HTTP Status Code: 403

ConflictException

HTTP Status Code: 409

InternalServerException

HTTP Status Code: 500

ResourceNotFoundException

HTTP Status Code: 404

ThrottlingException

HTTP Status Code: 429

ValidationException

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: