Skip to main content

Integrations

Integrations extend your voice agents by connecting to external services. This section covers all available integrations and how to configure them.

Available Integrations

IntegrationPurposeStatusPlans
TwilioPhone numbers and callsAvailableAll
SIP TrunkConnect existing phone infrastructureAvailableAll
API KeysExternal application accessAvailableAll
WebhooksReal-time event notificationsAvailableAll
Google CalendarAppointment schedulingAvailableAll
Microsoft OutlookAppointment schedulingAvailableAll
Cal.comAppointment schedulingAvailableAll
CRM SystemsCustomer dataComing soon
All Plans

Calendar integrations (Google Calendar, Microsoft Outlook, Cal.com), SIP, and outbound calling are available on all plans, including Free.


Twilio Integration

Twilio provides the phone infrastructure for voice calls.

Setup Steps

  1. Create Twilio Account (if needed)

    • Go to twilio.com
    • Sign up for an account
    • Complete verification
  2. Get Credentials

    • Log into Twilio Console
    • Copy Account SID
    • Copy Auth Token
  3. Connect to Hanc.AI

    • Go to IntegrationTwilio
    • Enter Account SID
    • Enter Auth Token
    • Click Connect
  4. Import Numbers

    • After connecting, your Twilio numbers appear
    • Click Import to add them to Hanc.AI
    • Assign agents to numbers

Twilio Configuration

FieldValue
Account SIDAC________________________________
Auth Token________________________________
Status🟢 Connected

Actions: [Disconnect] [Refresh Numbers]

Troubleshooting Twilio

IssueSolution
Connection failsVerify credentials are correct
Numbers not appearingClick "Refresh Numbers"
Calls not routingCheck number webhook in Twilio

SIP Trunk Integration

Connect your existing SIP trunk provider to route calls through Hanc.AI voice agents. Available on all plans including Free.

Setup Steps

  1. Go to Phone Numbers in the sidebar
  2. Click "Connect SIP"
  3. Enter your SIP trunk credentials:
    • SIP Server / Domain — your provider's SIP address
    • Username — your SIP account username
    • Password — your SIP account password
    • Port — SIP port (default: 5060)
  4. Click Connect
  5. Assign an agent to handle calls from this trunk

When to Use SIP

ScenarioRecommendation
New to phone serviceUse Twilio (simpler setup)
Existing PBX systemUse SIP trunk to integrate
Enterprise telephonySIP trunk for full control
Multiple providersSIP for flexibility

API Keys

Generate API keys to integrate Hanc.AI with your own applications.

Creating an API Key

You can create up to 3 API keys per user.

  1. Go to IntegrationAPI Keys
  2. Click "Create API Key"
  3. Enter a name (e.g., "CRM Integration")
  4. Set permissions (read, write, admin)
  5. Copy the key immediately (shown only once)

API Key Security

Important
  • Store keys securely (environment variables, secrets manager)
  • Never commit keys to version control
  • Rotate keys periodically
  • Delete unused keys

Using API Keys

Include in API requests:

curl -X GET "https://api.hanc.ai/v1/agents" \
-H "Authorization: Bearer YOUR_API_KEY"

API Key Permissions

PermissionAccess
ReadView agents, calls, analytics
WriteCreate/modify agents, upload KB
AdminAll operations, delete, settings

Webhooks

Webhooks send real-time notifications when events occur.

Setting Up Webhooks

  1. Go to IntegrationWebhooks
  2. Click "Add Webhook"
  3. Enter your endpoint URL
  4. Select events to trigger
  5. Save and test

Available Events

Webhook events:

EventTriggerPayload Includes
call.startedCall beginsAgent ID, caller number
call.endedCall completesDuration, transcript, sentiment
call.transferredTransfer to humanReason, destination
appointment.createdBooking madeDate, time, customer info
appointment.cancelledBooking cancelledReason, customer info

Widget events (for JavaScript integration on your website):

EventTrigger
call-startWeb widget call begins
call-endWeb widget call ends
Widget Events

The web widget emits only two events: call-start and call-end. Use these for custom UI behavior on your website. See Widgets for integration details.

Webhook Payload Example

{
"event": "call.ended",
"timestamp": "2024-01-15T14:30:00Z",
"data": {
"call_id": "call_abc123",
"agent_id": "agent_xyz789",
"duration_seconds": 185,
"caller_number": "+43664123456",
"sentiment": "positive",
"transcript": "...",
"escalated": false
}
}

Webhook Security

Validate webhook signatures:

const crypto = require('crypto');

function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return signature === expected;
}

Calendar Integrations

Connect calendars for appointment booking.

Google Calendar

  1. Go to IntegrationCalendars
  2. Click "Connect Google Calendar"
  3. Sign in with Google
  4. Authorize Hanc.AI access
  5. Select calendars to sync

Permissions requested:

  • View calendar events
  • Create calendar events
  • Modify calendar events

Microsoft Outlook

  1. Go to IntegrationCalendars
  2. Click "Connect Outlook"
  3. Sign in with Microsoft
  4. Authorize access
  5. Select calendars

Cal.com

  1. Go to IntegrationCalendars
  2. Click "Connect Cal.com"
  3. Enter API key from Cal.com
  4. Configure event types

Calendar Usage in Agents

Once connected, agents can:

  • Check availability for specific times
  • Book appointments automatically
  • Send calendar invitations
  • Handle rescheduling

Example conversation:

Customer: "Can I book an appointment for Tuesday at 3pm?"

Agent: [Checks calendar]
"Yes, Tuesday at 3pm is available.
May I have your name to complete the booking?"

CRM Integration (Coming Soon)

Connect customer relationship management systems:

Planned CRMs

  • HubSpot
  • Salesforce
  • Pipedrive
  • Zoho CRM

Planned Features

  • Automatic call logging
  • Customer data lookup
  • Lead creation
  • Activity tracking

Custom Integrations

Using the API

Build custom integrations using the Hanc.AI API:

Base URL: https://api.hanc.ai/v1
Authentication: Bearer token (API key)
Format: JSON

API Documentation

Endpoints available:

EndpointMethodPurpose
/agentsGETList all agents
/agents/{id}GETGet agent details
/agentsPOSTCreate agent
/callsGETList call logs
/calls/{id}GETGet call details
/knowledge-basesGETList knowledge bases
/knowledge-basesPOSTCreate knowledge base

Example: Create Agent via API

curl -X POST "https://api.hanc.ai/v1/agents" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Support Agent",
"first_message": "Hello, how can I help?",
"prompt": "You are a helpful support agent...",
"language": "en"
}'

Integration Best Practices

Security

✅ Use HTTPS for all webhooks ✅ Store credentials securely ✅ Rotate API keys regularly ✅ Limit permissions to minimum needed

Reliability

✅ Handle webhook failures gracefully ✅ Implement retry logic ✅ Log all integration events ✅ Monitor integration health

Testing

✅ Test integrations in staging first ✅ Verify data flow both directions ✅ Test error scenarios ✅ Document integration setup


Troubleshooting

Integration won't connect

  1. Verify credentials are correct
  2. Check for typos
  3. Ensure third-party account is active
  4. Try disconnecting and reconnecting

Webhooks not receiving events

  1. Verify URL is accessible publicly
  2. Check URL returns 200 status
  3. Review webhook logs in dashboard
  4. Test with webhook.site for debugging

Calendar not syncing

  1. Re-authorize calendar access
  2. Check calendar permissions
  3. Verify selected calendar is correct
  4. Check for sync delays (up to 5 minutes)