Skip to main content
Skip to main contentSkip to navigation
Back to Guides

API Integration

Connect your chatbot with external systems using webhooks and REST API for advanced automation.

Integration Options

Webhooks

Intermediate

Send real-time notifications to external systems when events occur in your chatbot.

Message events
Conversation events
User feedback events
Error notifications

REST API

Advanced

Direct API access for custom integrations and advanced automation.

Programmatic access
Custom authentication
Batch operations
Advanced filtering

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

1

Choose Integration Type

Select whether you want to use webhooks or direct API access.

2

Configure Authentication

Set up API keys or webhook secrets as needed.

3

Set Up Endpoints

Configure your webhook URLs or API endpoints in TalkBuildr.

4

Test Integration

Send test events and verify that data is received correctly.

5

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.

EventDescriptionSample PayloadUse Case
message.createdTriggered when a new message is sent{ message, conversation, timestamp }CRM integration, logging
conversation.startedTriggered when a new conversation begins{ conversation, visitor, timestamp }Lead capture, analytics
user.feedbackTriggered when user provides feedback{ rating, feedback, conversation }Quality monitoring, alerts
error.occurredTriggered 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.