v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1442228254.5 KB

Creates an intent or replaces an existing intent.

To define the interaction between the user and your bot, you use one or more intents. For a pizza ordering bot, for example, you would create an OrderPizza intent.

To create an intent or replace an existing intent, you must provide the following:

  • Intent name. For example, OrderPizza.

  • Sample utterances. For example, "Can I order a pizza, please." and "I want to order a pizza."

  • Information to be gathered. You specify slot types for the information that your bot will request from the user. You can specify standard slot types, such as a date or a time, or custom slot types such as the size and crust of a pizza.

  • How the intent will be fulfilled. You can provide a Lambda function or configure the intent to return the intent information to the client application. If you use a Lambda function, when all of the intent information is available, Amazon Lex invokes your Lambda function. If you configure your intent to return the intent information to the client application.

You can specify other optional information in the request, such as:

  • A confirmation prompt to ask the user to confirm an intent. For example, "Shall I order your pizza?"

  • A conclusion statement to send to the user after the intent has been fulfilled. For example, "I placed your pizza order."

  • A follow-up prompt that asks the user for additional activity. For example, asking "Do you want to order a drink with your pizza?"

If you specify an existing intent name to update the intent, Amazon Lex replaces the values in the $LATEST version of the intent with the values in the request. Amazon Lex removes fields that you don't provide in the request. If you don't specify the required fields, Amazon Lex throws an exception. When you update the $LATEST version of an intent, the status field of any bot that uses the $LATEST version of the intent is set to NOT_BUILT.

For more information, see how-it-works.

This operation requires permissions for the lex:PutIntent action.

put/intents/{name}/versions/$LATEST

Path parameters

namestring required
<p>The name of the intent. The name is <i>not</i> case sensitive. </p> <p>The name can't match a built-in intent name, or a built-in intent name with "AMAZON." removed. For example, because there is a built-in intent called <code>AMAZON.HelpIntent</code>, you can't create a custom intent called <code>HelpIntent</code>.</p> <p>For a list of built-in intents, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>

Request body

descriptionstring

A description of the intent.

sampleUtterancesUtterance[]
<p>An array of utterances (strings) that a user might say to signal the intent. For example, "I want {PizzaSize} pizza", "Order {Quantity} {PizzaSize} pizzas". </p> <p>In each utterance, a slot name is enclosed in curly braces. </p>
parentIntentSignaturestring

A unique identifier for the built-in intent to base this intent on. To find the signature for an intent, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.

checksumstring
<p>Identifies a specific revision of the <code>$LATEST</code> version.</p> <p>When you create a new intent, leave the <code>checksum</code> field blank. If you specify a checksum you get a <code>BadRequestException</code> exception.</p> <p>When you want to update a intent, set the <code>checksum</code> field to the checksum of the most recent revision of the <code>$LATEST</code> version. If you don't specify the <code> checksum</code> field, or if the checksum does not match the <code>$LATEST</code> version, you get a <code>PreconditionFailedException</code> exception.</p>
createVersionboolean

When set to <code>true</code> a new numbered version of the intent is created. This is the same as calling the <code>CreateIntentVersion</code> operation. If you do not specify <code>createVersion</code>, the default is <code>false</code>.

Response

Success

namestring

The name of the intent.

descriptionstring

A description of the intent.

sampleUtterancesUtterance[]

An array of sample utterances that are configured for the intent.

parentIntentSignaturestring

A unique identifier for the built-in intent that this intent is based on.

lastUpdatedDatestring date-time

The date that the intent was updated. When you create a resource, the creation date and last update dates are the same.

createdDatestring date-time

The date that the intent was created.

versionstring

The version of the intent. For a new intent, the version is always <code>$LATEST</code>.

checksumstring

Checksum of the <code>$LATEST</code>version of the intent created or updated.

createVersionboolean

<code>True</code> if a new version of the intent was created. If the <code>createVersion</code> field was not specified in the request, the <code>createVersion</code> field is set to false in the response.

Example response

{
  "version": "$LATEST",
  "name": "DocOrderPizza",
  "checksum": "ca9bc13d-afc8-4706-bbaf-091f7a5935d6",
  "conclusionStatement": {
    "messages": [
      {
        "content": "All right, I ordered  you a {Crust} crust {Type} pizza with {Sauce} sauce.",
        "contentType": "PlainText"
      },
      {
        "content": "OK, your {Crust} crust {Type} pizza with {Sauce} sauce is on the way.",
        "contentType": "PlainText"
      }
    ],
    "responseCard": "foo"
  },
  "confirmationPrompt": {
    "maxAttempts": 1,
    "messages": [
      {
        "content": "Should I order  your {Crust} crust {Type} pizza with {Sauce} sauce?",
        "contentType": "PlainText"
      }
    ]
  },
  "createdDate": 1494359783.453,
  "description": "Order a pizza from a local pizzeria.",
  "fulfillmentActivity": {
    "type": "ReturnIntent"
  },
  "lastUpdatedDate": 1494359783.453,
  "rejectionStatement": {
    "messages": [
      {
        "content": "Ok, I'll cancel your order.",
        "contentType": "PlainText"
      },
      {
        "content": "I cancelled your order.",
        "contentType": "PlainText"
      }
    ]
  },
  "sampleUtterances": [
    "Order me a pizza.",
    "Order me a {Type} pizza.",
    "I want a {Crust} crust {Type} pizza",
    "I want a {Crust} crust {Type} pizza with {Sauce} sauce."
  ],
  "slots": [
    {
      "name": "Sauce",
      "description": "The type of sauce to use on the pizza.",
      "priority": 3,
      "sampleUtterances": [
        "Make it {Sauce} sauce.",
        "I'd like {Sauce} sauce."
      ],
      "slotConstraint": "Required",
      "slotType": "DocPizzaSauceType",
      "slotTypeVersion": "$LATEST",
      "valueElicitationPrompt": {
        "maxAttempts": 1,
        "messages": [
          {
            "content": "White or red sauce?",
            "contentType": "PlainText"
          },
          {
            "content": "Garlic or tomato sauce?",
            "contentType": "PlainText"
          }
        ]
      }
    },
    {
      "name": "Type",
      "description": "The type of pizza to order.",
      "priority": 1,
      "sampleUtterances": [
        "Get me a {Type} pizza.",
        "A {Type} pizza please.",
        "I'd like a {Type} pizza."
      ],
      "slotConstraint": "Required",
      "slotType": "DocPizzaType",
      "slotTypeVersion": "$LATEST",
      "valueElicitationPrompt": {
        "maxAttempts": 1,
        "messages": [
          {
            "content": "What type of pizza would you like?",
            "contentType": "PlainText"
          },
          {
            "content": "Vegie or cheese pizza?",
            "contentType": "PlainText"
          },
          {
            "content": "I can get you a vegie or a cheese pizza.",
            "contentType": "PlainText"
          }
        ]
      }
    },
    {
      "name": "Crust",
      "description": "The type of pizza crust to order.",
      "priority": 2,
      "sampleUtterances": [
        "Make it a {Crust} crust.",
        "I'd like a {Crust} crust."
      ],
      "slotConstraint": "Required",
      "slotType": "DocPizzaCrustType",
      "slotTypeVersion": "$LATEST",
      "valueElicitationPrompt": {
        "maxAttempts": 1,
        "messages": [
          {
            "content": "What type of crust would you like?",
            "contentType": "PlainText"
          },
          {
            "content": "Thick or thin crust?",
            "contentType": "PlainText"
          }
        ]
      }
    }
  ]
}