> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon Connect CCP Integration with Agent AI Chat

This guide covers integrating Agent AI (Chat channel) with Amazon Connect using a Custom Contact Control Panel (CCP). The custom CCP acts as a unified container that hosts both Amazon Connect's native CCP and the Agent AI Chat widget, allowing agents to manage customer interactions while receiving AI-driven assistance in real time.

## Prerequisites

| **Category** | **Requirement** |
| - | - |
| **AWS / Amazon Connect** | - An active Amazon Connect instance with Administrator privileges. - The instance must be created in a supported AWS region (this guide was validated in **us-east-1**).  - For telephony use cases, ensure DID or toll-free numbers are claimed. - Confirm Amazon Connect service quotas support your expected usage. |
| **Custom Contact Control Panel (CCP)** | - A supported browser (the latest version of Chrome is recommended, as Firefox may have limitations with Webr /TC/media). For details, refer to [AWS documentation](https://docs.aws.amazon.com/connect/latest/adminguide/connect-supported-browsers.html). - Workstations meeting minimum CPU, RAM, and network bandwidth requirements for CCP usage. - Network/firewall rules allowing outbound HTTPS (443), Webr /TC domains/ports, and host domains for the custom CCP. - Valid SSL certificates if hosting the CCP outside the Amazon Connect domain. |
| **Agent AI** | - Active Agent AI account with required permissions for bot configuration.  - Access to dialog tasks, session APIs, webhook endpoints, and iframe token generation.  - A backend endpoint capable of returning bot metadata and generating Agent AI iframe tokens. |
| **Application and Integration Components** | - Access to the Custom CCP codebase (HTML/JS container app).  - Ability to modify configuration values such as backend URL, CCP URL, and Agent AI token endpoint. - A lightweight hosting solution (such as Python HTTP server, Node, or NGINX). |
| **Security / Identity** | - IAM roles configured for Amazon Connect administration.  - Clearly defined, least-privilege IAM policies for any backend, Lambda, or additional AWS services (if used).  - **Approved Origins** configured in Amazon Connect for custom CCP hosting domains. - Ensure HTTPS-only hosting to avoid mixed-content security blocks. |
| **Migration / Versioning** | - Verify compatibility with Amazon Connect's current CCP version (**ccp-v2**).  - Remove or migrate any legacy CCP implementations.  - Ensure Agent AI endpoints and token mechanisms match the latest platform standards. |

## Components Required

The integration requires the following components:

* Amazon Connect
* Custom Contact Control Panel (CCP)
* Agent AI Platform

> [!NOTE]
>
> Lambda, Kinesis, and streaming services aren't required for chat-only integrations.

## Set up an Amazon Connect Instance

1. Sign in to your **Amazon Connect** instance.

2. Go to **Amazon Connect** > **Instances**.

3. Click **Add an instance** to create a new Amazon Connect instance.

   ![add-an-instance](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/add-an-instance_1.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=5a8ed6daf7c61f61da5bed9d30e23f52)

4. Select an option in the **Identity management** section, and enter the Amazon Connect instance name in the **Access URL** field.

   ![identity-management-access-url](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/identity-management-access-url_2.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=fa6b1caf1c5bd46710af0e2c82e42e9b)

5. This step creates an Amazon Connect host URL: *https\://\<instance-name>.my.connect.aws*.

6. Click **Next**.

7. Select **Specify an administrator**, and enter the admin details in the following fields:
   * **First name**: First name of the administrator.
   * **Last name**: Last name of the administrator.
   * **Username**: Username for the administrator to sign in.
   * **Password**: Password for the administrator to sign in.
   * **Password (verify)**: Re-enter the password.

     ![add-administrator](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/add-administrator_3.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=990a054a1782d70a2ca0e43cbe813d3f)

8. Click **Next**.

9. Select option(s) in the **Telephony Options** section.

   ![telephony-options](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/telephony-options_4.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=e30a2e53abd3086a552acb0b66cc9636)

10. Click **Next**.

11. Select an option on the **Data storage** page.

    ![data-storage](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/data-storage_5.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=6db55c78eba3f4dd97b600cf9af548ce)

12. Click **Next**.

13. Review and click **Edit** to change your input.

    ![review-and-create](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/review-and-create_6.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=19bc8edb7a0bbc85c35d460b7207025d)

14. Click **Create**.

## Sign in as an Administrator

The new instance you created is listed in Amazon Connect.

![new-instance](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/new-instance_7.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=951a3bf33f1772b24071b3f5639bf1d5)

1. Click the instance alias.

2. Add allowed origins by clicking **Approved origins**, as shown in the following screenshot:

   ![approved-origins](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/approved-origins_8.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=783e12881e10f32e326bff12f67611bc)

3. Go to the **Overview** option of the current instance, and click the **URL**. A new web page opens in a different tab:

   ![amazon-connect-signin-page](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/amazon-connect-signin-page_9.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=6d0decb9fa4d345aaf2afbfcb3772a19)

4. Sign in with the Administrator credentials you created during instance setup.
   These credentials give you admin access to the contact center, allowing you to modify flows and groups as needed.

## Run the Code Base

1. Get the code base from [this URL](https://github.com/Koredotcom/korecc-twilio/tree/master/AmazonConnect/Chat_CCP).

2. Change the backend URL in **config.js** under the **scripts/config** folder. This backend URL provides the bot details and Agent AI iframe token.

3. Change the ccpUrl in **initCCP.js**. The ccpUrl format is:
   *https\://\[amazon-connect-instance].my.connect.aws/connect/ccp-v2*

4. Run a lightweight server to access this as a web page.
   *Example: `python  -m http.server [port-number]`*

5. After entering the **local host URL**, you see the following screen:

   ![welcome-page](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/welcome-page_10.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=52d15e31210731016ffb0329379ea0fe)

6. When you initiate a chat, you see the following screen (Agent AI on the right):

   ![agentai-rendering](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/agentai-rendering_11.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=70e6fe6dc2d03c6ee781a1d8022bfff1)

## Chat Widget in Amazon Connect

1. Sign in to the Amazon Connect instance.

2. Go to **Channels** > **Communication widget**.
   The default widget is available here. Create a new widget by clicking **Add widget**.

   ![default-and-add-widgets](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/default-and-add-widgets_12.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=a08c2d921019f482349c7b44a11d6f4a)

3. Click the required widget.

   The JavaScript sample code to run the widget on your local device is shown here. Copy the code.

   ![javascript](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/javascript_13.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=c0d8e577b5029bae2db7ae9311441550)

4. Paste the code into any HTML file, and run a sample application server.
   *`python  -m http.server [port-number]`*

5. You see the following screen for the chat widget:

   ![chat-widget](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/chat-widget_14.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=23b707aeb2b065601f1bd3c7d37f85ed)

   * The following screenshot shows **Amazon Connect** integrated with **Agent AI**:

     ![amazon-connect-with-agentai-chat](https://mintcdn.com/koreai/IaMQplULZvUirzb0/ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/amazon-connect-with-agentai-chat_15.png?fit=max\&auto=format\&n=IaMQplULZvUirzb0\&q=85\&s=b4567fd215fa05c2e6d0fc3e4752993a)

   * Click [here](https://www.loom.com/share/c89ec8e652a845229874e09ebb6f885e?sid=a9c339bf-c1f9-47ee-97c5-45292ccd4f6d) for a demo video.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.