Documentation Index
Fetch the complete documentation index at: https://docs.renchi.ai/llms.txt
Use this file to discover all available pages before exploring further.
API Reference
The Renchi AI API is organized around REST principles. All endpoints are built as Next.js API routes and handle specific functionality for the platform.Endpoint Categories
Integrations
OAuth flows for third-party service connections
Webhooks
Event handlers for Twilio and ElevenLabs
Cron Jobs
Scheduled background tasks
Admin
Setup and debugging endpoints
Integrations
OAuth-based connections to third-party services. Supported providers: Google Calendar, HubSpot, Salesforce, Microsoft Teams.| Endpoint | Method | Description |
|---|---|---|
/api/integrations/[provider]/connect | POST/GET | Initiate OAuth flow |
/api/integrations/[provider]/callback | GET | OAuth callback handler |
/api/integrations/[provider]/disconnect | POST | Remove integration |
/api/integrations/status | GET | Get all integration statuses |
Authentication
Requires authenticated user session with team admin/owner role.Supported Providers
google_calendar- Google Calendar synchubspot- HubSpot CRM integrationsalesforce- Salesforce CRM integrationmicrosoft_teams- Microsoft Teams notifications
Webhooks
Event handlers for voice call processing. These endpoints receive callbacks from Twilio and ElevenLabs.Twilio Webhooks
| Endpoint | Method | Description |
|---|---|---|
/api/webhooks/twilio/voice | POST | Incoming call handler |
/api/webhooks/twilio/status | POST | Call status updates |
/api/webhooks/twilio/recording | POST | Recording completion |
X-Twilio-Signature header.
ElevenLabs Webhooks
| Endpoint | Method | Description |
|---|---|---|
/api/webhooks/elevenlabs | POST | Main webhook (transcription, audio, failures) |
/api/webhooks/elevenlabs/personalize | POST | Real-time call personalization |
- Main webhook:
ElevenLabs-Signatureheader validation - Personalize:
x-webhook-secretorAuthorization: Bearertoken
Event Types (ElevenLabs)
- post_call_transcription
- post_call_audio
- call_initiation_failure
Sent after call completion with full transcript, AI analysis, and metadata.
Cron Jobs
Scheduled background tasks executed by Vercel Cron.| Endpoint | Schedule | Description |
|---|---|---|
/api/cron/cleanup-recordings | Daily 3:00 AM UTC | Delete expired recordings |
/api/cron/daily-summary | Daily 6:00 PM UTC | Send daily summary emails |
/api/cron/weekly-report | Monday 9:00 AM UTC | Send weekly performance reports |
Authorization: Bearer {CRON_SECRET} header.
Admin
Setup and debugging endpoints.| Endpoint | Method | Description |
|---|---|---|
/api/setup-super-admin | POST | Create super admin accounts (one-time setup) |
/api/debug/db | GET | Test database connectivity |
Error Handling
All endpoints return errors in a consistent format:Common Error Codes
| Code | HTTP Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid authentication |
FORBIDDEN | 403 | Insufficient permissions |
NOT_FOUND | 404 | Resource not found |
VALIDATION_ERROR | 400 | Invalid request parameters |
INTERNAL_ERROR | 500 | Server error |
Rate Limiting
- Webhook endpoints: No rate limiting (event-driven)
- Cron endpoints: Protected by Vercel Cron scheduling
- Integration endpoints: Standard API rate limits apply