API Reference
Complete API reference for Moja AI integrations
API Reference
Moja AI provides comprehensive APIs for integrating with your existing systems.
Webhook API
Incoming Webhooks
Receive data from external systems before, during, or after calls.
Endpoint:
POST https://webhooks.moja.cloud/call-data?moja_auth_key=YOUR_AUTH_KEYExample Request:
{
"caller_id": "+15551234567",
"lead_score": 85,
"customer_name": "John Doe",
"custom_data": {
"source": "landing_page",
"campaign": "q1_promo"
}
}Outgoing Webhooks
Push call events to any platform in real-time.
Supported Events:
call.incoming- Triggered when a call comes incall.connected- Triggered when a call is answeredcall.hangup- Triggered when a call endscall.converted- Triggered when a call convertscall.completed- Triggered when a call is fully completedcall.failure- Triggered when a call fails
Duration Mark Events:
call.on_5_secs_mark- Triggered at 5 secondscall.on_15_secs_mark- Triggered at 15 secondscall.on_30_secs_mark- Triggered at 30 secondscall.on_45_secs_mark- Triggered at 45 secondscall.on_60_secs_mark- Triggered at 60 seconds
Real-Time Bidding API
Ping Endpoint
Submit bid requests to find available buyers. Returns eligible routes ranked by payout.
Endpoint:
GET /inbound_rtb/{rtb_id}?caller_id={caller}&zip_code={zip}Both GET and POST methods are supported. Parameter names are case-insensitive and accept multiple variations (e.g., caller_id, callerid, cid).
Response:
{
"success": true,
"request_id": "req_abc123",
"inbound_rtb_id": "rtb_456",
"allocation_time_seconds": 0.045,
"eligible_routes": [
{
"number": "+15559876543",
"payout": 45.00,
"duration": 120,
"payout_condition": "connected",
"payout_condition_duration": 90
},
{
"number": "+15551234567",
"payout": 35.00,
"duration": 90,
"payout_condition": null,
"payout_condition_duration": null
}
],
"total_routes": 2,
"allocated_count": 2,
"timestamp": "2026-01-28T12:00:00Z"
}Reporting AI API
Query your call data using natural language. The AI converts your questions into SQL queries and returns structured results.
Endpoint:
POST /reporting_ai/queryExample Request:
{
"query": "How many calls did we receive last week?",
"session_id": "session_abc123",
"conversation_history": []
}Response:
{
"answer": "You received 1,247 calls last week.",
"sql": "SELECT COUNT(*) as total_calls FROM call_logs WHERE ...",
"explanation": "This query counts all calls within the specified date range.",
"data": {
"total_calls": 1247
},
"chart_suggestion": {
"type": "bar",
"x_axis": "campaign_name",
"y_axis": "call_count"
}
}Additional Endpoints:
GET /reporting_ai/sessions- List your query sessionsGET /reporting_ai/sessions/{session_id}/messages- Get conversation history for a session
Rate Limits
| Endpoint | Rate Limit |
|---|---|
| Webhooks | 1000 req/min |
| RTB | 5000 req/min |
| Reporting AI | 100 req/min |
Authentication
All API requests require authentication via Clerk JWT token:
curl -H "Authorization: Bearer YOUR_CLERK_JWT_TOKEN" \
https://api.mojaai.com/v1/callsFor webhook endpoints, you can also authenticate using query parameters:
curl "https://webhooks.moja.cloud/call-data?moja_auth_key=YOUR_AUTH_KEY"Need Help?
- Contact our API support team at [email protected]
- Schedule a technical consultation