Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . lex-runtime ]



Creates a new session or modifies an existing session with an Amazon Lex bot. Use this operation to enable your application to set the state of the bot.

For more information, see Managing Sessions .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


--bot-name <value>
--bot-alias <value>
--user-id <value>
[--session-attributes <value>]
[--dialog-action <value>]
[--recent-intent-summary-view <value>]
[--accept <value>]
outfile <value>


--bot-name (string)

The name of the bot that contains the session data.

--bot-alias (string)

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

--user-id (string)

The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot.

--session-attributes (map)

Map of key/value pairs representing the session-specific context information. It contains application information passed between Amazon Lex and a client application.

Shorthand Syntax:


JSON Syntax:

{"string": "string"

--dialog-action (structure)

Sets the next action that the bot should take to fulfill the conversation.

Shorthand Syntax:


JSON Syntax:

  "type": "ElicitIntent"|"ConfirmIntent"|"ElicitSlot"|"Close"|"Delegate",
  "intentName": "string",
  "slots": {"string": "string"
  "slotToElicit": "string",
  "fulfillmentState": "Fulfilled"|"Failed"|"ReadyForFulfillment",
  "message": "string",
  "messageFormat": "PlainText"|"CustomPayload"|"SSML"|"Composite"

--recent-intent-summary-view (list)

A summary of the recent intents for the bot. You can use the intent summary view to set a checkpoint label on an intent and modify attributes of intents. You can also use it to remove or add intent summary objects to the list.

An intent that you modify or add to the list must make sense for the bot. For example, the intent name must be valid for the bot. You must provide valid values for:

  • intentName
  • slot names
  • slotToElict

If you send the recentIntentSummaryView parameter in a PutSession request, the contents of the new summary view replaces the old summary view. For example, if a GetSession request returns three intents in the summary view and you call PutSession with one intent in the summary view, the next call to GetSession will only return one intent.

Shorthand Syntax:

intentName=string,checkpointLabel=string,slots={KeyName1=string,KeyName2=string},confirmationStatus=string,dialogActionType=string,fulfillmentState=string,slotToElicit=string ...

JSON Syntax:

    "intentName": "string",
    "checkpointLabel": "string",
    "slots": {"string": "string"
    "confirmationStatus": "None"|"Confirmed"|"Denied",
    "dialogActionType": "ElicitIntent"|"ConfirmIntent"|"ElicitSlot"|"Close"|"Delegate",
    "fulfillmentState": "Fulfilled"|"Failed"|"ReadyForFulfillment",
    "slotToElicit": "string"

--accept (string)

The message that Amazon Lex returns in the response can be either text or speech based depending on the value of this field.

  • If the value is text/plain; charset=utf-8 , Amazon Lex returns text in the response.
  • If the value begins with audio/ , Amazon Lex returns speech in the response. Amazon Lex uses Amazon Polly to generate the speech in the configuration that you specify. For example, if you specify audio/mpeg as the value, Amazon Lex returns speech in the MPEG format.
  • If the value is audio/pcm , the speech is returned as audio/pcm in 16-bit, little endian format.
  • The following are the accepted values:
    • audio/mpeg
    • audio/ogg
    • audio/pcm
    • audio/* (defaults to mpeg)
    • text/plain; charset=utf-8

outfile (string) Filename where the content will be saved

See 'aws help' for descriptions of global parameters.


contentType -> (string)

Content type as specified in the Accept HTTP header in the request.

intentName -> (string)

The name of the current intent.

slots -> (JSON)

Map of zero or more intent slots Amazon Lex detected from the user input during the conversation.

Amazon Lex creates a resolution list containing likely values for a slot. The value that it returns is determined by the valueSelectionStrategy selected when the slot type was created or updated. If valueSelectionStrategy is set to ORIGINAL_VALUE , the value provided by the user is returned, if the user value is similar to the slot values. If valueSelectionStrategy is set to TOP_RESOLUTION Amazon Lex returns the first value in the resolution list or, if there is no resolution list, null. If you don't specify a valueSelectionStrategy the default is ORIGINAL_VALUE .

sessionAttributes -> (JSON)

Map of key/value pairs representing session-specific context information.

message -> (string)

The next message that should be presented to the user.

messageFormat -> (string)

The format of the response message. One of the following values:

  • PlainText - The message contains plain UTF-8 text.
  • CustomPayload - The message is a custom format for the client.
  • SSML - The message contains text formatted for voice output.
  • Composite - The message contains an escaped JSON object containing one or more messages from the groups that messages were assigned to when the intent was created.

dialogState -> (string)

  • ConfirmIntent - Amazon Lex is expecting a "yes" or "no" response to confirm the intent before fulfilling an intent.
  • ElicitIntent - Amazon Lex wants to elicit the user's intent.
  • ElicitSlot - Amazon Lex is expecting the value of a slot for the current intent.
  • Failed - Conveys that the conversation with the user has failed. This can happen for various reasons, including the user does not provide an appropriate response to prompts from the service, or if the Lambda function fails to fulfill the intent.
  • Fulfilled - Conveys that the Lambda function has sucessfully fulfilled the intent.
  • ReadyForFulfillment - Conveys that the client has to fulfill the intent.

slotToElicit -> (string)

If the dialogState is ElicitSlot , returns the name of the slot for which Amazon Lex is eliciting a value.

audioStream -> (blob)

The audio version of the message to convey to the user.

sessionId -> (string)

A unique identifier for the session.