CRM: Upsert Contact
The CRM integration allows you to automatically create or update contacts during the conversation, without human intervention. The operation is always an "upsert": if the contact already exists (by phone or email), it is updated; otherwise, it is created.
Configuration
{
"type": "CRM",
"subtype": "UPSERT_CONTACT",
"name": "customerName",
"phone": "customerPhone",
"email": "customerEmail",
"company": "customerCompany"
}Available Fields
All fields are individually optional, but at least name and phone or email is recommended for identification.
Identification Data
| Field | Type | Description |
|---|---|---|
name |
string | Full name of the contact |
identity |
string | SSN, tax ID, or identification document |
phone |
string | Phone (used as lookup key in upsert) |
email |
string |
Professional Data
| Field | Type | Description |
|---|---|---|
company |
string | Company name where they work |
position |
string | Job title/role |
Personal Data
| Field | Type | Description |
|---|---|---|
birthday |
string | Date of birth (e.g.: 1990-05-20) |
Address
| Field | Type | Description |
|---|---|---|
zipCode |
string | ZIP code |
country |
string | Country |
state |
string | State |
city |
string | City |
district |
string | District/neighborhood |
street |
string | Street address |
number |
string | Building number |
complement |
string | Complement/apt |
Parameter Substitution
Field values must be the exact parameter name defined in the trigger: without $, without {{}}. The platform substitutes automatically.
Trigger definition:
{
"name": "register_lead",
"parameters": {
"properties": {
"customerName": { "type": "string", "description": "Customer full name" },
"customerEmail": { "type": "string", "description": "Email" },
"customerCompany": { "type": "string", "description": "Company" },
"customerRole": { "type": "string", "description": "Job title/role" }
},
"required": ["customerName", "customerEmail"]
}
}CRM action configuration:
{
"type": "CRM",
"subtype": "UPSERT_CONTACT",
"name": "customerName",
"email": "customerEmail",
"company": "customerCompany",
"position": "customerRole"
}Note that customerName (without $) references the parameter extracted by the LLM.
Full Example: Sales Lead Capture
Assistant prompt:
You are a pre-sales assistant. After understanding the customer's need,
collect their full name, corporate email, and company name.
After collecting, automatically register in the CRM.Trigger:
{
"name": "register_qualified_lead",
"description": "Registers the lead in the CRM after collecting the necessary data. Use when you have the customer's name, email, and company.",
"parameters": {
"properties": {
"name": { "type": "string" },
"email": { "type": "string" },
"company": { "type": "string" },
"interest": {
"type": "string",
"enum": ["starter", "growth", "enterprise"]
}
},
"required": ["name", "email", "company"]
},
"action": {
"type": "CRM",
"subtype": "UPSERT_CONTACT",
"name": "name",
"email": "email",
"company": "company"
},
"interpretResponse": false
}The interest field is extracted by the LLM but doesn't go to the CRM: it would be sent via a separate webhook or used in the response.
Combining with Webhook
To make better use of the data, combine CRM with a Webhook in the same trigger or in sequential triggers:
- Trigger 1:
CRM / UPSERT_CONTACT: registers the contact - Trigger 2:
WEBHOOK: notifies the sales team via Slack/email
This is possible by configuring MaxInteractions = 2 on the assistant.