This document provides an example integration with Contact Center AI Platform (CCAI Platform) custom CRM using EspoCRM. EspoCRM is a free, open-source CRM application that helps businesses manage sales, marketing, and customer support with a customizable interface. It offers features like contact management, activity tracking, sales automation, and inventory management, with options for self-hosting or cloud deployment.
To set up your own instance of EspoCRM, see the EspoCRM installation page .
Before you begin
Do the following:
-
Configure your firewall to permit traffic from CCAI Platform.
-
Create an API user in your EspoCRM instance—for example,
google_integration_user. For more information, see API in the EspoCRM Documentation. -
Create a role in your EspoCRM instance with the Create, Read, and Updateactions that accesses the following:
- Contacts: to find or create callers
- Cases: to search for and log tickets
For more information, see Role Management in the ExpoCRM documentation.
Configure a connection from EspoCRM to CCAI Platform
To configure a connection from EspoCRM to CCAI Platform, follow these steps:
- In the CCAI Platform portal, click Settings > Developer Settings. If you don't see the Settingsmenu, click Menu.
- For Agent Platform, select Custom CRM.
- Click the Display CRM in CCAI Platform portal Portaltoggle to the on position.
- In the Display URLfield, enter the URL to embed in the
CCAI Platform portal–for example,
https:// YOUR_ESPO_DOMAIN /#Case/view/{RECORD_ID}. - For CRM lookup method, select Generic API.
- To authenticate using a custom header, do the following:
- In the Authentication Methodsection, select Custom Header.
- Click Add field. The Add Fielddialog appears.
- In the Field Keyfield, enter
X-Api-Key. - In the Field Valuefield, enter the API key generated when you created an API user in your EspoCRM.
- Click Save.
- In the Field Keyfield, enter
- To set the CRM lookup URL, do the following:
- In the CRM lookup URLsection, in the Record lookup URLfield,
enter the URL to look up a record—for example,
https:// YOUR_ESPO_DOMAIN /#Case/view/{RECORD_ID}. - In the Account lookup URLfield, enter the URL to look up an
account—for example,
https:// YOUR_ESPO_DOMAIN /#Contact/view/{ACCOUNT_ID}. - Click Save. ## Configure API endpoints
- In the CRM lookup URLsection, in the Record lookup URLfield,
enter the URL to look up a record—for example,
Configure endpoints that are compatible with EspoCRM to ensure that your integration has the components for looking up accounts (contacts) and records (cases). For more information about compatible variables, see API Overview in the EspoCRM documentation.
Configure API account endpoints
This section explains how to configure API account endpoints.
Configure a Find an account by query endpoint
To configure the Find an account by query endpoint, follow these steps:
- In the CCAI Platform, click Settings > Developer Settings. If you don't see the Settingsmenu, click Menu.
- In the CRMpane, go to the API accountsection.
- For Find an account by query endpoint, click Setup. The Generic API Endpoint Setuppage appears.
- In the URLfield, enter the URL to look up an account–for example,
https:// YOUR_ESPO_DOMAIN /api/v1/Contact. - For Method, select GET.
-
To configure request parameters, do the following:
- To configure the first request parameter, follow these steps:
- Click Add field. The Add Fielddialog appears.
- In the Field Keyfield, enter
where[0][attribute]. - In the Field Valuefield, enter
phoneNumber. - Click Save.
-
To configure the rest of the request parameters, repeat the previous steps using the information in the following table. You've already created the first request parameter.
Field Key Field Value where[0][attribute]phoneNumberwhere[0][type]equalswhere[0][value]{PHONE_NUMBER}sortBycreatedAtascfalse
- To configure the first request parameter, follow these steps:
-
In the Response Data Locationfield, enter
data.list. -
Click Save.
-
Click Back to Developer Settingsto return to the Developer Settingspage.
Configure a Find an account by ID endpoint
To configure the Find an account by ID endpoint, follow these steps:
- In the CRMpane, go to the API accountsection.
- For Find an account by ID endpoint, click Setup. The Generic API Endpoint Setuppage appears.
- In the URLfield, enter the URL to look up an account–for example,
https:// YOUR_ESPO_DOMAIN /api/v1/Contact/{ACCOUNT_ID}.- For Method, select GET.
- Set the Response Data Locationto
data. - Click Save.
- Click Return to developer settingsto return to the Developer Settingspage.
Configure a Create an account endpoint
To configure the Create an account endpoint, follow these steps:
- In the CRMpane, go to the API accountsection.
- For Create an account endpoint, click Setup. The Generic API Endpoint Setuppage appears.
- In the URLfield, enter the URL to look up an account–for example,
https:// YOUR_ESPO_DOMAIN /api/v1/Contact. - For Method, select POST.
-
To configure Request Parameters, do the following:
- To configure the first request parameter, follow these steps:
- For Request Parameters, click Add field. The Add Fielddialog appears.
- In the Field Keyfield, enter
phoneNumber. - In the Field Valuefield, enter
{PHONE_NUMBER}. - Click Save.
-
To configure the rest of the request parameters, repeat the previous step, using the information in the following table. You've already created the first request parameter.
Parameter Key Parameter Value phoneNumber{PHONE_NUMBER}firstNameNew CallerlastName{CALL_ID}nameNew Caller {CALL_ID}
- To configure the first request parameter, follow these steps:
-
Set the Response data locationto
data. -
Set the Object ID locationto
id. -
Click Save.
-
Click Return to developer settingsto return to the Developer Settingspage.
Configure an Update an account endpoint
To configure the Update an account endpoint, follow these steps:
- In the CRMpane, go to the API accountsection.
- For Update an account endpoint, click Setup. The Generic API Endpoint Setuppage appears.
- In the URLfield, enter the URL to look up an account–for example,
https:// YOUR_ESPO_DOMAIN /api/v1/Contact. - For Method, select PUT.
-
To configure Request Parameters, do the following:
- To configure the first request parameter, follow these steps:
- For Request Parameters, click Add field. The Add Fielddialog appears.
- In the Field Keyfield, enter
contactId. - In the Field Valuefield, enter
{PHONE_NUMBER}. - Click Save.
-
To configure the rest of the request parameters, repeat the previous step, using the information in the following table. You've already created the first request parameter.
Parameter Key Parameter Value contactId{PHONE_NUMBER}phoneNumberNew Caller
- To configure the first request parameter, follow these steps:
-
Set the Response data locationto
data. -
Click Save.
-
Click Return to developer settingsto return to the Developer Settingspage.
Configure API record endpoints
This section explains how to configure API record endpoints.
Configure a Find a record by query endpoint
To configure the Find a record by query endpoint, follow these steps:
- In the CRMpane, go to the API recordsection.
- For Find a record by query endpoint, click Setup. The Generic API Endpoint Setuppage appears.
- In the URLfield, enter the URL to look up an account–for example,
https:// YOUR_ESPO_DOMAIN /api/v1/Case. - For Method, select GET.
-
To configure Request Parameters, do the following:
- To configure the first request parameter, follow these steps:
- For Request Parameters, click Add field. The Add Fielddialog appears.
- In the Field Keyfield, enter
where[0][attribute]. - In the Field Valuefield, enter
contactId. - Click Save.
-
To configure the rest of the request parameters, repeat the previous step, using the information in the following table. You've already created the first request parameter.
Field Key Field Value where[0][attribute]contactIdwhere[0][type]equalswhere[0][value]{ACCOUNT_ID}contactId{ACCOUNT_ID}sortBycreatedAtascfalse
- To configure the first request parameter, follow these steps:
-
In the Response Data Locationfield, enter
data.list. -
Click Save.
-
Click Return to developer settingsto return to the Developer Settingspage.
Configure a Find a record by ID endpoint
Often used in SDK based interactions, this lets you pass a specific record ID to associate the interaction with. To configure the Find a record by ID endpoint, follow these steps:
- In the CRMpane, go to the API recordsection.
- For Find a record by ID endpoint, click Setup. The Generic API Endpoint Setuppage appears.
- In the URLfield, enter the URL to look up an account–for example,
https:// YOUR_ESPO_DOMAIN /api/v1/Case/{RECORD_ID}. - For Method, select GET.
- In the Response Data Locationfield, enter
data. - Click Save.
- Click Return to developer settingsto return to the Developer Settingspage.
Configure a Create a record endpoint
To configure the Create a record endpoint, follow these steps:
- In the CRMpane, go to the API recordsection.
- For Create a record endpoint, click Setup. The Generic API Endpoint Setuppage appears.
- In the URLfield, enter the URL to look up an account–for example,
https:// YOUR_ESPO_DOMAIN /api/v1/Case. - For Method, select POST.
-
To configure Request Parameters, do the following:
- To configure the first request parameter, follow these steps:
- For Request Parameters, click Add field. The Add Fielddialog appears.
- In the Field Keyfield, enter
description. - In the Field Valuefield, enter
CALL Session:{CALL_ID}. - Click Save.
-
To configure the rest of the request parameters, repeat the previous step, using the information in the following table. You've already created the first request parameter.
Parameter Key Parameter Value descriptionCall Session: {CALL_ID}nameInbound Call from {ANI}contactId{ACCOUNT_ID}statusNewcchatId{CHAT_ID}ccallId{CALL_ID}cChannel{CHANNEL}Type{SESSION_TYPE}
- To configure the first request parameter, follow these steps:
-
In the Response Data Locationfield, enter
data. -
In the Object ID Locationfield, enter
id. -
Click Save.
-
Click Return to developer settingsto return to the Developer Settingspage.
Configure an Update a record endpoint
To configure the Update a record endpoint, follow these steps:
- In the CRMpane, go to the API recordsection.
- For Update a record endpoint, click Setup. The Generic API Endpoint Setuppage appears.
- In the URLfield, enter the URL to look up an account–for example,
https:// YOUR_ESPO_DOMAIN /api/v1/Case/{RECORD_ID}. - For Method, select PUT.
-
To configure Request Parameters, do the following:
- To configure the first request parameter, follow these steps:
- For Request Parameters, click Add field. The Add Fielddialog appears.
- In the Field Keyfield, enter
parentId. - In the Field Valuefield, enter
{RECORD_ID}. - Click Save.
-
To configure the rest of the request parameters, repeat the previous step, using the information in the following table. You've already created the first request parameter.
Parameter Key Parameter Value parentId{RECORD_ID}parentTypeCasestatusNewdescription{TICKET_DESCRIPTION}
- To configure the first request parameter, follow these steps:
-
In the Response data locationfield, enter
data. -
Click Save.
-
Click Return to developer settingsto return to the Developer Settingspage.

