{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-lex/json-schema/amazon-lex-post-text-response-schema.json",
  "title": "PostTextResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-lex-operations-api-openapi.yml#/components/schemas/PostTextResponse",
  "type": "object",
  "properties": {
    "intentName": {
      "type": "string",
      "description": "The current user intent that Amazon Lex is aware of."
    },
    "nluIntentConfidence": {
      "$ref": "#/$defs/IntentConfidence"
    },
    "alternativeIntents": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PredictedIntent"
      },
      "description": "One to four alternative intents that may be applicable to the user's intent. Each alternative includes a score that indicates how confident Amazon Lex is that the intent matches the user's intent. The intents are sorted by the confidence score."
    },
    "slots": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The intent slots that Amazon Lex detected from the user input in 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 va"
    },
    "sessionAttributes": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "A map of key-value pairs representing the session-specific context information."
    },
    "message": {
      "type": "string",
      "description": "The message to convey to the user. The message can come from the bot's configuration or from a Lambda function. If the intent is not configured with a Lambda function, or if the Lambda function returned Delegate as the dialogAction.type its response, Amazon Lex decides on the next course of action and selects an appropriate message from the bot's configuration based on the current interaction context. For example, if Amazon Lex isn't able to understand user input, it uses a clarification prompt message. When you create an intent you can assign messages to groups. When messages are assigned to "
    },
    "sentimentResponse": {
      "$ref": "#/$defs/RuntimeLexSentimentResponse"
    },
    "messageFormat": {
      "type": "string",
      "enum": [
        "PlainText",
        "CustomPayload",
        "SSML",
        "Composite"
      ],
      "description": "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 defined by the Lambda function. 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": {
      "type": "string",
      "enum": [
        "ElicitIntent",
        "ConfirmIntent",
        "ElicitSlot",
        "Fulfilled",
        "ReadyForFulfillment",
        "Failed"
      ],
      "description": "Identifies the current state of the user interaction. Amazon Lex returns one of the following values as dialogState. The client can optionally use this information to customize the user interface. ElicitIntent - Amazon Lex wants to elicit user intent. For example, a user might utter an intent (\"I want to order a pizza\"). If Amazon Lex cannot infer the user intent from this utterance, it will return this dialogState. ConfirmIntent - Amazon Lex is expecting a \"yes\" or \"no\" response. For example, Amazon Lex wants user confirmation before fulfilling an intent. Instead of a simple \"yes\" or \"no,\" a "
    },
    "slotToElicit": {
      "type": "string",
      "description": "If the dialogState value is ElicitSlot, returns the name of the slot for which Amazon Lex is eliciting a value."
    },
    "responseCard": {
      "$ref": "#/$defs/ResponseCard"
    },
    "sessionId": {
      "type": "string",
      "description": "A unique identifier for the session."
    },
    "botVersion": {
      "type": "string",
      "description": "The version of the bot that responded to the conversation. You can use this information to help determine if one version of a bot is performing better than another version."
    },
    "activeContexts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RuntimeLexActiveContext"
      },
      "description": "A list of active contexts for the session. A context can be set when an intent is fulfilled or by calling the PostContent, PostText, or PutSession operation. You can use a context to control the intents that can follow up an intent, or to modify the operation of your application."
    }
  },
  "$defs": {
    "GenericAttachment": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "The title of the option."
        },
        "subTitle": {
          "type": "string",
          "description": "The subtitle shown below the title."
        },
        "attachmentLinkUrl": {
          "type": "string",
          "description": "The URL of an attachment to the response card."
        },
        "imageUrl": {
          "type": "string",
          "description": "The URL of an image that is displayed to the user."
        },
        "buttons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RuntimeLexButton"
          },
          "description": "The list of options to show to the user."
        }
      }
    },
    "IntentConfidence": {
      "type": "object",
      "properties": {
        "score": {
          "type": "number",
          "description": "A score that indicates how confident Amazon Lex is that an intent satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher confidence."
        }
      }
    },
    "PredictedIntent": {
      "type": "object",
      "properties": {
        "intentName": {
          "type": "string",
          "description": "The name of the intent that Amazon Lex suggests satisfies the user's intent."
        },
        "nluIntentConfidence": {
          "$ref": "#/$defs/IntentConfidence"
        },
        "slots": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The slot and slot values associated with the predicted intent."
        }
      }
    },
    "ResponseCard": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "description": "The version of the response card format."
        },
        "contentType": {
          "type": "string",
          "enum": [
            "application/vnd.amazonaws.card.generic"
          ],
          "description": "The content type of the response."
        },
        "genericAttachments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GenericAttachment"
          },
          "description": "An array of attachment objects representing options."
        }
      }
    },
    "RuntimeLexActiveContext": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the context."
        },
        "timeToLive": {
          "$ref": "#/$defs/RuntimeLexActiveContextTimeToLive"
        },
        "parameters": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "State variables for the current context. You can use these values as default values for slots in subsequent events."
        }
      },
      "required": [
        "name",
        "timeToLive",
        "parameters"
      ]
    },
    "RuntimeLexActiveContextTimeToLive": {
      "type": "object",
      "properties": {
        "timeToLiveInSeconds": {
          "type": "integer",
          "description": "The number of seconds that the context should be active after it is first sent in a PostContent or PostText response. You can set the value between 5 and 86,400 seconds (24 hours)."
        },
        "turnsToLive": {
          "type": "integer",
          "description": "The number of conversation turns that the context should be active. A conversation turn is one PostContent or PostText request and the corresponding response from Amazon Lex."
        }
      }
    },
    "RuntimeLexButton": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "description": "Text that is visible to the user on the button."
        },
        "value": {
          "type": "string",
          "description": "The value sent to Amazon Lex when a user chooses the button. For example, consider button text \"NYC.\" When the user chooses the button, the value sent can be \"New York City.\""
        }
      },
      "required": [
        "text",
        "value"
      ]
    },
    "RuntimeLexSentimentResponse": {
      "type": "object",
      "properties": {
        "sentimentLabel": {
          "type": "string",
          "description": "The inferred sentiment that Amazon Comprehend has the highest confidence in."
        },
        "sentimentScore": {
          "type": "string",
          "description": "The likelihood that the sentiment was correctly inferred."
        }
      }
    }
  }
}