JSON Format for Importing and Exporting - Amazon Lex V1

If you are using Amazon Lex V2, refer to the Amazon Lex V2 guide instead.

 

If you are using Amazon Lex V1, we recommend upgrading your bots to Amazon Lex V2. We are no longer adding new features to V1 and strongly recommend using V2 for all new bots.

JSON Format for Importing and Exporting

The following examples show the JSON structure for exporting and importing slot types, intents, and bots in Amazon Lex format.

Slot Type structure

The following is the JSON structure for custom slot types. Use this structure when you import or export slot types, and when you export intents that depend on custom slot types.

{ "metadata": { "schemaVersion": "1.0", "importType": "LEX", "importFormat": "JSON" }, "resource": { "name": "slot type name", "version": "version number", "enumerationValues": [ { "value": "enumeration value", "synonyms": [] }, { "value": "enumeration value", "synonyms": [] } ], "valueSelectionStrategy": "ORIGINAL_VALUE or TOP_RESOLUTION" } }

Intent structure

The following is the JSON structure for intents. Use this structure when you import or export intents and bots that depend on an intent.

{ "metadata": { "schemaVersion": "1.0", "importType": "LEX", "importFormat": "JSON" }, "resource": { "description": "intent description", "rejectionStatement": { "messages": [ { "contentType": "PlainText or SSML or CustomPayload", "content": "string" } ] }, "name": "intent name", "version": "version number", "fulfillmentActivity": { "type": "ReturnIntent or CodeHook" }, "sampleUtterances": [ "string", "string" ], "slots": [ { "name": "slot name", "description": "slot description", "slotConstraint": "Required or Optional", "slotType": "slot type", "valueElicitationPrompt": { "messages": [ { "contentType": "PlainText or SSML or CustomPayload", "content": "string" } ], "maxAttempts": value }, "priority": value, "sampleUtterances": [] } ], "confirmationPrompt": { "messages": [ { "contentType": "PlainText or SSML or CustomPayload", "content": "string" }, { "contentType": "PlainText or SSML or CustomPayload", "content": "string" } ], "maxAttempts": value }, "slotTypes": [ List of slot type JSON structures. For more information, see Slot Type structure. ] } }

Bot structure

The following is the JSON structure for bots. Use this structure when you import or export bots.

{ "metadata": { "schemaVersion": "1.0", "importType": "LEX", "importFormat": "JSON" }, "resource": { "name": "bot name", "version": "version number",, "nluIntentConfidenceThreshold": 0.00-1.00, "enableModelImprovements": true | false, "intents": [ List of intent JSON structures. For more information, see Intent structure. ], "slotTypes": [ List of slot type JSON structures. For more information, see Slot Type structure. ], "voiceId": "output voice ID", "childDirected": boolean, "locale": "en-US", "idleSessionTTLInSeconds": timeout, "description": "bot description", "clarificationPrompt": { "messages": [ { "contentType": "PlainText or SSML or CustomPayload", "content": "string" } ], "maxAttempts": value }, "abortStatement": { "messages": [ { "contentType": "PlainText or SSML or CustomPayload", "content": "string" } ] } } }