Build with Reapdat
Integrate AI-powered voice calling, chat, bookings, and lead capture into your applications using our REST API.
Quick Start
Get Your API Key
Sign up and generate an API key from the portal dashboard.
# 1. Sign up at your-domain.com/signup
# 2. Complete onboarding
# 3. Go to Portal > Integrate > API Keys
# 4. Click "Generate API Key"
# Your key will look like: ua_aBcDeFgHiJkLmNoPqRsTuVwXyZ...Install the Widget
Add the chat widget to your website with a single script tag.
<!-- Add before </body> on your website -->
<script
src="https://your-domain.com/widget.js"
data-tenant-id="your_tenant_id"
data-theme="dark"
data-position="bottom-right"
async
></script>Make Your First API Call
Send a chat message or initiate a voice call via the REST API.
curl -X POST https://your-domain.com/api/v1/chat/message \
-H "Content-Type: application/json" \
-H "X-API-Key: ua_your_api_key" \
-d '{
"message": "Hello, I want to book an appointment",
"tenant_id": "your_tenant_id",
"client_name": "Jane Smith"
}'Authentication
The API supports two authentication methods. Use API keys for server-to-server integrations and JWT cookies for browser-based sessions.
# API Key Authentication
# Pass your key in the X-API-Key header
curl https://your-domain.com/api/v1/leads \
-H "X-API-Key: ua_your_api_key"
# Key prefixes:
# ua_ — Standard keys (read/write calls, leads, bookings)
# ua_admin_ — Admin keys (tenant management, full access)- Never expose API keys in client-side code
- JWT tokens are stored in HttpOnly cookies (not accessible via JavaScript)
- All requests must use HTTPS in production
- Admin keys (
ua_admin_) should only be used in secure backend environments
API Reference
Base URL: https://your-domain.com All endpoints require authentication unless noted otherwise.
SDK Examples
Copy-paste examples for common operations in your language of choice.
import requests
API_KEY = "ua_your_api_key"
BASE_URL = "https://your-domain.com/api/v1"
headers = {
"Content-Type": "application/json",
"X-API-Key": API_KEY,
}
# Send a chat message
response = requests.post(f"{BASE_URL}/chat/message", headers=headers, json={
"message": "I'd like to book an appointment for tomorrow",
"tenant_id": "your_tenant_id",
"client_name": "Jane Smith",
})
print(response.json())
# Initiate an AI voice call
call = requests.post(f"{BASE_URL}/calls/initiate", headers=headers, json={
"phone_number": "+15551234567",
"client_name": "John Doe",
"call_type": "outbound",
"custom_prompt": "Greet the caller and schedule an appointment.",
})
print(call.json())
# Get all leads
leads = requests.get(f"{BASE_URL}/leads", headers=headers)
print(leads.json())Webhooks
Configure webhook URLs in your portal settings to receive real-time event notifications. All payloads are signed with HMAC-SHA256 for verification.
call.completedVoice call finished (includes transcript, duration, sentiment)call.startedVoice call initiated and connectedcall.failedVoice call failed to connect or erroredbooking.createdNew booking made (via widget, API, or AI)booking.updatedBooking was rescheduled or modifiedbooking.cancelledBooking was cancelledlead.capturedNew lead captured from conversation or formlead.updatedLead status or details changedchat.messageNew chat message received from a visitorchat.session_endedChat session closedcrm.sync_completedCRM sync finished successfullycrm.sync_failedCRM sync encountered an error{
"event": "call.completed",
"timestamp": "2026-02-27T14:30:00Z",
"tenant_id": "tenant_abc123",
"data": {
"call_id": "call_xyz789",
"phone_number": "+15551234567",
"client_name": "John Doe",
"duration": 142,
"direction": "outbound",
"sentiment": "positive",
"transcript": [
{ "role": "agent", "text": "Hello, this is AI assistant..." },
{ "role": "user", "text": "Hi, I'd like to schedule..." }
],
"lead": {
"name": "John Doe",
"phone": "+15551234567",
"email": "john@example.com",
"intent": "booking"
},
"actions": ["booking_created"]
}
}import hmac
import hashlib
def verify_webhook(payload: bytes, signature: str, secret: str) -> bool:
"""Verify HMAC-SHA256 webhook signature."""
expected = hmac.new(
secret.encode("utf-8"),
payload,
hashlib.sha256
).hexdigest()
return hmac.compare_digest(f"sha256={expected}", signature)
# In your webhook handler:
# signature = request.headers.get("X-Webhook-Signature")
# is_valid = verify_webhook(request.body, signature, WEBHOOK_SECRET)Rate Limits
Rate limits protect the platform and ensure fair usage. When a limit is exceeded, the API returns 429 Too Many Requests with a Retry-After header.
| Category | Limit |
|---|---|
| Authentication | 5 req / 15 min |
| Chat Messages | 200 req / hour |
| Voice Calls | 60 req / min |
| Knowledge Ingest | 100 req / hour |
| Analytics | 120 req / min |
| Widget Endpoints | 300 req / min |
| General API | 1000 req / min |
Error Codes
All error responses include a JSON body with a detail field describing the error. Production errors never expose stack traces.
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request body or parameters |
| 401 | Unauthorized | Missing or invalid API key / JWT token |
| 403 | Forbidden | Insufficient permissions (e.g., non-admin accessing admin endpoint) |
| 404 | Not Found | Resource not found or does not belong to your tenant |
| 409 | Conflict | Resource already exists (e.g., duplicate email registration) |
| 422 | Validation Error | Request body failed validation (Pydantic) |
| 429 | Too Many Requests | Rate limit exceeded. Check Retry-After header |
| 500 | Internal Error | Server error. No stack traces in production |
{
"detail": "Invalid API key or insufficient permissions"
}
// Validation errors (422) include field-level details:
{
"detail": [
{
"loc": ["body", "email"],
"msg": "value is not a valid email address",
"type": "value_error.email"
}
]
}Widget Integration
Add the Engage AI chat widget to any website with a single script tag. The widget provides live chat, voice calls, and booking functionality. Your website domain must be registered in your tenant's allowed_domains list for origin validation.
<!-- Reapdat Engage AI Widget -->
<!-- Add this snippet before the closing </body> tag -->
<script
src="https://your-domain.com/widget.js"
data-tenant-id="your_tenant_id"
data-theme="dark"
data-position="bottom-right"
data-accent-color="#FF3621"
data-greeting="Hi! How can I help you today?"
async
></script>
<!--
Configuration attributes:
data-tenant-id (required) Your unique tenant identifier
data-theme "dark" | "light" (default: "dark")
data-position "bottom-right" | "bottom-left" (default: "bottom-right")
data-accent-color Hex color for widget accent (default: "#FF3621")
data-greeting Custom greeting message
-->- AI-powered chat with RAG context from your knowledge base
- In-browser voice calls via WebRTC
- Phone call initiation (connects to Twilio)
- Appointment booking with calendar availability
- Lead capture and CRM sync
- Fully responsive and mobile-friendly
Ready to integrate?
Try the API playground or sign up to get your key.