RelayaRelayaDocs
Dashboard

Voice AI API

Access call logs, transcripts, and manage active call transfers through the Voice AI system.

GET/v1/voice/calls

Returns a paginated list of voice calls handled by the AI agent.

Query Parameters

ParameterTypeRequiredDescription
date_fromstringOptionalStart date (YYYY-MM-DD)
date_tostringOptionalEnd date (YYYY-MM-DD)
statusstringOptionalFilter by status: completed, missed, transferred, in_progress
pageintegerOptionalPage number (default: 1)
limitintegerOptionalResults per page (default: 20, max: 100)

Example Request

curl -X GET "https://api.relaya.one/v1/voice/calls?date_from=2026-07-20&status=completed" \
  -H "Authorization: Bearer rlya_live_abc123"

Example Response

{
  "data": [
    {
      "id": "call_7vm2k9",
      "caller_phone": "+919876543210",
      "patient_id": "pat_4jn7h2",
      "direction": "inbound",
      "status": "completed",
      "duration_seconds": 142,
      "intent": "appointment_booking",
      "outcome": "appointment_created",
      "started_at": "2026-07-22T09:15:00Z",
      "ended_at": "2026-07-22T09:17:22Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 34,
    "has_more": true
  }
}
GET/v1/voice/calls/:id

Retrieve a single call with full transcript and metadata.

Example Response

{
  "data": {
    "id": "call_7vm2k9",
    "caller_phone": "+919876543210",
    "patient_id": "pat_4jn7h2",
    "direction": "inbound",
    "status": "completed",
    "duration_seconds": 142,
    "intent": "appointment_booking",
    "outcome": "appointment_created",
    "started_at": "2026-07-22T09:15:00Z",
    "ended_at": "2026-07-22T09:17:22Z",
    "transcript": [
      {
        "speaker": "ai",
        "text": "Thank you for calling Smile Dental. How can I help you today?",
        "timestamp": "2026-07-22T09:15:02Z"
      },
      {
        "speaker": "caller",
        "text": "I would like to book an appointment for a cleaning.",
        "timestamp": "2026-07-22T09:15:08Z"
      },
      {
        "speaker": "ai",
        "text": "I can help with that. Let me check available slots for you.",
        "timestamp": "2026-07-22T09:15:14Z"
      }
    ],
    "recording_url": "https://api.relaya.one/v1/voice/calls/call_7vm2k9/recording"
  }
}
POST/v1/voice/calls/:id/transfer

Transfer an active call to a human staff member. Only works on calls with status in_progress.

Request Body

ParameterTypeRequiredDescription
target_phonestringRequiredPhone number to transfer to (E.164)
reasonstringOptionalReason for transfer

Example Request

curl -X POST "https://api.relaya.one/v1/voice/calls/call_7vm2k9/transfer" \
  -H "Authorization: Bearer rlya_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "target_phone": "+919812345678",
    "reason": "Patient requested to speak with doctor"
  }'

Error Codes

CodeStatusDescription
400bad_requestInvalid parameters
401unauthorizedInvalid or missing API key
404not_foundCall not found
409conflictCall is not in transferable state
429rate_limitedToo many requests