CreateBotVersion - Amazon Lex V1

If you are using Amazon Lex V2, refer to the Amazon Lex V2 guide instead.

 

If you are using Amazon Lex V1, we recommend upgrading your bots to Amazon Lex V2. We are no longer adding new features to V1 and strongly recommend using V2 for all new bots.

CreateBotVersion

Creates a new version of the bot based on the $LATEST version. If the $LATEST version of this resource hasn't changed since you created the last version, Amazon Lex doesn't create a new version. It returns the last created version.

Note

You can update only the $LATEST version of the bot. You can't update the numbered versions that you create with the CreateBotVersion operation.

When you create the first version of a bot, Amazon Lex sets the version to 1. Subsequent versions increment by 1. For more information, see Versioning.

This operation requires permission for the lex:CreateBotVersion action.

Request Syntax

POST /bots/name/versions HTTP/1.1 Content-type: application/json { "checksum": "string" }

URI Request Parameters

The request uses the following URI parameters.

name

The name of the bot that you want to create a new version of. The name is case sensitive.

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

Pattern: ^([A-Za-z]_?)+$

Required: Yes

Request Body

The request accepts the following data in JSON format.

checksum

Identifies a specific revision of the $LATEST version of the bot. If you specify a checksum and the $LATEST version of the bot has a different checksum, a PreconditionFailedException exception is returned and Amazon Lex doesn't publish a new version. If you don't specify a checksum, Amazon Lex publishes the $LATEST version.

Type: String

Required: No

Response Syntax

HTTP/1.1 201 Content-type: application/json { "abortStatement": { "messages": [ { "content": "string", "contentType": "string", "groupNumber": number } ], "responseCard": "string" }, "checksum": "string", "childDirected": boolean, "clarificationPrompt": { "maxAttempts": number, "messages": [ { "content": "string", "contentType": "string", "groupNumber": number } ], "responseCard": "string" }, "createdDate": number, "description": "string", "detectSentiment": boolean, "enableModelImprovements": boolean, "failureReason": "string", "idleSessionTTLInSeconds": number, "intents": [ { "intentName": "string", "intentVersion": "string" } ], "lastUpdatedDate": number, "locale": "string", "name": "string", "status": "string", "version": "string", "voiceId": "string" }

Response Elements

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

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

abortStatement

The message that Amazon Lex uses to cancel a conversation. For more information, see PutBot.

Type: Statement object

checksum

Checksum identifying the version of the bot that was created.

Type: String

childDirected

For each Amazon Lex bot created with the Amazon Lex Model Building Service, you must specify whether your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to the Children's Online Privacy Protection Act (COPPA) by specifying true or false in the childDirected field. By specifying true in the childDirected field, you confirm that your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. By specifying false in the childDirected field, you confirm that your use of Amazon Lex is not related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. You may not specify a default value for the childDirected field that does not accurately reflect whether your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA.

If your use of Amazon Lex relates to a website, program, or other application that is directed in whole or in part, to children under age 13, you must obtain any required verifiable parental consent under COPPA. For information regarding the use of Amazon Lex in connection with websites, programs, or other applications that are directed or targeted, in whole or in part, to children under age 13, see the Amazon Lex FAQ.

Type: Boolean

clarificationPrompt

The message that Amazon Lex uses when it doesn't understand the user's request. For more information, see PutBot.

Type: Prompt object

createdDate

The date when the bot version was created.

Type: Timestamp

description

A description of the bot.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 200.

detectSentiment

Indicates whether utterances entered by the user should be sent to Amazon Comprehend for sentiment analysis.

Type: Boolean

enableModelImprovements

Indicates whether the bot uses accuracy improvements. true indicates that the bot is using the improvements, otherwise, false.

Type: Boolean

failureReason

If status is FAILED, Amazon Lex provides the reason that it failed to build the bot.

Type: String

idleSessionTTLInSeconds

The maximum time in seconds that Amazon Lex retains the data gathered in a conversation. For more information, see PutBot.

Type: Integer

Valid Range: Minimum value of 60. Maximum value of 86400.

intents

An array of Intent objects. For more information, see PutBot.

Type: Array of Intent objects

lastUpdatedDate

The date when the $LATEST version of this bot was updated.

Type: Timestamp

locale

Specifies the target locale for the bot.

Type: String

Valid Values: de-DE | en-AU | en-GB | en-IN | en-US | es-419 | es-ES | es-US | fr-FR | fr-CA | it-IT | ja-JP | ko-KR

name

The name of the bot.

Type: String

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

Pattern: ^([A-Za-z]_?)+$

status

When you send a request to create or update a bot, Amazon Lex sets the status response element to BUILDING. After Amazon Lex builds the bot, it sets status to READY. If Amazon Lex can't build the bot, it sets status to FAILED. Amazon Lex returns the reason for the failure in the failureReason response element.

Type: String

Valid Values: BUILDING | READY | READY_BASIC_TESTING | FAILED | NOT_BUILT

version

The version of the bot.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: \$LATEST|[0-9]+

voiceId

The Amazon Polly voice ID that Amazon Lex uses for voice interactions with the user.

Type: String

Errors

BadRequestException

The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.

HTTP Status Code: 400

ConflictException

There was a conflict processing the request. Try your request again.

HTTP Status Code: 409

InternalFailureException

An internal Amazon Lex error occurred. Try your request again.

HTTP Status Code: 500

LimitExceededException

The request exceeded a limit. Try your request again.

HTTP Status Code: 429

NotFoundException

The resource specified in the request was not found. Check the resource and try again.

HTTP Status Code: 404

PreconditionFailedException

The checksum of the resource that you are trying to change does not match the checksum in the request. Check the resource's checksum and try again.

HTTP Status Code: 412

See Also

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