Quick Start
The fastest way to create an integration:Get Your API Endpoint
Identify the webhook URL for your AI service:
- OpenAI:
https://api.openai.com/v1/chat/completions - Anthropic:
https://api.anthropic.com/v1/messages - Custom: Your own API endpoint
Webhook Configuration
URL Requirements
Your webhook URL must:- Use HTTPS (not HTTP)
- Be publicly accessible
- Accept POST requests
- Return responses within the timeout period
Headers
Common headers for AI services: OpenAI:Timeout
Set timeout based on expected response time:| Timeout | Use Case |
|---|---|
| 10s | Fast models (GPT-3.5) |
| 30s (default) | Standard models (GPT-4) |
| 60s | Complex reasoning or tools |
| 90s+ | Long-form generation |
Timeout should be less than your channel’s timeout to avoid stuck requests.
Request Format
Chatbot Platform sends this payload to your webhook:Message Format
Messages follow OpenAI’s format and support both text and multimodal content: Text Messages:messages array includes conversation history based on your context window setting.
File Support: When users send images or files through supported channels (Telegram, Slack), the attachments are automatically converted to the multimodal content format above. Files are stored securely and accessible via HTTPS URLs.
Response Format
Your webhook must return JSON with acontent field:
Simple Response
Response with Attachments
Send files back to the user by including attachments:Response with Metadata
Error Response
Return HTTP error status codes for failures:400- Invalid request401- Authentication failed429- Rate limit500- Server error503- Service unavailable
Platform-Specific Setup
OpenAI
OpenAI’s API doesn’t accept our payload format directly. Use a proxy or transform the payload: Option 1: Proxy Service Deploy a simple proxy that converts our format to OpenAI’s:Anthropic (Claude)
Similar to OpenAI, Anthropic requires a proxy:Custom Backend
For your own API, simply accept our payload format and return the expected response:Testing Webhooks
Manual Testing
Use curl to test your webhook:Platform Test Feature
Use the built-in test in Chatbot Platform:- Go to your integration settings
- Click Test Integration
- Enter a test message
- Review the response and any errors
Security Best Practices
Use HTTPS
Always use HTTPS endpoints to encrypt data in transit
Validate Requests
Verify requests come from Chatbot Platform (check IP or signature)
Rotate API Keys
Periodically rotate API keys and tokens
Rate Limiting
Implement rate limiting on your backend
Store API keys as environment variables, never in code or version control.
Troubleshooting
Connection Errors
Symptoms: Timeout or connection refused errors Solutions:- Verify URL is correct and accessible
- Check firewall rules allow traffic
- Ensure SSL certificate is valid
- Test with curl from a different network
Authentication Errors
Symptoms: 401 or 403 responses Solutions:- Double-check API key is correct
- Verify header names match requirements
- Check for extra spaces in header values
- Ensure API key has required permissions
Response Format Errors
Symptoms: Bot sends error message to user Solutions:- Verify response is valid JSON
- Check
contentfield is present - Look for encoding issues (UTF-8)
- Test response with JSON validator
Timeout Issues
Symptoms: Requests timeout before completion Solutions:- Increase timeout value
- Optimize backend for faster responses
- Use streaming responses (if supported)
- Check for network latency
Advanced Configuration
Custom Headers
Add custom headers for:- A/B testing identifiers
- User tracking
- Feature flags
- Custom authentication
Dynamic Payloads
The platform includes useful metadata in every request:- Per-user personalization
- Platform-specific responses
- Analytics and tracking
Next Steps
A/B Testing
Configure multiple integrations
Custom Headers
Advanced header configuration