Getting Started
API Best Practices
Guidelines for integrating with Trillet AI API
Authentication
API Keys
- Keep your API keys secure and never expose them in client-side code
- Use different API keys for development and production
- Rotate your API keys periodically
- Monitor your API key usage for suspicious activity
Error Handling
Implement proper error handling for API responses:
Common error responses:
Rate Limits
- Production API keys are limited to 60 requests per minute
- Implement backoff when you hit rate limits
- Monitor your API usage in the dashboard
Rate limit response:
Webhooks [Coming Soon!]
Configuring Webhooks
- Add your webhook URL in the dashboard
- Configure the events you want to receive
- Store your webhook secret securely
Verifying Webhooks
Always verify webhook signatures using the X-Trillet-Signature
header:
Webhook Events
call.started
- When a call beginscall.completed
- When a call endscall.failed
- When a call failssms.sent
- When an SMS is sentsms.delivered
- When an SMS is delivered
Example webhook payload:
Production Checklist
-
Authentication
- Use production API keys
- Implement key rotation
- Secure key storage
-
Error Handling
- Handle all error codes
- Implement retry logic
- Log errors appropriately
-
Monitoring
- Track API response times
- Monitor error rates
- Set up alerts
-
Webhooks
- Use HTTPS endpoints
- Verify signatures
- Implement retry logic
- Handle duplicate events
Need Help?
API Status [Coming Soon!]
Check our API status and uptime
Support
Get technical support