Download OpenAPI specification:
The LeadTruffle Public API allows you to programmatically access your leads, clients, and configure webhooks.
All API endpoints are relative to the following base URL:
https://pub-api.leadtruffle.com/api
All API endpoints require an API key to be sent in the X-API-Key header. You can obtain an API key from your LeadTruffle dashboard.
We offer two versions of webhooks: V1 and V2. We strongly recommend using V2 webhooks for all new integrations. V2 webhooks support a wider range of event types and provide more detailed payloads. Future event types will only be added to V2 webhooks.
The API implements rate limiting based on your companyId, you can generally call the API roughly once per second. If you exceed the rate limit, you'll receive a 429 status code.
List endpoints support cursor-based pagination using the since parameter and return a hasMore flag in the response.
https://pub-api.leadtruffle.com/api/v1/pub/leads
The Leads endpoint allows you to retrieve a paginated list of leads for your company. This returns a maximum of 10 records per result.
https://pub-api.leadtruffle.com/api/v1/pub/leads/{uuid}
The Leads/{uuid} endpoint allows you to retrieve a specific lead by its UUID. This is useful in case you need to access the updates to a lead if further qualifying information was recorded via the course fo the conversation with the AI.
Retrieve a specific lead by its UUID
| uuid required | string <uuid> The UUID of the lead to retrieve |
{- "success": true,
- "data": {
- "type": "conversation_completed",
- "clientId": "456",
- "leadId": "123",
- "companyId": "789",
- "leadQualificationStatus": "COMPLETED",
- "leadInformation": {
- "name": "John Doe",
- "firstName": "John",
- "lastName": "Doe",
- "email": "john@example.com",
- "phone": "+18001234567",
- "additionalData": {
- "source": "popup",
- "message": "I need help with..."
}
}, - "trackingData": {
- "source": "popup",
- "utm_source": "google",
- "utm_medium": "cpc",
- "utm_campaign": "home_renovation",
- "utm_term": "home_renovation_cost",
- "utm_content": "home_renovation_cost",
- "gclid": "1234567890",
- "fbclid": "1234567890",
- "msclkid": "1234567890",
- "ttclid": "1234567890",
- "snapcid": "1234567890",
- "gbraid": "gbraid_example",
- "wbraid": "wbraid_example",
- "gad_source": "google_ads",
- "igshid": "ig_share_id",
- "gclsrc": "aw.ds",
- "srsltid": "search_result_id",
- "ga_client_id": "123456789.987654321",
- "ga_session_id": "1700000000",
- "pageInfo": {
- "title": "Home - Best HVAC Services",
}
}, - "qualifyingData": {
- "example_budget": "$5000",
- "example_timeline": "Within 3 months",
- "example_projectType": "Home Renovation"
}, - "commonFields": {
- "fullAddress": "111 main st, Austin TX 73301",
- "address": "111 main st",
- "zipcode": "73301",
- "state": "TX",
- "city": "Austin",
- "country": "US",
- "isHomeowner": true,
- "customerName": "John"
}, - "qualifyingDataSummary": "The client lives in a 3 bedroom house.\\nHas a budget of $2000.\\nzipcode is 45150.",
- "contactReason": "Client is interested in a home renovation project...",
- "timestamp": "2024-01-01T00:00:00Z",
- "isRepeatLead": false,
- "messageHistory": [
- {
- "direction": "inbound",
- "name": "AI Agent",
- "message": "How can we help you...",
- "date": "2024-01-01T00:00:00Z"
}
], - "userMedia": [
- {
- "type": "image/jpeg",
}
]
}
}Update the conversion status and notes for a specific lead.
This endpoint allows you to track the progress of leads through your sales funnel by updating their conversion status and adding notes for internal tracking.
Conversion Status Values:
The status update timestamp is automatically recorded for tracking purposes.
| uuid required | string <uuid> Example: db8db5a7-2f26-4e88-9c2a-969bad0f6a5b The UUID of the lead to update |
| conversionStatus required | string Enum: "NEW" "CONTACTED" "QUOTED" "WON" "LOST" "NURTURING" "CLOSED" The new conversion status for the lead |
| notes | string or null <= 1000 characters Optional notes about the lead status update |
{- "conversionStatus": "QUOTED"
}{- "success": true,
- "data": {
- "id": "db8db5a7-2f26-4e88-9c2a-969bad0f6a5b",
- "conversionStatus": "QUOTED",
- "conversionStatusUpdatedAt": "2024-01-15T14:30:00Z",
- "leadNotes": "Provided estimate for $3,500. Customer reviewing with spouse."
}
}Add a new webhook URL for missed call lead completion notifications.
When a lead conversation is completed, we will POST the payload described below to your webhook URL. The webhook will timeout after 10 seconds and we will retry failed deliveries up to 3 times with exponential backoff.
{
"type": "conversation_completed",
"clientId": "456",
"leadId": "123",
"companyId": "789",
"leadQualificationStatus": "COMPLETED",
"leadInformation": {
"name": "John Doe",
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"phone": "+18001234567",
"additionalData": {
"source": "popup",
"message": "I need help with..."
}
},
"trackingData": {
"source": "popup",
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "home_renovation",
"pageInfo": {
"title": "Home - Best HVAC Services",
"referrer": "https://www.google.com/",
"currentUrl": "http://localhost:3002/index.html"
}
},
"qualifyingData": {
"example_budget": "$5000",
"example_timeline": "Within 3 months",
"example_projectType": "Home Renovation"
},
"commonFields": {
"fullAddress": "111 main st, Austin TX 73301",
"address": "111 main st",
"zipcode": "73301",
"state": "TX",
"city": "Austin",
"country": "US",
"isHomeowner": true,
"customerName": "John"
},
"qualifyingDataSummary": "The client lives in a 3 bedroom house.\nHas a budget of $2000.\nzipcode is 45150.",
"contactReason": "Client is interested in a home renovation project...",
"timestamp": "2024-01-01T00:00:00Z",
"messageHistory": [
{
"direction": "outbound",
"name": "AI Agent",
"message": "How can we help you...",
"date": "2024-01-01T00:00:00Z"
},
{
"direction": "inbound",
"name": "John Doe",
"message": "I need help with...",
"date": "2024-01-01T00:01:00Z"
}
],
"userMedia": [
{
"type": "image/jpeg",
"url": "https://tooldesk-public-user-uploads.s3.us-west-2.amazonaws.com/email-assets/leadtruffle-Wordmark-white.png"
}
]
}
| url required | string <uri> |
{
}{- "success": true,
}Remove an existing webhook URL for missed call lead completion notifications
| url required | string <uri> |
{
}{- "success": true,
}Add a new webhook URL for chat widget lead completion notifications.
When a lead conversation is completed, we will POST the payload described below to your webhook URL. The webhook will timeout after 10 seconds and we will retry failed deliveries up to 3 times with exponential backoff.
{
"type": "conversation_completed",
"clientId": "456",
"leadId": "123",
"companyId": "789",
"leadQualificationStatus": "COMPLETED",
"leadInformation": {
"name": "John Doe",
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"phone": "+18001234567",
"additionalData": {
"source": "popup",
"message": "I need help with..."
}
},
"trackingData": {
"source": "popup",
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "home_renovation",
"pageInfo": {
"title": "Home - Best HVAC Services",
"referrer": "https://www.google.com/",
"currentUrl": "http://localhost:3002/index.html"
}
},
"qualifyingData": {
"example_budget": "$5000",
"example_timeline": "Within 3 months",
"example_projectType": "Home Renovation"
},
"commonFields": {
"fullAddress": "111 main st, Austin TX 73301",
"address": "111 main st",
"zipcode": "73301",
"state": "TX",
"city": "Austin",
"country": "US",
"isHomeowner": true,
"customerName": "John"
},
"qualifyingDataSummary": "The client lives in a 3 bedroom house.\nHas a budget of $2000.\nzipcode is 45150.",
"contactReason": "Client is interested in a home renovation project...",
"timestamp": "2024-01-01T00:00:00Z",
"messageHistory": [
{
"direction": "outbound",
"name": "AI Agent",
"message": "How can we help you...",
"date": "2024-01-01T00:00:00Z"
},
{
"direction": "inbound",
"name": "John Doe",
"message": "I need help with...",
"date": "2024-01-01T00:01:00Z"
}
],
"userMedia": [
{
"type": "image/jpeg",
"url": "https://tooldesk-public-user-uploads.s3.us-west-2.amazonaws.com/email-assets/leadtruffle-Wordmark-white.png"
}
]
}
| url required | string <uri> |
{
}{- "success": true,
}Remove an existing webhook URL for chat widget lead completion notifications
| url required | string <uri> |
{
}{- "success": true,
}Creates a new client record or updates an existing one based on the phone number.
The phone number is used as the unique identifier for finding existing clients. Phone numbers are normalized to E.164 format internally (+1XXXXXXXXXX for US numbers).
When updating existing clients:
| phone required | string Phone number in E.164 format or US national format (e.g., +18001234567 or 8001234567) |
| firstName | string |
| lastName | string |
string <email> | |
| address1 | string |
| address2 | string |
| city | string |
| state | string |
| zip | string |
| country | string |
{- "phone": "8001234567",
- "firstName": "John",
- "lastName": "Doe",
- "email": "john.doe@example.com",
- "address1": "123 Main St",
- "address2": "Unit 456",
- "city": "Austin",
- "state": "TX",
- "zip": "78701",
- "country": "US"
}{- "success": true,
- "data": {
- "id": "415f2b29-39e6-4182-9d6f-ec2d817f01c2",
- "companyId": "f096f9e3-001d-49ac-864c-3d73453bbe08",
- "primaryPhone": "+18001234567",
- "firstName": "John",
- "lastName": "Doe",
- "primaryEmail": "john.doe@example.com",
- "address": "123 Main St",
- "address2": "Unit 456",
- "city": "Austin",
- "state": "TX",
- "zipCode": "78701",
- "country": "US",
- "isLead": true,
- "leadStatus": "NEW",
- "createdAt": "2023-06-01T00:00:00Z",
- "updatedAt": "2023-06-01T00:00:00Z"
}, - "action": "CREATED"
}Retrieves a client record by their phone number.
The phone number should be in E.164 format (+1XXXXXXXXXX) or a standard US format. The system will normalize the phone number to E.164 format before searching.
Returns a 404 error if no client with the specified phone number exists for the authenticated company.
| phone required | string Example: 8001234567 Phone number in E.164 format or US national format (e.g., +18001234567 or 8001234567) |
{- "success": true,
- "data": {
- "id": "415f2b29-39e6-4182-9d6f-ec2d817f01c2",
- "companyId": "f096f9e3-001d-49ac-864c-3d73453bbe08",
- "primaryPhone": "+17345520800",
- "firstName": "John",
- "lastName": "Doe",
- "primaryEmail": "john.doe@example.com",
- "address": "123 Main St",
- "address2": "Unit 456",
- "city": "Austin",
- "state": "TX",
- "zipCode": "78701",
- "country": "US",
- "isLead": true,
- "leadStatus": "NEW",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}Retrieve a paginated list of leads for your company without full conversation history. This endpoint is optimized for performance and can return up to 100 records at once.
Use this endpoint when you need to fetch larger batches of leads and don't require the full message history for each lead.
| before | string <date-time> Example: before=2024-01-01T00:00:00Z Pagination cursor - get leads created before this timestamp (ISO8601). Defaults to current time if not provided. |
| limit | integer [ 1 .. 100 ] Default: 100 Maximum number of leads to return (max 100) |
{- "success": true,
- "data": {
- "leads": [
- {
- "type": "conversation_completed",
- "clientId": "456",
- "leadId": "123",
- "companyId": "789",
- "leadQualificationStatus": "COMPLETED",
- "leadInformation": {
- "name": "John Doe",
- "firstName": "John",
- "lastName": "Doe",
- "email": "john@example.com",
- "phone": "+18001234567",
- "additionalData": {
- "source": "popup",
- "message": "I need help with..."
}
}, - "trackingData": {
- "source": "popup",
- "utm_source": "google",
- "utm_medium": "cpc",
- "utm_campaign": "home_renovation",
- "utm_term": "home_renovation_cost",
- "utm_content": "home_renovation_cost",
- "gclid": "1234567890",
- "fbclid": "1234567890",
- "msclkid": "1234567890",
- "ttclid": "1234567890",
- "snapcid": "1234567890",
- "gbraid": "gbraid_example",
- "wbraid": "wbraid_example",
- "gad_source": "google_ads",
- "igshid": "ig_share_id",
- "gclsrc": "aw.ds",
- "srsltid": "search_result_id",
- "ga_client_id": "123456789.987654321",
- "ga_session_id": "1700000000",
- "pageInfo": {
- "title": "Home - Best HVAC Services",
}
}, - "qualifyingData": {
- "example_budget": "$5000",
- "example_timeline": "Within 3 months",
- "example_projectType": "Home Renovation"
}, - "commonFields": {
- "fullAddress": "111 main st, Austin TX 73301",
- "address": "111 main st",
- "zipcode": "73301",
- "state": "TX",
- "city": "Austin",
- "country": "US",
- "isHomeowner": true,
- "customerName": "John"
}, - "qualifyingDataSummary": "The client lives in a 3 bedroom house.\\nHas a budget of $2000.\\nzipcode is 45150.",
- "contactReason": "Client is interested in a home renovation project...",
- "timestamp": "2024-01-01T00:00:00Z",
- "isRepeatLead": false,
- "messageHistory": [
- {
- "direction": "inbound",
- "name": "AI Agent",
- "message": "How can we help you...",
- "date": "2024-01-01T00:00:00Z"
}
], - "userMedia": [
- {
- "type": "image/jpeg",
}
]
}
], - "hasMore": true
}
}Retrieve all configured V2 webhooks for your company.
V2 webhooks provide improved payload structure and support for multiple event types:
Each webhook includes tracking information such as delivery success/failure rates and timestamps.
{- "success": true,
- "data": [
- {
- "id": "550e8400-e29b-41d4-a716-446655440000",
- "companyId": "f096f9e3-001d-49ac-864c-3d73453bbe08",
- "eventType": "LEAD_CREATED",
- "enabled": true,
- "failedAttempts": 0,
- "lastFailedAt": "2019-08-24T14:15:22Z",
- "lastSuccessAt": "2019-08-24T14:15:22Z",
- "integrationSource": "API",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]
}Create a new V2 webhook for your company.
V2 webhooks support three event types:
Fires instantly when a new lead form submission is received from your website or missed call. The fastest way to get notified of new leads.
Fires when any message is replied to by a lead or customer. Useful for Slack integrations to notify your team of new responses in real-time.
Fires when a conversation is marked complete - either after lead qualification finishes or an AI call ends. Perfect for triggering follow-up workflows in your CRM.
Headers sent with webhook:
Content-Type: application/jsonx-origin: leadtrufflex-event-type: [EVENT_TYPE]Delivery & Retry:
| eventType required | string Enum: "CONVERSATION_COMPLETED" "MESSAGE_REPLY" "LEAD_CREATED" "NEW_APPOINTMENT" Type of event that triggers this webhook |
| url required | string <uri> <= 1000 characters URL where webhook payloads will be sent via HTTP POST |
| secret | string or null <= 200 characters Optional secret for webhook verification (currently not used) |
{- "eventType": "LEAD_CREATED",
}{- "success": true,
- "data": {
- "id": "550e8400-e29b-41d4-a716-446655440000",
- "companyId": "f096f9e3-001d-49ac-864c-3d73453bbe08",
- "eventType": "LEAD_CREATED",
- "enabled": true,
- "failedAttempts": 0,
- "lastFailedAt": "2019-08-24T14:15:22Z",
- "lastSuccessAt": "2019-08-24T14:15:22Z",
- "integrationSource": "API",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}Update an existing V2 webhook by ID.
You can partially update webhooks by including only the fields you want to change. All fields are optional in the update request.
Special fields:
enabled: Set to false to disable the webhook without deleting itclearErrors: Set to true to reset the failed delivery counter| id required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 The UUID of the webhook to update |
| eventType | string Enum: "CONVERSATION_COMPLETED" "MESSAGE_REPLY" "LEAD_CREATED" "NEW_APPOINTMENT" Type of event that triggers this webhook |
| url | string <uri> <= 1000 characters URL where webhook payloads will be sent via HTTP POST |
| secret | string or null <= 200 characters Optional secret for webhook verification (currently not used) |
| enabled | boolean Whether the webhook is active |
| clearErrors | boolean Clear any existing error history for this webhook |
{- "success": true,
- "data": {
- "id": "550e8400-e29b-41d4-a716-446655440000",
- "companyId": "f096f9e3-001d-49ac-864c-3d73453bbe08",
- "eventType": "LEAD_CREATED",
- "enabled": true,
- "failedAttempts": 0,
- "lastFailedAt": "2019-08-24T14:15:22Z",
- "lastSuccessAt": "2019-08-24T14:15:22Z",
- "integrationSource": "API",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}Delete an existing V2 webhook by ID.
This action is permanent and cannot be undone. The webhook will immediately stop receiving events and all associated delivery history will be preserved for audit purposes.
| id required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 The UUID of the webhook to delete |
{- "success": true,
- "message": "Webhook deleted successfully"
}Retrieve a specific lead in the "lead created" format by its UUID.
This endpoint returns the same payload format that is sent to LEAD_CREATED webhooks. Designed specifically for Zapier integration requirements.
| uuid required | string <uuid> Example: db8db5a7-2f26-4e88-9c2a-969bad0f6a5b The UUID of the lead to retrieve |
{- "success": true,
- "data": {
- "eventType": "LEAD_CREATED",
- "eventTypeDetails": "NEW_CHAT_WIDGET_SUBMISSION",
- "leadId": "3c6e2b8e-0e8f-48db-8791-27271df10113",
- "clientId": "5e505642-9024-474d-9434-e5a44f505cc5",
- "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
- "name": "John Doe",
- "firstName": "John",
- "lastName": "Doe",
- "email": "john@example.com",
- "phone": "+18001234567",
- "message": "I need help with HVAC repair",
- "timestamp": "2019-08-24T14:15:22Z",
- "isRepeatLead": true,
- "qualificationSource": "WEBSITE_TEXTING",
- "isManualTakeoverEnabled": true,
- "trackingData": {
- "source": "string",
- "utm_source": "string",
- "utm_medium": "string",
- "utm_campaign": "string",
- "utm_term": "string",
- "utm_content": "string",
- "gclid": "string",
- "fbclid": "string",
- "msclkid": "string",
- "ttclid": "string",
- "snapcid": "string",
- "gbraid": "string",
- "wbraid": "string",
- "gad_source": "string",
- "igshid": "string",
- "gclsrc": "string",
- "srsltid": "string",
- "ga_client_id": "string",
- "ga_session_id": "string",
- "pageInfo": {
- "currentUrl": "string",
- "referrer": "string",
- "title": "string"
}
}, - "missedCall": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "originalDialedNumber": "string",
- "inboundCaller": "string",
- "voicemailFileLink": "string",
- "voicemailTranscription": "string",
- "voicemailSummary": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}, - "aiHandledCall": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "transcriptSummary": "string",
- "status": "string",
- "fullTranscript": "string",
- "inboundCaller": "string",
- "originalDialedNumber": "string",
- "durationSeconds": 0,
- "recordingUrl": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}
}
}Retrieve a paginated list of leads in the "lead created" format.
This endpoint returns the same payload format that is sent to LEAD_CREATED webhooks. Returns up to 100 records per request. Designed specifically for Zapier integration requirements.
This is the abbreviated format that gets delivered when we first receive a lead, before the conversation is completed.
| before | string <date-time> Example: before=2024-01-01T00:00:00Z Pagination cursor - get leads created before this timestamp (ISO8601). Defaults to current time if not provided. |
| limit | integer [ 1 .. 100 ] Default: 100 Maximum number of leads to return (max 100) |
{- "success": true,
- "data": {
- "leads": [
- {
- "eventType": "LEAD_CREATED",
- "eventTypeDetails": "NEW_CHAT_WIDGET_SUBMISSION",
- "leadId": "3c6e2b8e-0e8f-48db-8791-27271df10113",
- "clientId": "5e505642-9024-474d-9434-e5a44f505cc5",
- "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
- "name": "John Doe",
- "firstName": "John",
- "lastName": "Doe",
- "email": "john@example.com",
- "phone": "+18001234567",
- "message": "I need help with HVAC repair",
- "timestamp": "2019-08-24T14:15:22Z",
- "isRepeatLead": true,
- "qualificationSource": "WEBSITE_TEXTING",
- "isManualTakeoverEnabled": true,
- "trackingData": {
- "source": "string",
- "utm_source": "string",
- "utm_medium": "string",
- "utm_campaign": "string",
- "utm_term": "string",
- "utm_content": "string",
- "gclid": "string",
- "fbclid": "string",
- "msclkid": "string",
- "ttclid": "string",
- "snapcid": "string",
- "gbraid": "string",
- "wbraid": "string",
- "gad_source": "string",
- "igshid": "string",
- "gclsrc": "string",
- "srsltid": "string",
- "ga_client_id": "string",
- "ga_session_id": "string",
- "pageInfo": {
- "currentUrl": "string",
- "referrer": "string",
- "title": "string"
}
}, - "missedCall": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "originalDialedNumber": "string",
- "inboundCaller": "string",
- "voicemailFileLink": "string",
- "voicemailTranscription": "string",
- "voicemailSummary": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}, - "aiHandledCall": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "transcriptSummary": "string",
- "status": "string",
- "fullTranscript": "string",
- "inboundCaller": "string",
- "originalDialedNumber": "string",
- "durationSeconds": 0,
- "recordingUrl": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}
}
], - "hasMore": true
}
}Retrieve a specific lead in the "conversation completed" format by its UUID.
This endpoint returns the same payload format that is sent to CONVERSATION_COMPLETED webhooks. Designed specifically for Zapier integration requirements.
| uuid required | string <uuid> Example: db8db5a7-2f26-4e88-9c2a-969bad0f6a5b The UUID of the lead to retrieve |
{- "success": true,
- "data": {
- "eventType": "CONVERSATION_COMPLETED",
- "eventTypeDetails": "CONVERSATION_COMPLETE_CHAT_WIDGET",
- "clientId": "5e505642-9024-474d-9434-e5a44f505cc5",
- "leadId": "3c6e2b8e-0e8f-48db-8791-27271df10113",
- "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
- "isRepeatLead": true,
- "leadInformation": {
- "name": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "phone": "string",
- "additionalData": { }
}, - "commonFields": {
- "fullAddress": "string",
- "address": "string",
- "zipcode": "string",
- "state": "string",
- "city": "string",
- "country": "string",
- "isHomeowner": true,
- "customerName": "string",
- "email": "string"
}, - "trackingData": {
- "source": "string",
- "utm_source": "string",
- "utm_medium": "string",
- "utm_campaign": "string",
- "utm_term": "string",
- "utm_content": "string",
- "gclid": "string",
- "fbclid": "string",
- "msclkid": "string",
- "ttclid": "string",
- "snapcid": "string",
- "gbraid": "string",
- "wbraid": "string",
- "gad_source": "string",
- "igshid": "string",
- "gclsrc": "string",
- "srsltid": "string",
- "ga_client_id": "string",
- "ga_session_id": "string",
- "pageInfo": {
- "currentUrl": "string",
- "referrer": "string",
- "title": "string"
}
}, - "leadQualificationStatus": "COMPLETED",
- "qualificationSource": "WEBSITE_TEXTING",
- "isManualTakeoverEnabled": true,
- "qualifyingData": {
- "contactReason": "string"
}, - "qualifyingDataSummary": "string",
- "contactReason": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "messageHistory": [
- {
- "direction": "inbound",
- "name": "string",
- "message": "string",
- "date": "2019-08-24T14:15:22Z",
- "mediaUrl": "string",
- "additionalMediaUrls": [
- "string"
]
}
], - "userMedia": [
- {
- "type": "string",
- "url": "string"
}
], - "aiHandledCall": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "transcriptSummary": "string",
- "status": "string",
- "fullTranscript": "string",
- "inboundCaller": "string",
- "originalDialedNumber": "string",
- "durationSeconds": 0,
- "recordingUrl": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}, - "missedCall": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "originalDialedNumber": "string",
- "inboundCaller": "string",
- "voicemailFileLink": "string",
- "voicemailTranscription": "string",
- "voicemailSummary": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}
}
}Retrieve a paginated list of leads in the "conversation completed" format.
This endpoint returns the same payload format that is sent to CONVERSATION_COMPLETED webhooks. Returns up to 10 records per request due to the larger payload size (includes full message history). Designed specifically for Zapier integration requirements.
This is what gets delivered to the conversation complete webhook - the same lead data but with full message history and completed qualification information.
| before | string <date-time> Example: before=2024-01-01T00:00:00Z Pagination cursor - get leads created before this timestamp (ISO8601). Defaults to current time if not provided. |
| limit | integer [ 1 .. 10 ] Default: 10 Maximum number of leads to return (max 10) |
{- "success": true,
- "data": {
- "leads": [
- {
- "eventType": "CONVERSATION_COMPLETED",
- "eventTypeDetails": "CONVERSATION_COMPLETE_CHAT_WIDGET",
- "clientId": "5e505642-9024-474d-9434-e5a44f505cc5",
- "leadId": "3c6e2b8e-0e8f-48db-8791-27271df10113",
- "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
- "isRepeatLead": true,
- "leadInformation": {
- "name": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "phone": "string",
- "additionalData": { }
}, - "commonFields": {
- "fullAddress": "string",
- "address": "string",
- "zipcode": "string",
- "state": "string",
- "city": "string",
- "country": "string",
- "isHomeowner": true,
- "customerName": "string",
- "email": "string"
}, - "trackingData": {
- "source": "string",
- "utm_source": "string",
- "utm_medium": "string",
- "utm_campaign": "string",
- "utm_term": "string",
- "utm_content": "string",
- "gclid": "string",
- "fbclid": "string",
- "msclkid": "string",
- "ttclid": "string",
- "snapcid": "string",
- "gbraid": "string",
- "wbraid": "string",
- "gad_source": "string",
- "igshid": "string",
- "gclsrc": "string",
- "srsltid": "string",
- "ga_client_id": "string",
- "ga_session_id": "string",
- "pageInfo": {
- "currentUrl": "string",
- "referrer": "string",
- "title": "string"
}
}, - "leadQualificationStatus": "COMPLETED",
- "qualificationSource": "WEBSITE_TEXTING",
- "isManualTakeoverEnabled": true,
- "qualifyingData": {
- "contactReason": "string"
}, - "qualifyingDataSummary": "string",
- "contactReason": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "messageHistory": [
- {
- "direction": "inbound",
- "name": "string",
- "message": "string",
- "date": "2019-08-24T14:15:22Z",
- "mediaUrl": "string",
- "additionalMediaUrls": [
- "string"
]
}
], - "userMedia": [
- {
- "type": "string",
- "url": "string"
}
], - "aiHandledCall": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "transcriptSummary": "string",
- "status": "string",
- "fullTranscript": "string",
- "inboundCaller": "string",
- "originalDialedNumber": "string",
- "durationSeconds": 0,
- "recordingUrl": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}, - "missedCall": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "originalDialedNumber": "string",
- "inboundCaller": "string",
- "voicemailFileLink": "string",
- "voicemailTranscription": "string",
- "voicemailSummary": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}
}
], - "hasMore": true
}
}Retrieve the current chat widget configuration for your company.
This includes styling settings, AI agent configuration, and lead qualification settings. If no configuration exists, a default configuration will be created automatically.
{- "success": true,
- "data": {
- "id": "550e8400-e29b-41d4-a716-446655440000",
- "name": "Default Widget",
- "greetingMessage": "Welcome to our company! Text us now for immediate response.",
- "agentConfig": {
- "name": "Sarah",
- "popupEnabled": true,
- "popupOpenDelay": 5,
- "popupExitIntentEnabled": true,
- "popupHeader1": "Need Help?",
- "popupHeader2": "Chat with us now!",
- "popupBgColor": "#ffffff",
- "popupTextColor": "#000000",
- "popupMinNumberMessagesToday": 0,
- "popupCustomStyles": "string"
}, - "leadQualifierAgentConfig": {
- "agentInstructions": "You are a helpful assistant that qualifies leads for our HVAC company...",
- "maximumMessagesLimit": 8
}, - "primaryColor": "#007bff",
- "secondaryColor": "#6c757d",
- "backgroundColor": "#ffffff",
- "customCss": "string",
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}Update the chat widget configuration for your company.
You can partially update the configuration by including only the fields you want to change. This endpoint combines styling updates and AI agent configuration updates.
Key Configuration Options:
| greetingMessage | string or null <= 1000 characters The initial greeting message shown to visitors |
object or null AI agent styling and behavior configuration | |
| leadQualifierAgentEnabled | boolean or null Enable or disable the lead qualification AI agent |
object or null Lead qualification AI agent configuration | |
| primaryColor | string or null <= 50 characters Primary color for widget styling |
| secondaryColor | string or null <= 50 characters Secondary color for widget styling |
| backgroundColor | string or null <= 50 characters Background color for widget |
| customCss | string or null <= 10000 characters Custom CSS for advanced widget styling |
{- "greetingMessage": "Welcome to our company! How can we help?",
- "primaryColor": "#007bff",
- "secondaryColor": "#6c757d"
}{- "success": true,
- "data": {
- "id": "550e8400-e29b-41d4-a716-446655440000",
- "name": "Default Widget",
- "greetingMessage": "Welcome to our company! Text us now for immediate response.",
- "agentConfig": {
- "name": "Sarah",
- "popupEnabled": true,
- "popupOpenDelay": 5,
- "popupExitIntentEnabled": true,
- "popupHeader1": "Need Help?",
- "popupHeader2": "Chat with us now!",
- "popupBgColor": "#ffffff",
- "popupTextColor": "#000000",
- "popupMinNumberMessagesToday": 0,
- "popupCustomStyles": "string"
}, - "leadQualifierAgentConfig": {
- "agentInstructions": "You are a helpful assistant that qualifies leads for our HVAC company...",
- "maximumMessagesLimit": 8
}, - "primaryColor": "#007bff",
- "secondaryColor": "#6c757d",
- "backgroundColor": "#ffffff",
- "customCss": "string",
- "isActive": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}⚠️ RESTRICTED ENDPOINT - APPROVAL REQUIRED ⚠️
This endpoint allows you to programmatically submit leads and trigger the AI lead qualification process.
This endpoint may ONLY be used if ALL of the following conditions are met:
The following lead sources have been pre-approved for use with this endpoint:
SMS Opt-in Consent: You MUST collect explicit SMS opt-in consent from leads before using this endpoint. This includes:
Approval Process: Contact support@leadtruffle.com to:
{
"name": "John Doe",
"phone": "+15551234567",
"additionalData": {
"leadSource": "facebook",
"fbid": "923849028492034890283094",
"campaignId": "summer_hvac_2024",
"smsOptInConfirmed": "true",
"optInTimestamp": "2024-01-01T12:00:00Z"
}
}
The lead qualifier AI will automatically initiate an SMS conversation with the provided phone number using your configured qualification questions and company branding.
| name required | string [ 1 .. 200 ] characters Full name of the lead |
| phone required | string [ 1 .. 50 ] characters Phone number in E.164 format or US national format |
string or null <email> Email address of the lead (optional) | |
| message | string or null <= 1000 characters Initial message or inquiry from the lead |
object Additional tracking data and lead source information |
{- "name": "Sarah Johnson",
- "phone": "+15551234567",
- "email": "sarah.johnson@example.com",
- "message": "Interested in HVAC quote",
- "additionalData": {
- "leadSource": "facebook",
- "fbid": "923849028492034890283094",
- "campaignId": "summer_hvac_2024",
- "smsOptInConfirmed": "true"
}
}{- "success": true,
- "data": {
- "client": {
- "id": "415f2b29-39e6-4182-9d6f-ec2d817f01c2",
- "companyId": "f096f9e3-001d-49ac-864c-3d73453bbe08",
- "primaryPhone": "+17345520800",
- "firstName": "John",
- "lastName": "Doe",
- "primaryEmail": "john.doe@example.com",
- "address": "123 Main St",
- "address2": "Unit 456",
- "city": "Austin",
- "state": "TX",
- "zipCode": "78701",
- "country": "US",
- "isLead": true,
- "leadStatus": "NEW",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "leadSubmission": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
- "clientId": "5e505642-9024-474d-9434-e5a44f505cc5",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "phone": "string",
- "qualificationSource": "WEBSITE_TEXTING",
- "createdAt": "2019-08-24T14:15:22Z"
}, - "wasExistingClient": false,
- "isRepeatSubmission": false
}
}Report conversion data (revenue, status) for a specific lead.
This endpoint allows CRMs and external systems to report back when a lead converts to a customer. If a conversion already exists for the lead, it will be updated. Otherwise, a new conversion record is created.
Upsert Behavior:
Input:
Use Cases:
Important Notes:
Webhook Integration: When you report conversions via this API, the conversion data will be automatically included in all future webhook payloads for this lead (LEAD_CREATED, CONVERSATION_COMPLETED). This allows downstream systems to have complete lead lifecycle data including revenue tracking.
| leadId required | string <uuid> Lead ID to associate the conversion with. If provided, this is used directly. You may provide either leadId or phone. If both are provided, leadId is used. |
| phone | string Phone number of the lead to resolve the most recent lead submission for this company. E.164 format is recommended (e.g., +15551234567); US 10-digit formats are also accepted and normalized. You may provide either phone or leadId. If both are provided, leadId is used. |
| conversionStatus required | string Enum: "WON" "LOST" "QUOTED" "PENDING" "CONTACTED" "NURTURING" "CLOSED" The status of the lead conversion. Required field. |
| revenueAmount | string^\d+(\.\d{1,2})?$ Revenue amount as a decimal string with max 2 decimal places. Can be a string like "150.00" or a number. Valid range: 0.01 to 999,999,999.99 Optional field. |
| currency | string Default: "USD" Enum: "USD" "CAD" Currency code. Defaults to USD if not specified. Optional field. |
| notes | string <= 1000 characters Optional notes about the conversion. Maximum 1000 characters. |
| source | string <= 100 characters Optional source identifier indicating where this conversion came from. Examples: 'Jobber', 'HousecallPro', 'ServiceTitan', 'Salesforce', 'Manual Entry' Defaults to 'API' if not specified. Max length: 100 characters. |
object Optional JSON object to store integration-specific data. Can contain any valid JSON data (e.g., CRM IDs, sales rep info, custom fields). Maximum size: 10KB when serialized. |
{- "leadId": "db8db5a7-2f26-4e88-9c2a-969bad0f6a5b",
- "conversionStatus": "WON",
- "revenueAmount": "1500.00",
- "currency": "USD",
- "source": "HousecallPro",
- "notes": "Customer signed annual contract",
- "sourceData": {
- "crmId": "SF-12345",
- "salesRep": "John Doe",
- "closedDate": "2024-01-15"
}
}{- "success": true,
- "data": {
- "id": "conv_abc123",
- "companyId": "comp_xyz789",
- "leadFormSubmissionId": "db8db5a7-2f26-4e88-9c2a-969bad0f6a5b",
- "conversionStatus": "WON",
- "revenueAmount": "1500.00",
- "currency": "USD",
- "source": "HousecallPro",
- "notes": "Customer signed annual contract",
- "sourceData": {
- "crmId": "SF-12345",
- "salesRep": "John Doe"
}, - "createdAt": "2024-01-15T10:30:00Z",
- "updatedAt": "2024-01-15T14:45:00Z",
- "isUpdate": true
}
}Creates a review request associated with a lead. If a review request already exists
for the lead, the call is idempotent and returns the existing request with isDuplicate: true.
Identify the lead by providing either leadId or phone in the request body. If both are provided,
leadId is used.
| leadId required | string <uuid> Lead ID to associate the review request with. If provided, this is used directly. You may provide either leadId or phone. If both are provided, leadId is used. |
| phone | string Phone number of the lead to resolve the most recent lead submission for this company. E.164 format is recommended (e.g., +15551234567); US 10-digit formats are also accepted and normalized. You may provide either phone or leadId. If both are provided, leadId is used. |
{- "leadId": "db8db5a7-2f26-4e88-9c2a-969bad0f6a5b"
}{- "success": true,
- "data": {
- "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
- "status": "PENDING",
- "isDuplicate": true
}
}Retrieve appointments for the company's default (primary) calendar with optional date filtering and pagination.
Default Behavior:
Date Filtering:
startDate and endDate query parameters to specify custom date rangesPagination:
limit (1-100) and offset parameters for pagination| startDate | string <date-time> Example: startDate=2024-01-15T00:00:00Z Start date for appointment filtering (ISO 8601 format). Defaults to today. |
| endDate | string <date-time> Example: endDate=2024-01-29T23:59:59Z End date for appointment filtering (ISO 8601 format). Defaults to 2 weeks from today. |
| limit | integer [ 1 .. 100 ] Default: 100 Example: limit=50 Maximum number of appointments to return |
| offset | integer >= 0 Default: 0 Number of appointments to skip for pagination |
{- "success": true,
- "data": {
- "calendar": {
- "id": "123e4567-e89b-12d3-a456-426614174000",
- "name": "Primary",
- "timeZone": "America/New_York"
}, - "appointments": [
- {
- "id": "456e7890-e12c-34d5-b678-426614174001",
- "calendarId": "123e4567-e89b-12d3-a456-426614174000",
- "clientId": "789e0123-e45f-67g8-h901-426614174002",
- "title": "Consultation Call",
- "description": "Initial consultation with new client",
- "startAt": "2024-01-20T14:00:00Z",
- "endAt": "2024-01-20T15:00:00Z",
- "status": "BOOKED",
- "source": "WEB_PORTAL",
- "createdAt": "2024-01-15T10:30:00Z",
- "updatedAt": "2024-01-15T10:30:00Z",
- "client": {
- "id": "789e0123-e45f-67g8-h901-426614174002",
- "firstName": "John",
- "lastName": "Smith",
- "companyName": "ABC Plumbing",
- "primaryPhone": "+1-555-0123",
- "primaryEmail": "john@abcplumbing.com",
- "address": "123 Main St",
- "address2": "Suite 100",
- "city": "Springfield",
- "state": "IL",
- "zipCode": "62701",
- "country": "US"
}
}
], - "pagination": {
- "limit": 100,
- "offset": 0,
- "total": 45,
- "hasMore": false
}, - "filters": {
- "startDate": "2024-01-15T00:00:00.000Z",
- "endDate": "2024-01-29T23:59:59.999Z"
}
}
}Retrieve basic information about the company's default (primary) calendar including configuration settings like booking policies, time zones, and availability rules.
{- "success": true,
- "data": {
- "id": "123e4567-e89b-12d3-a456-426614174000",
- "name": "Primary",
- "description": "Main company calendar",
- "calendarType": "PRIMARY",
- "timeZone": "America/New_York",
- "minBookAheadHours": 24,
- "maxBookAheadDays": 14,
- "timeBlockMinutes": 60,
- "isDoubleBookingAllowed": false,
- "bufferMinutes": 0,
- "isActive": true,
- "createdAt": "2024-01-15T10:00:00Z",
- "updatedAt": "2024-01-15T10:00:00Z"
}
}Submit a Yelp inbox message to the LeadTruffle Yelp AI agent so it can continue the conversation, qualify the lead, and create CRM records if needed.
This endpoint mirrors the internal Yelp inbox workflow and should be called whenever a new message is received in Yelp or when you want to simulate a new consumer message.
| yelpLeadId required | string Yelp lead identifier provided by Yelp messaging platform. |
| yelpBusinessId required | string Identifier for the Yelp business profile receiving the message. |
| messageId required | string Unique identifier for the message event from Yelp. |
| userType | string Enum: "CONSUMER" "BUSINESS" Denotes whether the sender is the consumer or business. Defaults to |
| userDisplayName | string Display name for the Yelp user if the source provides one. |
| timeCreated | string <date-time> ISO8601 timestamp when the Yelp message was created. Defaults to the current time when omitted or invalid. |
| text required | string Raw text content from the Yelp message. |
string or Array of strings Optional attachment URLs from Yelp. You can provide a single string or an array of strings—single values will automatically be wrapped into an array. | |
| attachmentText | string or null Optional OCR or caption content provided for attachments. |
| eventType | string Enum: "NEW_CONSUMER_MESSAGE" "NEW_LEAD" Event type supplied by Yelp describing the notification. Defaults to |
{- "yelpLeadId": "lead_abc123",
- "yelpBusinessId": "business_456",
- "messageId": "msg_789",
- "userType": "CONSUMER",
- "userDisplayName": "Jane Smith",
- "timeCreated": "2024-12-01T15:04:05Z",
- "text": "Hi, can I get a quote for gutter cleaning?",
- "eventType": "NEW_CONSUMER_MESSAGE"
}{- "success": true,
- "data": {
- "reply": "Hi Jane! We'd love to help with your gutter cleaning. Can you confirm the best phone number to reach you and whether mornings or afternoons work better next week?",
- "leadId": "d6c6f5d1-6c17-4ab2-a41d-1e2a0b9acb1f",
- "conversationId": "ad10af01-6d8a-4b46-83aa-4a7d38c35172",
- "isDuplicate": false,
- "qualificationResponse": {
- "response": "Hi Jane! We'd love to help with your gutter cleaning. Can you confirm the best phone number to reach you and whether mornings or afternoons work better next week?",
- "contactReason": "Customer needs gutter cleaning and would like it scheduled next week.",
- "allQuestionsAnswered": false,
- "detectedAbuse": false,
- "shouldSkipReply": false,
- "hasImages": true,
- "dataFields": [
- {
- "name": "customer_name",
- "value": "Jane Smith"
}, - {
- "name": "service",
- "value": "Gutter cleaning"
}, - {
- "name": "timeline",
- "value": "Next week"
}
], - "commonFields": {
- "phone": "+15551234567",
- "email": "jane@example.com",
- "customerName": "Jane Smith",
- "fullAddress": "123 Main St, Springfield, IL 62704",
- "address": "123 Main St",
- "city": "Springfield",
- "state": "IL",
- "zipcode": "62704",
- "isHomeowner": true
}
}
}
}Retrieve paginated Yelp conversation history for the authenticated company.
| limit | integer [ 1 .. 100 ] Default: 50 Maximum number of conversations to return. |
| offset | integer >= 0 Default: 0 Number of records to skip for pagination. |
{- "success": true,
- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
- "eventType": "string",
- "externalLeadId": "string",
- "conversationHistory": {
- "messages": [
- {
- "role": "user",
- "timestamp": "2019-08-24T14:15:22Z",
- "content": "string",
- "additionalData": { },
}
]
}, - "latestQualificationResponse": {
- "response": "string",
- "contactReason": "string",
- "allQuestionsAnswered": true,
- "detectedAbuse": true,
- "shouldSkipReply": true,
- "hasImages": true,
- "dataFields": [
- {
- "name": "string",
- "value": "string"
}
], - "commonFields": {
- "phone": "string",
- "fullAddress": "string",
- "address": "string",
- "zipcode": "string",
- "state": "string",
- "city": "string",
- "isHomeowner": true,
- "customerName": "string",
- "email": "string"
}
}, - "actionMetadata": {
- "actionsTaken": [
- {
- "action": "EMAIL_SENT",
- "actionStatus": "SUCCESS",
- "actionDataResult": { }
}
]
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "total": 0,
- "limit": 1,
- "offset": 0,
- "hasMore": true
}
}Fetch a single Yelp conversation using the Yelp lead identifier (stored as externalLeadId).
| externalLeadId required | string Yelp lead identifier to look up. |
{- "success": true,
- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
- "eventType": "string",
- "externalLeadId": "string",
- "conversationHistory": {
- "messages": [
- {
- "role": "user",
- "timestamp": "2019-08-24T14:15:22Z",
- "content": "string",
- "additionalData": { },
}
]
}, - "latestQualificationResponse": {
- "response": "string",
- "contactReason": "string",
- "allQuestionsAnswered": true,
- "detectedAbuse": true,
- "shouldSkipReply": true,
- "hasImages": true,
- "dataFields": [
- {
- "name": "string",
- "value": "string"
}
], - "commonFields": {
- "phone": "string",
- "fullAddress": "string",
- "address": "string",
- "zipcode": "string",
- "state": "string",
- "city": "string",
- "isHomeowner": true,
- "customerName": "string",
- "email": "string"
}
}, - "actionMetadata": {
- "actionsTaken": [
- {
- "action": "EMAIL_SENT",
- "actionStatus": "SUCCESS",
- "actionDataResult": { }
}
]
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
}