HubSpot + VAPI Integration for Automatic Callbacks
# support
t
I am using HubSpot triggers to make outbound calls and record their results in HubSpot. Now, I want to set up a process with VAPI to automatically schedule a callback under these conditions: No Answer: If a client does not pick up, the system should try again at a later time. Rescheduled Call: If a client picks up but asks to be called back tomorrow (or another specific time), the system should schedule a new call at that exact date/time. Key Points: Current Setup: HubSpot triggers the initial call. I store the call outcome in HubSpot. Goal: Automate callback logic in VAPI, so I don’t have to manually set the next call. Keep the call history linked to the same contact in HubSpot. Questions: How can I capture the call result in HubSpot and pass it to VAPI so that VAPI knows when to schedule a new call? Is there a native “delay” or scheduling feature in VAPI (for example, to wait 24 hours before calling again)? If not, what is the recommended approach? How do I avoid creating duplicate call logs in HubSpot when the callback happens? Do you have any example code or best practices for implementing callbacks or retries with VAPI? Any guidance, links to documentation, or code snippets you can share would be very helpful. My main focus is to make sure calls are automatically rescheduled and still appear correctly in HubSpot. Thank you for your support!
v
Hi there! 👋 I'd be happy to help with your HubSpot + VAPI integration for automatic callbacks. I don't have specific information about capturing call results in HubSpot or HubSpot triggers for outbound calls. However, I can definitely help with the integration between HubSpot and VAPI, scheduling features, avoiding duplicate logs, and implementation best practices. ## Passing Call Results from HubSpot to VAPI To pass call results from HubSpot to VAPI for automatic callback scheduling, you have several options: 1. **Using Dynamic Variables**: You can pass data to VAPI as dynamic variables using
assistantOverrides
with
variableValues
in the payload:
Copy code
json
   {
     "variableValues": {
       "callResult": "NoAnswer",
       "rescheduleTime": "2025-03-26T14:00:00Z"
     }
   }
[Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335054553250533439) 2. **Webhooks**: After a call, VAPI can send the confirmation status back to your server using a webhook. Your server can then process this information and schedule callbacks accordingly. [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335932034518089741) 3. **API-Based Call Handoff**: VAPI can manage the call, then send caller details via API to another system. This approach could be adapted to pass call results from HubSpot to VAPI. [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1340813822193041499) ## VAPI Delay and Scheduling Features Yes, VAPI does have some native delay features: 1. You can add a delay before the assistant starts speaking at the beginning of a call using `startSpeakingPlan.waitSeconds`:
Copy code
javascript
   const assistant = {
     firstMessageMode: 'assistant-speaks-first',
     startSpeakingPlan: {
       waitSeconds: 2 // Waits 2 seconds before speaking
     }
     // ... other configurations
   };
[Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343915991670853654) However, for more complex scheduling like callbacks after 24 hours: 1. There is no built-in feature of VAPI specifically designed for handling scheduling callbacks. [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333783762579755020) 2. For scheduling callbacks, you'll need to use external tools like Zapier, Make, or a built-in scheduler from your database platform to trigger actions automatically based on time or conditions. [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333342409618231337) ## Avoiding Duplicate Call Logs in HubSpot To avoid creating duplicate call logs in HubSpot when using VAPI for callbacks: 1. **Use Custom SIP Headers**: Pass a unique identifier using a custom SIP header (
X-Call-ID
) from the initial call to the subsequent call. This allows the system to associate these calls and avoid creating duplicate call logs in HubSpot. [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1329106554041012265) 2. **Ensure Correct Webhook Configuration**: Verify that webhook URL settings within your VAPI account are correctly configured to prevent unintended or duplicate triggers. [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334280135683084328) 3. **Monitor Network Activity**: Use browser developer tools to inspect network activity when attempting to create a call to identify if multiple requests are being sent to HubSpot. [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336399188665040968) ## Example Code and Best Practices Here's an example using the Python SDK for integrating with VAPI: ```python from vapi import VoiceClient class VoiceBloc: def __init__(self): self.voice_client = VoiceClient(api_key='your_api_key')
def make_call(self, to_number, from_number): call_data = { 'to': to_number, 'from': from_number, # Additional call parameters go here } response = self.voice_client.create_call(call_data) return response ``` [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336762229110083675) For error handling and retries: 1. Implement error handling to catch concurrency limit errors and retry the call after a suitable delay. [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1326262542858850445) 2. When encountering a 429 Too Many Requests response, check the
Retry-After
header to determine how long to wait before making another request. [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336432266305339473) For webhook configuration: - Ensure all event URLs are set correctly - Make sure the correct URL is set in the right place (application level vs. account level) - Verify you're updating the correct application if you have multiple applications within your VAPI account [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334280135683084328) Is there anything specific about these integration methods you'd like me to elaborate on? Sources: - [Discord Thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335054553250533439) - [Discord Thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335932034518089741) - [Discord Thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1340813822193041499) - [Discord Thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343915991670853654) - [Discord Thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333783762579755020)
s
@Tr4Ks_ITA You need a system that can: 1. Recognize when calls don't connect or need to be rescheduled 2. Automatically schedule follow-up calls in VAPI 3. Link these callbacks to the original contact in HubSpot 4. Avoid creating duplicate call records in HubSpot Overview of the Solution: You'll need to implement a workflow using VAPI's schedulePlan feature and webhook integrations to automate your callback process. This will involve setting up server webhooks to receive call results, then scheduling new calls at appropriate times. 1. Capturing Call Results in HubSpot and Passing to VAPI VAPI offers a robust webhook system that can send call events to your server. Here's how to set it up: 1. Create a webhook endpoint on your server that can: - Receive webhook events from VAPI (status-update, end-of-call-report) - Connect to HubSpot's API to update contact records 2. Configure server URL in VAPI: - In VAPI dashboard, go to your assistant configuration - Add your server URL in the webhook configuration section - VAPI will now send call events to your server 3. Update your server to process these events: 2. Avoiding Duplicate Call Logs in HubSpot To prevent duplicate logs in HubSpot, you'll need to: 1. Use HubSpot's API to create a call activity when the callback is completed 2. Include metadata in your VAPI call to track related calls: ### Answering Your Specific Questions: 1. How can I capture the call result in HubSpot and pass it to VAPI? - Use VAPI's webhook system to receive end-of-call events - Store the call results in HubSpot via their API - When a callback is needed, use VAPI's API to schedule new calls 2. Is there a native "delay" or scheduling feature in VAPI? - can you please rephrase this question with a better example? 3. How do I avoid creating duplicate call logs in HubSpot? - Use metadata in your VAPI calls to track related calls - Create custom properties in HubSpot to link original calls and callbacks
8 Views