

End of support notice: On September 15, 2025, AWS will discontinue support for Amazon Lex V1. After September 15, 2025, you will no longer be able to access the Amazon Lex V1 console or Amazon Lex V1 resources. If you are using Amazon Lex V2, refer to the [Amazon Lex V2 guide](https://docs.aws.amazon.com/lexv2/latest/dg/what-is.html) instead. . 

# Exporting and Importing in Amazon Lex Format
<a name="import-export-lex"></a>

To export bots, intents, and slot types, from Amazon Lex with the intention of reimporting into Amazon Lex, you use create a JSON file in Amazon Lex format. You can edit your resources in this file and import it back into Amazon Lex. For example, you can add utterances to an intent and then import the changed intent back into your account. You can also use the JSON format to share a resource. For example, you can export a bot from one AWS Region and then import it into another Region. Or you can send the JSON file to a colleague to share a bot.

**Topics**
+ [

# Exporting in Amazon Lex Format
](export-to-lex.md)
+ [

# Importing in Amazon Lex Format
](import-from-lex.md)
+ [

# JSON Format for Importing and Exporting
](import-export-format.md)

# Exporting in Amazon Lex Format
<a name="export-to-lex"></a>

Export your Amazon Lex bots, intents, and slot types to a format that you can import to an AWS account. You can export the following resources:
+ A bot, including all of the intents and custom slot types used by the bot
+ An intent, including all of the custom slot types used by the intent
+ A custom slot type, including all of values for the slot type

You can export only a numbered version of a resource. You can't export a resource's `$LATEST` version.

Exporting is an asynchronous process. When the export is complete, you get an Amazon S3 presigned URL. The URL provides the location of a .zip archive that contains the exported resource in JSON format. 

You use either the console or the [GetExport](API_GetExport.md) operation to export bots, intents, and custom slot types. 

The process for exporting, a bot, an intent, or a slot type is the same. In the following procedures, substitute intent or slot type for bot. 

## Exporting a Bot
<a name="export-console"></a>

**To export a bot**

1. Sign in to the AWS Management Console, and open the Amazon Lex console at [https://console.aws.amazon.com/lex/](https://console.aws.amazon.com/lex/). 

1. Choose **Bots**, then choose the bot to export.

1. On the **Actions** menu, choose **Export**.

1. In the **Export Bot** dialog, choose the version of the bot to export. For **Platform**, choose **Amazon Lex**.

1. Choose **Export**.

1. Download and save the .zip archive.

Amazon Lex exports the bot to a JSON file that is contained in the .zip archive. To update the bot, modify the JSON text, then import it back into Amazon Lex.

**Next step**  
[Importing in Amazon Lex Format](import-from-lex.md)

# Importing in Amazon Lex Format
<a name="import-from-lex"></a>

After you have exported a resource to a JSON file in the Amazon Lex format, you can import the JSON file containing the resource into one or more AWS accounts. For example, you can export a bot, and then import it into another AWS Region. Or you can send the bot to a colleague so that she can import it into her account. 

When you import a bot, intent, or slot type, you must decide whether you want to overwrite the `$LATEST` version of a resource, such as an intent or a slot type, during import, or if you want the import to fail if you want to preserve the resource that is in your account. For example, if you are uploading an edited version of a resource to your account, you would choose to overwrite the `$LATEST` version. If you are uploading a resource sent to you by a colleague, you can choose to have the import fail if there are are resource conflicts so that your own resources aren't replaced.

When importing a resource, the permissions assigned to the user making the import request apply. The user must have permissions for all of the resources in the account that the import affects. The user must also have permission for the [GetBot](API_GetBot.md), [PutBot](API_PutBot.md), [GetIntent](API_GetIntent.md) [PutIntent](API_PutIntent.md), [GetSlotType](API_GetSlotType.md), [PutSlotType](API_PutSlotType.md) operations. For more information about permissions, see [How Amazon Lex works with IAM](security_iam_service-with-iam.md).

The import reports errors that occur during processing. Some errors are reported before the import begins, others are reported during the import process. For example, if the account that is importing an intent doesn't have permission to call a Lambda function that the intent uses, the import fails before changes are made to the slot types or intents. If an import fails during the import process, the `$LATEST` version of any intent or slot type imported before the process failed is modified. You can't roll back changes made to the `$LATEST` version.

When you import a resource, all dependent resources are imported to the `$LATEST` version of the resource and then given a numbered version. For example, if a bot uses an intent, the intent is given a numbered version. If an intent uses a custom slot type, the slot type is given a numbered version.

A resource is imported only once. For example, if the bot contains an `OrderPizza` intent and an `OrderDrink` intent that both rely on the custom slot type `Size`, the `Size` slot type is imported once and used for both intents.

**Note**  
If you exported your bot with the `enableModelImprovements` parameter set to `false`, you must open the .zip file containing the bot definition and change the `enableModelImprovements` parameter to `true` in the following Regions:  
Asia Pacific (Singapore) (ap-southeast-1)
Asia Pacific (Tokyo) (ap-northeast-1)
EU (Frankfurt) (eu-central-1)
EU (London) (eu-west-2)

The process for importing a bot, an intent, or a custom slot type is the same. In the following procedures, substitute intent or slot type, as appropriate. 

## Importing a Bot
<a name="import-console"></a>

**To import a bot**

1. Sign in to the AWS Management Console, and open the Amazon Lex console at [https://console.aws.amazon.com/lex/](https://console.aws.amazon.com/lex/). 

1. Choose **Bots**, then choose the bot to import. To import a new bot, skip this step.

1. For **Actions**, choose **Import**.

1. For **Import Bot**, choose the .zip archive that contains the JSON file that contains the bot to import. If you want to see merge conflicts before merging, choose **Notify me of merge conflicts**. If you turn off conflict checking, the `$LATEST` version of all of the resources used by the bot are overwritten.

1. Choose **Import**. If you have chosen to be notified of merge conflicts and there are conflicts, a dialog appears that lists them. To overwrite the `$LATEST` version of all conflicting resources, choose **Overwrite and continue**. To stop the import, choose **Cancel**.

You can now test the bot in your account. 

# JSON Format for Importing and Exporting
<a name="import-export-format"></a>

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

## Slot Type structure
<a name="import-export-slot-type"></a>

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
<a name="import-export-intent"></a>

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

## Bot structure
<a name="import-export-bot"></a>

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