Skip to main content
This guide shows how to embed AI Copilot into a custom contact center or agent desktop using the Voice Copilot Endpoint. It helps developers test and validate Copilot quickly without a full contact-center setup. Works for both chat and voice.

Prerequisites

  • Configured the Voice Gateway integration:
    • If a Voice Copilot Endpoint is used voice or chat use cases.
    • If a Webhook Endpoint is used for voice use cases.

Restrictions

  • If you use a Webhook Endpoint, you will be charged for two conversations: one with the webhook and one with Agent Copilot.

Create an Endpoint

Mock a request via Postman or curl to validate the webhook accepts your session.
  • Voice Copilot
  • Webhook
  1. In the left-side menu of your Project, click Deploy > Endpoints.
  2. On the Endpoints page, click + New Endpoint.
  3. In the New Endpoint section, do the following:
    1. Select the Voice Copilot Endpoint type.
    2. Specify a unique name.
    3. Select a Flow from the list. Save changes.
  4. Go to the Configuration Information section and copy the URL from the Endpoint URL field.

Mock a Request

Send a POST request to the Endpoint which you configured in the previous step. Your web server should accept POST requests and process the JSON payload sent by Cognigy.AI. For testing purposes, you can use webhook.site as a temporary web server.
  • cURL
  • Postman
Replace https://<your-endpoint-url> with the Endpoint URL from your Endpoint’s settings.
curl -X POST https://<your-endpoint-url> \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user123",
    "sessionId": "session123",
    "text": "Hello, I need help with my order",
    "data": {
      "exampleKey": "exampleValue"
    }
  }'

Configure the Agent Copilot URL

When setting up the Agent Copilot, you can choose between embed or standalone Agent Copilot versions. Use the following format:
https://${AICopilotBaseUrl}/?userId=${userId}&sessionId=${sessionId}&URLToken=${URLToken}
Where:
  • AICopilotBaseUrl — the base URL of Agent Copilot (the main web address where the service is hosted).
  • sessionId — the Cognigy session ID. A session represents the interaction between the human agent and the Agent Copilot workspace.
  • userId — the Cognigy user ID. It helps Agent Copilot associate the interaction with a specific user.
  • URLToken — the Endpoint token from Cognigy.AI. To find this token, go to the Endpoint that you created previously. In the Endpoint URL field, copy the token after https://endpoint-trial.cognigy.ai/. For example, in the URL https://endpoint-trial.cognigy.ai/f38791ae20d4961acf0e97d9f377c4fe3df92894e1eff1c7a774a8ed089a4590, the token is f38791ae20d4961acf0e97d9f377c4fe3df92894e1eff1c7a774a8ed089a4590. Only authorized users can access the Agent Copilot system through this URL.
Example URL:
https://ai-copilot-trial.cognigy.ai/?sessionId=session123&userId=user123&URLToken=a4d5c86c98f27730311591f28d194510e05ffed30ca148e3344970defd418e7d

(Optional) Embed in the Agent Desktop

You can embed Agent Copilot into any contact center interface using an iframe. Some platforms may require additional setup, such as enabling scripts or granting API access. Embedding is specific to the contact center, so verify the integration on the provider’s side to ensure proper functionality.
<iframe
  src="https://${AICopilotBaseUrl}/?userId=${userId}&sessionId=${sessionId}&URLToken=${URLToken}}"
  width="100%"
  height="720"
  style="border:0;">
</iframe>

More Information


1: You must provide at least one of text or data. You can send either, or both. If both are missing or invalid, the REST Endpoint throws an error.