v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1442228254.5 KB

Creates a custom slot type or replaces an existing custom slot type.

To create a custom slot type, specify a name for the slot type and a set of enumeration values, which are the values that a slot of this type can assume. For more information, see how-it-works.

If you specify the name of an existing slot type, the fields in the request replace the existing values in the $LATEST version of the slot type. Amazon Lex removes the fields that you don't provide in the request. If you don't specify required fields, Amazon Lex throws an exception. When you update the $LATEST version of a slot type, if a bot uses the $LATEST version of an intent that contains the slot type, the bot's status field is set to NOT_BUILT.

This operation requires permissions for the lex:PutSlotType action.

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

Path parameters

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

Request body

descriptionstring

A description of the slot type.

checksumstring
<p>Identifies a specific revision of the <code>$LATEST</code> version.</p> <p>When you create a new slot type, 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 slot type, 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>
valueSelectionStrategy'ORIGINAL_VALUE' | 'TOP_RESOLUTION'
<p>Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to one of the following values:</p> <ul> <li> <p> <code>ORIGINAL_VALUE</code> - Returns the value entered by the user, if the user value is similar to the slot value.</p> </li> <li> <p> <code>TOP_RESOLUTION</code> - If there is a resolution list for the slot, return the first value in the resolution list as the slot type value. If there is no resolution list, null is returned.</p> </li> </ul> <p>If you don't specify the <code>valueSelectionStrategy</code>, the default is <code>ORIGINAL_VALUE</code>.</p>
createVersionboolean

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

parentSlotTypeSignaturestring
<p>The built-in slot type used as the parent of the slot type. When you define a parent slot type, the new slot type has all of the same configuration as the parent.</p> <p>Only <code>AMAZON.AlphaNumeric</code> is supported.</p>

Response

Success

namestring

The name of the slot type.

descriptionstring

A description of the slot type.

lastUpdatedDatestring date-time

The date that the slot type was updated. When you create a slot type, the creation date and last update date are the same.

createdDatestring date-time

The date that the slot type was created.

versionstring

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

checksumstring

Checksum of the <code>$LATEST</code> version of the slot type.

valueSelectionStrategy'ORIGINAL_VALUE' | 'TOP_RESOLUTION'

The slot resolution strategy that Amazon Lex uses to determine the value of the slot. For more information, see <a>PutSlotType</a>.

createVersionboolean

<code>True</code> if a new version of the slot type 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.

parentSlotTypeSignaturestring

The built-in slot type used as the parent of the slot type.

Example response

{
  "version": "$LATEST",
  "name": "DocPizzaSauceType",
  "checksum": "cfd00ed1-775d-4357-947c-aca7e73b44ba",
  "createdDate": 1494356442.23,
  "description": "Available pizza sauces",
  "enumerationValues": [
    {
      "value": "red"
    },
    {
      "value": "white"
    }
  ],
  "lastUpdatedDate": 1494356442.23
}