API Integration
Connect your chatbot with external systems using webhooks and REST API for advanced automation.
Integration Options
Webhooks
IntermediateSend real-time notifications to external systems when events occur in your chatbot.
REST API
AdvancedDirect API access for custom integrations and advanced automation.
Third-party integrations (Zapier, Make) are on our roadmap. For now, use webhooks to connect to external services. Looking to embed your chatbot? See our Embed Widget Guide.
Setup Process
Choose Integration Type
Select whether you want to use webhooks or direct API access.
Configure Authentication
Set up API keys or webhook secrets as needed.
Set Up Endpoints
Configure your webhook URLs or API endpoints in TalkBuildr.
Test Integration
Send test events and verify that data is received correctly.
Monitor and Debug
Set up logging and monitoring to track integration performance.
Webhook Events
Configure webhooks to receive real-time notifications about chatbot activity. All events include HMAC signatures for security.
Quick Webhook Setup
const express = require('express');
const crypto = require('crypto');
const app = express();
app.use(express.json());
// Verify webhook signature
function verifySignature(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature, 'hex'),
Buffer.from(expected, 'hex')
);
}
app.post('/webhooks/talkbuildr', (req, res) => {
const signature = req.headers['x-talkbuildr-signature'];
const secret = process.env.WEBHOOK_SECRET;
if (!verifySignature(req.body, signature, secret)) {
return res.status(401).json({ error: 'Invalid signature' });
}
const { event, data } = req.body;
console.log(`Received ${event}:`, data);
res.status(200).json({ received: true });
});
app.listen(3000, () => console.log('Webhook server running'));Replace WEBHOOK_SECRET with your TalkBuildr webhook secret from the dashboard.
| Event | Description | Sample Payload | Use Case |
|---|---|---|---|
| message.created | Triggered when a new message is sent | { message, conversation, timestamp } | CRM integration, logging |
| conversation.started | Triggered when a new conversation begins | { conversation, visitor, timestamp } | Lead capture, analytics |
| user.feedback | Triggered when user provides feedback | { rating, feedback, conversation } | Quality monitoring, alerts |
| error.occurred | Triggered when an error occurs | { error, context, timestamp } | Monitoring, debugging |
Test Your Webhook
# Test webhook with curl
curl -X POST https://your-server.com/webhooks/talkbuildr \
-H "Content-Type: application/json" \
-H "X-TalkBuildr-Signature: YOUR_SIGNATURE" \
-d '{
"event": "message.created",
"data": {
"message": {
"id": "msg_123",
"content": "Hello, I need help",
"createdAt": "2025-09-07T18:00:00Z"
},
"conversation": {
"id": "conv_456"
}
}
}'Replace YOUR_SIGNATURE with the actual HMAC signature for authentication.
Security Best Practices
Authentication
- Use HTTPS for all webhook endpoints
- Validate webhook signatures to prevent spoofing
- Implement rate limiting on your endpoints
Testing
- Store API keys securely and rotate regularly
- Use environment variables for sensitive configuration
Troubleshooting
Webhook Not Receiving Events
Check that your endpoint is publicly accessible and returns a 200 status code within 10 seconds.
Rate Limiting Issues
Implement exponential backoff in your webhook handler and monitor your endpoint's response times. Learn more about monitoring performance metrics.
Related Guides
Embed Widget Guide
Learn how to embed your chatbot on any website with a single script tag.
Chatbot Customization
Customize your chatbot's appearance and behavior for API integrations.
Analytics & Optimization
Monitor API usage and integration performance with detailed analytics.
Knowledge Base Setup
Ensure your knowledge base supports the data your API integrations need.