Webhooks
Receive real-time event notifications from BasaltCRM. Webhooks push data to your endpoints when key events occur — payments, voice calls, email delivery, and form submissions.
How Webhooks Work
Signature Verification
Always verify webhook signatures in production to prevent forged events. BasaltCRM signs webhook payloads using HMAC-SHA256 with your configured secret.
Webhook Endpoints
SURGE Payment Webhook
POST /api/webhooks/surgeSURGE_WEBHOOK_SECRETEvents
payment.confirmedPayment has been confirmed on-chain. Invoice is marked PAID, linked Opportunity is moved to Close Won.
payment.succeededAlias for payment.confirmed. Triggers the same pipeline update.
Example Payload
Automated Side Effects
- Updates Invoice → PAID status
- Fulfills LeadGen Credits (if applicable)
- Syncs Mercury bank invoice
- Moves linked Opportunity → Closed Won
BasaltECHO Voice Events
POST /api/voice/engage/webhookBASALTECHO_WEBHOOK_SECRETEvents
tool_call (schedule_meeting)AI agent requested to schedule a meeting. Creates a calendar event and advances lead pipeline to Engage_Human.
call_connectedOutbound or inbound call has been connected. Updates lead call_status to CONNECTED.
call_endedCall has ended. Logs duration, updates lead status, and queues follow-up intent.
Example Payload
Automated Side Effects
- Creates meeting via /api/outreach/meeting/[leadId]
- Advances lead pipeline stage
- Logs activity with idempotency (duplicate eventId detection)
Resend Email Events
POST /api/resend/webhookRESEND_WEBHOOK_SECRETEvents
email.bouncedEmail bounced — updates outreach status to prevent further sends.
email.deliveredEmail successfully delivered to inbox.
email.openedRecipient opened the email (tracking pixel).
email.complainedRecipient marked email as spam.
Example Payload
Automated Side Effects
- Updates outreach record status (SENT → OPENED)
- Enriches lead activity timeline
Azure AI / OpenAI Realtime
POST /api/azure/webhookOPENAI_WEBHOOK_SECRET / AZURE_OPENAI_WEBHOOK_SECRETEvents
response.completedAI model response generation completed.
response.failedModel response generation failed.
realtime.call.incomingIncoming call detected on Azure Communication Services.
Example Payload
Automated Side Effects
- Logs event for analytics
- Routes incoming calls to appropriate handlers
Form Submission Webhook
Configured per-form via webhook_urlN/A (configured in Form Builder UI)Events
form.submittedA new form submission was received. Payload includes extracted lead data and UTM parameters.
Example Payload
Automated Side Effects
- Creates lead record (if field mapping configured)
- Sends auto-respond email (if enabled)
- Notifies configured email addresses
Best Practices
- • Respond quickly. Return a 200 status within 5 seconds. Process heavy logic asynchronously.
- • Handle duplicates. Use the
eventIdfield for idempotent processing. - • Verify signatures. Always validate HMAC signatures in production to prevent replay attacks.
- • Use HTTPS. Webhook endpoints must use TLS/SSL. HTTP endpoints are rejected.