openapi: 3.0.0 info: version: '2020-08-07' x-release: v4 title: Amazon Lex Runtime V2 description:
x-logo: url: 'https://twitter.com/awscloud/profile_image?size=original' backgroundColor: '#FFFFFF' termsOfService: 'https://aws.amazon.com/service-terms/' contact: name: Mike Ralphson email: mike.ralphson@gmail.com url: 'https://github.com/mermade/aws2openapi' x-twitter: PermittedSoc license: name: Apache 2.0 License url: 'http://www.apache.org/licenses/' x-providerName: amazonaws.com x-serviceName: runtime.lex.v2 x-aws-signingName: lex x-origin: - contentType: application/json url: 'https://raw.githubusercontent.com/aws/aws-sdk-js/master/apis/runtime.lex.v2-2020-08-07.normal.json' converter: url: 'https://github.com/mermade/aws2openapi' version: 1.0.0 x-apisguru-driver: external x-apiClientRegistration: url: 'https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?nc2=h_ct' x-apisguru-categories: - cloud x-preferred: true externalDocs: description: Amazon Web Services documentation url: 'https://docs.aws.amazon.com/runtime-v2-lex/' servers: - url: 'http://runtime-v2-lex.{region}.amazonaws.com' variables: region: description: The AWS region enum: - us-east-1 - us-east-2 - us-west-1 - us-west-2 - us-gov-west-1 - us-gov-east-1 - ca-central-1 - eu-north-1 - eu-west-1 - eu-west-2 - eu-west-3 - eu-central-1 - eu-south-1 - af-south-1 - ap-northeast-1 - ap-northeast-2 - ap-northeast-3 - ap-southeast-1 - ap-southeast-2 - ap-east-1 - ap-south-1 - sa-east-1 - me-south-1 default: us-east-1 description: The Lex Runtime V2 multi-region endpoint - url: 'https://runtime-v2-lex.{region}.amazonaws.com' variables: region: description: The AWS region enum: - us-east-1 - us-east-2 - us-west-1 - us-west-2 - us-gov-west-1 - us-gov-east-1 - ca-central-1 - eu-north-1 - eu-west-1 - eu-west-2 - eu-west-3 - eu-central-1 - eu-south-1 - af-south-1 - ap-northeast-1 - ap-northeast-2 - ap-northeast-3 - ap-southeast-1 - ap-southeast-2 - ap-east-1 - ap-south-1 - sa-east-1 - me-south-1 default: us-east-1 description: The Lex Runtime V2 multi-region endpoint - url: 'http://runtime-v2-lex.{region}.amazonaws.com.cn' variables: region: description: The AWS region enum: - cn-north-1 - cn-northwest-1 default: cn-north-1 description: The Lex Runtime V2 endpoint for China (Beijing) and China (Ningxia) - url: 'https://runtime-v2-lex.{region}.amazonaws.com.cn' variables: region: description: The AWS region enum: - cn-north-1 - cn-northwest-1 default: cn-north-1 description: The Lex Runtime V2 endpoint for China (Beijing) and China (Ningxia) paths: '/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}': delete: operationId: DeleteSession description: '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
.
Returns session information for a specified bot, alias, and user.
For example, you can use this operation to retrieve session information for a user that has left a long-running session in use.
If the bot, alias, or session identifier doesn''t exist, Amazon Lex V2 returns a BadRequestException
. If the locale doesn''t exist or is not enabled for the alias, you receive a BadRequestException
.
The message that Amazon Lex V2 returns in the response can be either text or speech depending on the value of this parameter.
If the value is text/plain; charset=utf-8
, Amazon Lex V2 returns text in the response.
Request-specific information passed between Amazon Lex V2 and the client application.
The namespace x-amz-lex:
is reserved for special attributes. Don''t create any request attributes with the prefix x-amz-lex:
.
Sends user input to Amazon Lex V2. Client applications use this API to send requests to Amazon Lex V2 at runtime. Amazon Lex V2 then interprets the user input using the machine learning model that it build for the bot.
In response, Amazon Lex V2 returns the next message to convey to the user and an optional response card to display.
' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/RecognizeTextResponse' '480': description: AccessDeniedException content: application/json: schema: $ref: '#/components/schemas/AccessDeniedException' '481': description: ResourceNotFoundException content: application/json: schema: $ref: '#/components/schemas/ResourceNotFoundException' '482': description: ValidationException content: application/json: schema: $ref: '#/components/schemas/ValidationException' '483': description: ThrottlingException content: application/json: schema: $ref: '#/components/schemas/ThrottlingException' '484': description: InternalServerException content: application/json: schema: $ref: '#/components/schemas/InternalServerException' '485': description: ConflictException content: application/json: schema: $ref: '#/components/schemas/ConflictException' '486': description: DependencyFailedException content: application/json: schema: $ref: '#/components/schemas/DependencyFailedException' '487': description: BadGatewayException content: application/json: schema: $ref: '#/components/schemas/BadGatewayException' parameters: - name: botId in: path required: true description: The identifier of the bot that processes the request. schema: type: string pattern: '^[0-9a-zA-Z]+$' minLength: 10 maxLength: 10 - name: botAliasId in: path required: true description: The alias identifier in use for the bot that processes the request. schema: type: string - name: localeId in: path required: true description: The locale where the session is in use. schema: type: string minLength: 1 - name: sessionId in: path required: true description: The identifier of the user session that is having the conversation. schema: type: string pattern: '[0-9a-zA-Z._:-]+' minLength: 2 maxLength: 100 requestBody: required: true content: application/json: schema: type: object required: - text properties: text: description: The text that the user entered. Amazon Lex V2 interprets this text. type: string minLength: 1 maxLength: 1024 format: password sessionState: description: The state of the user's session with Amazon Lex V2. type: object properties: dialogAction: description: The next step that Amazon Lex V2 should take in the conversation with a user. allOf: $ref: '#/components/schemas/DialogAction' intent: description: The active intent that Amazon Lex V2 is processing. allOf: $ref: '#/components/schemas/Intent' activeContexts: description: 'One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session.' allOf: $ref: '#/components/schemas/ActiveContextsList' sessionAttributes: description: Map of key/value pairs representing session-specific context information. It contains application information passed between Amazon Lex V2 and a client application. allOf: $ref: '#/components/schemas/StringMap' originatingRequestId: description: allOf: $ref: '#/components/schemas/NonEmptyString' requestAttributes: description: 'Request-specific information passed between the client application and Amazon Lex V2
The namespace x-amz-lex:
is reserved for special attributes. Don''t create any request attributes with the prefix x-amz-lex:
.
Sends user input to Amazon Lex V2. You can send text or speech. Clients use this API to send text and audio requests to Amazon Lex V2 at runtime. Amazon Lex V2 interprets the user input using the machine learning model built for the bot.
The following request fields must be compressed with gzip and then base64 encoded before you send them to Amazon Lex V2.
requestAttributes
sessionState
The following response fields are compressed using gzip and then base64 encoded by Amazon Lex V2. Before you can use these fields, you must decode and decompress them.
inputTranscript
interpretations
messages
requestAttributes
sessionState
The example contains a Java application that compresses and encodes a Java object to send to Amazon Lex V2, and a second that decodes and decompresses a response from Amazon Lex V2.
' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/RecognizeUtteranceResponse' '480': description: AccessDeniedException content: application/json: schema: $ref: '#/components/schemas/AccessDeniedException' '481': description: ResourceNotFoundException content: application/json: schema: $ref: '#/components/schemas/ResourceNotFoundException' '482': description: ValidationException content: application/json: schema: $ref: '#/components/schemas/ValidationException' '483': description: ThrottlingException content: application/json: schema: $ref: '#/components/schemas/ThrottlingException' '484': description: InternalServerException content: application/json: schema: $ref: '#/components/schemas/InternalServerException' '485': description: ConflictException content: application/json: schema: $ref: '#/components/schemas/ConflictException' '486': description: DependencyFailedException content: application/json: schema: $ref: '#/components/schemas/DependencyFailedException' '487': description: BadGatewayException content: application/json: schema: $ref: '#/components/schemas/BadGatewayException' parameters: - name: botId in: path required: true description: The identifier of the bot that should receive the request. schema: type: string pattern: '^[0-9a-zA-Z]+$' minLength: 10 maxLength: 10 - name: botAliasId in: path required: true description: The alias identifier in use for the bot that should receive the request. schema: type: string - name: localeId in: path required: true description: The locale where the session is in use. schema: type: string minLength: 1 - name: sessionId in: path required: true description: The identifier of the session in use. schema: type: string pattern: '[0-9a-zA-Z._:-]+' minLength: 2 maxLength: 100 - name: x-amz-lex-session-state in: header required: false description: 'Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.
The sessionState
field must be compressed using gzip and then base64 encoded before sending to Amazon Lex V2.
Request-specific information passed between the client application and Amazon Lex V2
The namespace x-amz-lex:
is reserved for special attributes. Don''t create any request attributes for prefix x-amz-lex:
.
The requestAttributes
field must be compressed using gzip and then base64 encoded before sending to Amazon Lex V2.
Indicates the format for audio input or that the content is text. The header must start with one of the following prefixes:
PCM format, audio data must be in little-endian byte order.
audio/l16; rate=16000; channels=1
audio/x-l16; sample-rate=16000; channel-count=1
audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false
Opus format
audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4
Text format
text/plain; charset=utf-8
The message that Amazon Lex V2 returns in the response can be either text or speech based on the responseContentType
value.
If the value is text/plain;charset=utf-8
, Amazon Lex V2 returns text in the response.
If the value begins with audio/
, Amazon Lex V2 returns speech in the response. Amazon Lex V2 uses Amazon Polly to generate the speech using the configuration that you specified in the requestContentType
parameter. For example, if you specify audio/mpeg
as the value, Amazon Lex V2 returns speech in the MPEG format.
If the value is audio/pcm
, the speech returned is audio/pcm
at 16 KHz in 16-bit, little-endian format.
The following are the accepted values:
audio/mpeg
audio/ogg
audio/pcm (16 KHz)
audio/* (defaults to mpeg)
text/plain; charset=utf-8
requestContentType
parameter.
type: string
parameters:
- $ref: '#/components/parameters/X-Amz-Content-Sha256'
- $ref: '#/components/parameters/X-Amz-Date'
- $ref: '#/components/parameters/X-Amz-Algorithm'
- $ref: '#/components/parameters/X-Amz-Credential'
- $ref: '#/components/parameters/X-Amz-Security-Token'
- $ref: '#/components/parameters/X-Amz-Signature'
- $ref: '#/components/parameters/X-Amz-SignedHeaders'
components:
parameters:
X-Amz-Content-Sha256:
name: X-Amz-Content-Sha256
in: header
schema:
type: string
required: false
X-Amz-Date:
name: X-Amz-Date
in: header
schema:
type: string
required: false
X-Amz-Algorithm:
name: X-Amz-Algorithm
in: header
schema:
type: string
required: false
X-Amz-Credential:
name: X-Amz-Credential
in: header
schema:
type: string
required: false
X-Amz-Security-Token:
name: X-Amz-Security-Token
in: header
schema:
type: string
required: false
X-Amz-Signature:
name: X-Amz-Signature
in: header
schema:
type: string
required: false
X-Amz-SignedHeaders:
name: X-Amz-SignedHeaders
in: header
schema:
type: string
required: false
securitySchemes:
hmac:
type: apiKey
name: Authorization
in: header
description: Amazon Signature authorization v4
x-amazon-apigateway-authtype: awsSigv4
schemas:
DeleteSessionResponse:
type: object
properties:
botId:
description: The identifier of the bot that contained the session data.
allOf:
$ref: '#/components/schemas/BotIdentifier'
botAliasId:
description: The alias identifier in use for the bot that contained the session data.
allOf:
$ref: '#/components/schemas/BotAliasIdentifier'
localeId:
description: The locale where the session was used.
allOf:
$ref: '#/components/schemas/LocaleId'
sessionId:
description: The identifier of the deleted session.
allOf:
$ref: '#/components/schemas/SessionId'
AccessDeniedException: {}
ResourceNotFoundException: {}
ValidationException: {}
ThrottlingException: {}
InternalServerException: {}
ConflictException: {}
GetSessionResponse:
type: object
properties:
sessionId:
description: The identifier of the returned session.
allOf:
$ref: '#/components/schemas/NonEmptyString'
messages:
description: 'A list of messages that were last sent to the user. The messages are ordered based on the order that your returned the messages from your Lambda function or the order that messages are defined in the bot. '
allOf:
$ref: '#/components/schemas/Messages'
interpretations:
description: 'A list of intents that Amazon Lex V2 determined might satisfy the user''s utterance.
Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.
' allOf: $ref: '#/components/schemas/Interpretations' sessionState: description:Represents the current state of the dialog between the user and the bot.
You can use this to determine the progress of the conversation and what the next action might be.
allOf: $ref: '#/components/schemas/SessionState' PutSessionResponse: type: object properties: audioStream: description: 'If the requested content type was audio, the audio version of the message to convey to the user.' allOf: $ref: '#/components/schemas/BlobStream' Message: type: object required: - contentType properties: content: description: The text of the message. allOf: $ref: '#/components/schemas/Text' contentType: description: Indicates the type of response. allOf: $ref: '#/components/schemas/MessageContentType' imageResponseCard: $ref: '#/components/schemas/ImageResponseCard' description: Container for text that is returned to the customer.. DialogAction: type: object required: - type properties: type: description: 'The next action that the bot should take in its interaction with the user. The possible values are:
Close
- Indicates that there will not be a response from the user. For example, the statement "Your order has been placed" does not require a response.
ConfirmIntent
- The next action is asking the user if the intent is complete and ready to be fulfilled. This is a yes/no question such as "Place the order?"
Delegate
- The next action is determined by Amazon Lex V2.
ElicitSlot
- The next action is to elicit a slot value from the user.
Represents the current state of the dialog between the user and the bot.
Use this to determine the progress of the conversation and what the next action may be.
allOf: $ref: '#/components/schemas/SessionState' interpretations: description: 'A list of intents that Amazon Lex V2 determined might satisfy the user''s utterance.
Each interpretation includes the intent, a score that indicates now confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.
' allOf: $ref: '#/components/schemas/Interpretations' requestAttributes: description: The attributes sent in the request. allOf: $ref: '#/components/schemas/StringMap' sessionId: description: The identifier of the session in use. allOf: $ref: '#/components/schemas/SessionId' RecognizeUtteranceResponse: type: object properties: audioStream: description: 'The prompt or statement to send to the user. This is based on the bot configuration and context. For example, if Amazon Lex V2 did not understand the user intent, it sends theclarificationPrompt
configured for the bot. If the intent requires confirmation before taking the fulfillment action, it sends the confirmationPrompt
. Another example: Suppose that the Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon Lex V2 sends that message in the response.'
allOf:
$ref: '#/components/schemas/BlobStream'
ActiveContextName:
type: string
pattern: '^([A-Za-z]_?)+$'
minLength: 1
maxLength: 100
ActiveContextTimeToLive:
type: object
required:
- timeToLiveInSeconds
- turnsToLive
properties:
timeToLiveInSeconds:
description: The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).
allOf:
$ref: '#/components/schemas/ActiveContextTimeToLiveInSeconds'
turnsToLive:
description: The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.
allOf:
$ref: '#/components/schemas/ActiveContextTurnsToLive'
description: The time that a context is active. You can specify the time to live in seconds or in conversation turns.
ActiveContextParametersMap:
type: object
minProperties: 0
maxProperties: 10
additionalProperties:
$ref: '#/components/schemas/Text'
ActiveContext:
type: object
required:
- name
- timeToLive
- contextAttributes
properties:
name:
description: The name of the context.
allOf:
$ref: '#/components/schemas/ActiveContextName'
timeToLive:
description: 'Indicates the number of turns or seconds that the context is active. Once the time to live expires, the context is no longer returned in a response.'
allOf:
$ref: '#/components/schemas/ActiveContextTimeToLive'
contextAttributes:
description: 'A lis tof contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request.
If you don''t specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.
' allOf: $ref: '#/components/schemas/ActiveContextParametersMap' description: 'Contains information about the contexts that a user is using in a session. You can configure Amazon Lex V2 to set a context when an intent is fulfilled, or you can set a context using the , , or operations.
Use a context to indicate to Amazon Lex V2 intents that should be used as follow-up intents. For example, if the active context is order-fulfilled
, only intents that have order-fulfilled
configured as a trigger are considered for follow up.
A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.
When you use a response card, the response from the user is constrained to the text associated with a button on the card.
' Slots: type: object additionalProperties: $ref: '#/components/schemas/Slot' IntentState: type: string enum: - Failed - Fulfilled - InProgress - ReadyForFulfillment - Waiting SentimentResponse: type: object properties: sentiment: description: The overall sentiment expressed in the user's response. This is the sentiment most likely expressed by the user based on the analysis by Amazon Comprehend. allOf: $ref: '#/components/schemas/SentimentType' sentimentScore: $ref: '#/components/schemas/SentimentScore' description: 'Provides information about the sentiment expressed in a user''s response in a conversation. Sentiments are determined using Amazon Comprehend. Sentiments are only returned if they are enabled for the bot.
For more information, see Determine Sentiment in the Amazon Comprehend developer guide.
' Interpretation: type: object properties: nluConfidence: description: 'Determines the threshold where Amazon Lex V2 will insert theAMAZON.FallbackIntent
, AMAZON.KendraSearchIntent
, or both when returning alternative intents in a response. AMAZON.FallbackIntent
and AMAZON.KendraSearchIntent
are only inserted if they are configured for the bot.'
allOf:
$ref: '#/components/schemas/ConfidenceScore'
sentimentResponse:
description: 'The sentiment expressed in an utterance.
When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field contains the result of the analysis.
' allOf: $ref: '#/components/schemas/SentimentResponse' intent: description: A list of intents that might satisfy the user's utterance. The intents are ordered by the confidence score. allOf: $ref: '#/components/schemas/Intent' description: 'An intent that Amazon Lex V2 determined might satisfy the user''s utterance. The intents are ordered by the confidence score. ' MessageContentType: type: string enum: - CustomPayload - ImageResponseCard - PlainText - SSML ParameterName: type: string minLength: 1 maxLength: 100 PutSessionRequest: type: object required: - sessionState title: PutSessionRequest properties: messages: description: A list of messages to send to the user. Messages are sent in the order that they are defined in the list. allOf: $ref: '#/components/schemas/Messages' sessionState: description: 'Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.' allOf: $ref: '#/components/schemas/SessionState' requestAttributes: description: 'Request-specific information passed between Amazon Lex V2 and the client application.
The namespace x-amz-lex:
is reserved for special attributes. Don''t create any request attributes with the prefix x-amz-lex:
.
Request-specific information passed between the client application and Amazon Lex V2
The namespace x-amz-lex:
is reserved for special attributes. Don''t create any request attributes with the prefix x-amz-lex:
.
requestContentType
parameter.
allOf:
$ref: '#/components/schemas/BlobStream'
SentimentType:
type: string
enum:
- MIXED
- NEGATIVE
- NEUTRAL
- POSITIVE
SentimentScore:
type: object
properties:
positive:
description: The level of confidence that Amazon Comprehend has in the accuracy of its detection of the POSITIVE
sentiment.
allOf:
$ref: '#/components/schemas/Double'
negative:
description: The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEGATIVE
sentiment.
allOf:
$ref: '#/components/schemas/Double'
neutral:
description: The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEUTRAL
sentiment.
allOf:
$ref: '#/components/schemas/Double'
mixed:
description: The level of confidence that Amazon Comprehend has in the accuracy of its detection of the MIXED
sentiment.
allOf:
$ref: '#/components/schemas/Double'
description: The individual sentiment responses for the utterance.
Shape:
type: string
enum:
- Scalar
- List
Value:
type: object
required:
- interpretedValue
properties:
originalValue:
description: The text of the utterance from the user that was entered for the slot.
allOf:
$ref: '#/components/schemas/NonEmptyString'
interpretedValue:
description: 'The value that Amazon Lex V2 determines for the slot. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the resolvedValues
list.'
allOf:
$ref: '#/components/schemas/NonEmptyString'
resolvedValues:
description: A list of additional values that have been recognized for the slot.
allOf:
$ref: '#/components/schemas/StringList'
description: The value of a slot.
Values:
type: array
items:
$ref: '#/components/schemas/Slot'
Slot:
type: object
properties:
value:
description: The current value of the slot.
allOf:
$ref: '#/components/schemas/Value'
values:
description: 'A list of one or more values that the user provided for the slot. For example, if a for a slot that elicits pizza toppings, the values might be "pepperoni" and "pineapple." '
allOf:
$ref: '#/components/schemas/Values'
description: 'A value that Amazon Lex V2 uses to fulfill an intent. '
StringList:
type: array
items:
$ref: '#/components/schemas/NonEmptyString'
security:
- hmac: []