> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/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.<br />- The instance must be created in a supported AWS region (this guide was validated in **us-east-1**).<br /> - For telephony use cases, ensure DID or toll-free numbers are claimed.<br />- 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).<br />- Workstations meeting minimum CPU, RAM, and network bandwidth requirements for CCP usage.<br />- Network/firewall rules allowing outbound HTTPS (443), Webr /TC domains/ports, and host domains for the custom CCP.<br />- Valid SSL certificates if hosting the CCP outside the Amazon Connect domain. |
| **Agent AI**                               | - Active Agent AI account with required permissions for bot configuration.<br /> - Access to dialog tasks, session APIs, webhook endpoints, and iframe token generation.<br /> - 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).<br /> - Ability to modify configuration values such as backend URL, CCP URL, and Agent AI token endpoint.<br />- A lightweight hosting solution (such as Python HTTP server, Node, or NGINX).                                                                                                                                                                                                                                                                                                                |
| **Security / Identity**                    | - IAM roles configured for Amazon Connect administration.<br /> - Clearly defined, least-privilege IAM policies for any backend, Lambda, or additional AWS services (if used).<br /> - **Approved Origins** configured in Amazon Connect for custom CCP hosting domains.<br />- Ensure HTTPS-only hosting to avoid mixed-content security blocks.                                                                                                                                                                                                                         |
| **Migration / Versioning**                 | - Verify compatibility with Amazon Connect's current CCP version (**ccp-v2**).<br /> - Remove or migrate any legacy CCP implementations.<br /> - 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 are not required for chat-only integrations.</Note>

## 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.
   <img src="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" alt="add-an-instance" width="1818" height="514" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/add-an-instance_1.png" />

4. Select an option in the **Identity management** section, and enter the Amazon Connect instance name in the **Access URL** field.
   <img src="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" alt="identity-management-access-url" width="1821" height="799" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/identity-management-access-url_2.png" />

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.
     <img src="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" alt="add-administrator" width="1851" height="777" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/add-administrator_3.png" />

8. Click **Next**.

9. Select option(s) in the **Telephony Options** section.
   <img src="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" alt="telephony-options" width="1814" height="596" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/telephony-options_4.png" />

10. Click **Next**.

11. Select an option on the **Data storage** page.
    <img src="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" alt="data-storage" width="1438" height="879" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/data-storage_5.png" />

12. Click **Next**.

13. Review and click **Edit** to change your input.
    <img src="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" alt="review-and-create" width="1912" height="821" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/review-and-create_6.png" />

14. Click **Create**.

## Sign in as an Administrator

The new instance you created is listed in Amazon Connect.

<img src="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" alt="new-instance" width="1914" height="633" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/new-instance_7.png" />

1. Click the instance alias.

2. Add allowed origins by clicking **Approved origins**, as shown in the following screenshot:
   <img src="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" alt="approved-origins" width="1908" height="818" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/approved-origins_8.png" />

3. Go to the **Overview** option of the current instance, and click the **URL**. A new web page opens in a different tab:
   <img src="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" alt="amazon-connect-signin-page" width="480" height="715" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/amazon-connect-signin-page_9.png" />

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 should see the following screen:
   <img src="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" alt="welcome-page" width="1912" height="915" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/welcome-page_10.png" />

6. When you initiate a chat, you see the following screen (Agent AI on the right):
   <img src="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" alt="agentai-rendering" width="1919" height="900" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/agentai-rendering_11.png" />

## 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**.
   <img src="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" alt="default-and-add-widgets" width="1919" height="579" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/default-and-add-widgets_12.png" />

3. Click the required widget.

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

   <img src="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" alt="javascript" width="1665" height="869" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/javascript_13.png" />

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

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

   <img src="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" alt="chat-widget" width="408" height="706" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/chat-widget_14.png" />

   * The following screenshot shows **Amazon Connect** integrated with **Agent AI**:
     <img src="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" alt="amazon-connect-with-agentai-chat" width="1102" height="454" data-path="ai-for-service/agentai/integration/amazon-connect-ccp-agentai-chat/images/amazon-connect-with-agentai-chat_15.png" />

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