Moja AIMoja AI

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_KEY

Example 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 in
  • call.connected - Triggered when a call is answered
  • call.hangup - Triggered when a call ends
  • call.converted - Triggered when a call converts
  • call.completed - Triggered when a call is fully completed
  • call.failure - Triggered when a call fails

Duration Mark Events:

  • call.on_5_secs_mark - Triggered at 5 seconds
  • call.on_15_secs_mark - Triggered at 15 seconds
  • call.on_30_secs_mark - Triggered at 30 seconds
  • call.on_45_secs_mark - Triggered at 45 seconds
  • call.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/query

Example 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 sessions
  • GET /reporting_ai/sessions/{session_id}/messages - Get conversation history for a session

Rate Limits

EndpointRate Limit
Webhooks1000 req/min
RTB5000 req/min
Reporting AI100 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/calls

For webhook endpoints, you can also authenticate using query parameters:

curl "https://webhooks.moja.cloud/call-data?moja_auth_key=YOUR_AUTH_KEY"

Need Help?

On this page