Developers

Build with Reapdat

Integrate AI-powered voice calling, chat, bookings, and lead capture into your applications using our REST API.

Quick Start

1

Get Your API Key

Sign up and generate an API key from the portal dashboard.

Step 1
# 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...
2

Install the Widget

Add the chat widget to your website with a single script tag.

Step 2
<!-- 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>
3

Make Your First API Call

Send a chat message or initiate a voice call via the REST API.

Step 3
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 Header
# 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)
Security notes:
  • 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.

Python
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.

Webhook Events
call.completedVoice call finished (includes transcript, duration, sentiment)
call.startedVoice call initiated and connected
call.failedVoice call failed to connect or errored
booking.createdNew booking made (via widget, API, or AI)
booking.updatedBooking was rescheduled or modified
booking.cancelledBooking was cancelled
lead.capturedNew lead captured from conversation or form
lead.updatedLead status or details changed
chat.messageNew chat message received from a visitor
chat.session_endedChat session closed
crm.sync_completedCRM sync finished successfully
crm.sync_failedCRM sync encountered an error
Example Payload
{
  "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"]
  }
}
Signature Verification (Python)
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.

CategoryLimit
Authentication5 req / 15 min
Chat Messages200 req / hour
Voice Calls60 req / min
Knowledge Ingest100 req / hour
Analytics120 req / min
Widget Endpoints300 req / min
General API1000 req / min

Error Codes

All error responses include a JSON body with a detail field describing the error. Production errors never expose stack traces.

CodeStatusDescription
200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestInvalid request body or parameters
401UnauthorizedMissing or invalid API key / JWT token
403ForbiddenInsufficient permissions (e.g., non-admin accessing admin endpoint)
404Not FoundResource not found or does not belong to your tenant
409ConflictResource already exists (e.g., duplicate email registration)
422Validation ErrorRequest body failed validation (Pydantic)
429Too Many RequestsRate limit exceeded. Check Retry-After header
500Internal ErrorServer error. No stack traces in production
Error Response Format
{
  "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.

HTML Embed Snippet
<!-- 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
-->
Widget features:
  • 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.