CreateBot - Amazon Lex

CreateBot

Creates an Amazon Lex conversational bot.

Request Syntax

PUT /bots/ HTTP/1.1 Content-type: application/json { "botName": "string", "botTags": { "string" : "string" }, "dataPrivacy": { "childDirected": boolean }, "description": "string", "idleSessionTTLInSeconds": number, "roleArn": "string", "testBotAliasTags": { "string" : "string" } }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

botName

The name of the bot. The bot name must be unique in the account that creates the bot.

Type: String

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

Pattern: ^([0-9a-zA-Z][_-]?)+$

Required: Yes

botTags

A list of tags to add to the bot. You can only add tags when you create a bot. You can't use the UpdateBot operation to update tags. To update tags, use the TagResource operation.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 200 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Required: No

dataPrivacy

Provides information on additional privacy protections Amazon Lex should use with the bot's data.

Type: DataPrivacy object

Required: Yes

description

A description of the bot. It appears in lists to help you identify a particular bot.

Type: String

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

Required: No

idleSessionTTLInSeconds

The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.

A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.

You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.

Type: Integer

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

Required: Yes

roleArn

The Amazon Resource Name (ARN) of an IAM role that has permission to access the bot.

Type: String

Length Constraints: Minimum length of 32. Maximum length of 2048.

Pattern: ^arn:aws:iam::[0-9]{12}:role/.*$

Required: Yes

testBotAliasTags

A list of tags to add to the test alias for a bot. You can only add tags when you create a bot. You can't use the UpdateAlias operation to update tags. To update tags on the test alias, use the TagResource operation.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 200 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Required: No

Response Syntax

HTTP/1.1 202 Content-type: application/json { "botId": "string", "botName": "string", "botStatus": "string", "botTags": { "string" : "string" }, "creationDateTime": number, "dataPrivacy": { "childDirected": boolean }, "description": "string", "idleSessionTTLInSeconds": number, "roleArn": "string", "testBotAliasTags": { "string" : "string" } }

Response Elements

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

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

botId

A unique identifier for a particular bot. You use this to identify the bot when you call other Amazon Lex API operations.

Type: String

Length Constraints: Fixed length of 10.

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

botName

The name specified for the bot.

Type: String

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

Pattern: ^([0-9a-zA-Z][_-]?)+$

botStatus

Shows the current status of the bot. The bot is first in the Creating status. Once the bot is read for use, it changes to the Available status. After the bot is created, you can use the Draft version of the bot.

Type: String

Valid Values: Creating | Available | Inactive | Deleting | Failed | Versioning

botTags

A list of tags associated with the bot.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 200 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Minimum length of 0. Maximum length of 256.

creationDateTime

A timestamp indicating the date and time that the bot was created.

Type: Timestamp

dataPrivacy

The data privacy settings specified for the bot.

Type: DataPrivacy object

description

The description specified for the bot.

Type: String

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

idleSessionTTLInSeconds

The session idle time specified for the bot.

Type: Integer

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

roleArn

The IAM role specified for the bot.

Type: String

Length Constraints: Minimum length of 32. Maximum length of 2048.

Pattern: ^arn:aws:iam::[0-9]{12}:role/.*$

testBotAliasTags

A list of tags associated with the test alias for the bot.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 200 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Errors

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

ConflictException

HTTP Status Code: 409

InternalServerException

HTTP Status Code: 500

PreconditionFailedException

HTTP Status Code: 412

ServiceQuotaExceededException

HTTP Status Code: 402

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: