Ingest a Call

Use POST /calls to push a call into RubricHQ. Supports both voice calls (with an audio recording) and text/GenAI calls (transcript only, no audio).

Voice call — transcript only

$curl -X POST https://api.rubrichq.io/api/public/v1/calls \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "call_identifier": "call-abc-123",
> "agent_id": 42,
> "client_id": 7,
> "observation_type": "voice",
> "call_direction": "inbound",
> "duration_seconds": 87,
> "call_timestamp": "2026-03-09T10:00:00Z",
> "transcript": [
> {
> "role": "AI Assistant",
> "content": "Hello, thanks for calling support. How can I help you today?",
> "start_time": 0.5,
> "end_time": 3.2
> },
> {
> "role": "User",
> "content": "Hi, I need to update my billing address.",
> "start_time": 3.8,
> "end_time": 6.1
> },
> {
> "role": "AI Assistant",
> "content": "Sure, let me pull up your account.",
> "start_time": 6.5,
> "end_time": 8.0
> },
> {
> "role": "Function Call",
> "content": "",
> "start_time": 8.1,
> "end_time": 8.1,
> "data": {
> "id": "call_A1B2C3D4",
> "name": "lookupCustomerAccount",
> "arguments": "{\"phone\": \"+15550001234\"}"
> }
> },
> {
> "role": "Function Call Result",
> "start_time": 8.9,
> "end_time": 8.9,
> "data": {
> "id": "call_A1B2C3D4",
> "name": "lookupCustomerAccount",
> "result": "{\"account_id\": 9871, \"name\": \"Jane Smith\"}"
> }
> },
> {
> "role": "AI Assistant",
> "content": "Got it, Jane. What is your new billing address?",
> "start_time": 9.2,
> "end_time": 11.4
> }
> ]
> }'

Voice call — with audio recording URL

$curl -X POST https://api.rubrichq.io/api/public/v1/calls \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "call_identifier": "call-xyz-456",
> "agent_id": 42,
> "client_id": 7,
> "observation_type": "voice",
> "recording_url": "https://your-storage.com/recordings/call-xyz-456.wav",
> "call_direction": "outbound",
> "duration_seconds": 145
> }'

Text / GenAI call — with function calls

For LLM-based agents (no audio), set observation_type to "text" and include the full turn-by-turn transcript. Function calls and their results are first-class turns.

$curl -X POST https://api.rubrichq.io/api/public/v1/calls \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "call_identifier": "chat-session-789",
> "agent_id": 42,
> "client_id": 7,
> "observation_type": "text",
> "duration_seconds": 34,
> "call_timestamp": "2026-03-09T10:00:00Z",
> "transcript": [
> {
> "role": "AI Assistant",
> "content": "Hello. How can I help you?",
> "start_time": 1.4,
> "end_time": 1.9
> },
> {
> "role": "User",
> "content": "I want to book an appointment for 6 PM today. My name is John.",
> "start_time": 3.1,
> "end_time": 7.5
> },
> {
> "role": "AI Assistant",
> "content": "Sure, just a moment.",
> "start_time": 19.2,
> "end_time": 21.5
> },
> {
> "role": "Function Call",
> "content": "",
> "start_time": 23.1,
> "end_time": 23.1,
> "data": {
> "id": "call_5otWH44dxeXEHY8RlhYYaFbV",
> "name": "bookUserAppointment",
> "arguments": "{\"name\": \"John\", \"datetime\": \"2024-10-17T18:00:00\"}"
> }
> },
> {
> "role": "Function Call Result",
> "start_time": 24.6,
> "end_time": 24.6,
> "data": {
> "id": "call_5otWH44dxeXEHY8RlhYYaFbV",
> "name": "bookUserAppointment",
> "result": "Appointment booked successfully."
> }
> },
> {
> "role": "AI Assistant",
> "content": "Appointment booked for 6 PM today.",
> "start_time": 27.1,
> "end_time": 29.5
> }
> ]
> }'

Transcript roles

RoleMeaning
AI AssistantThe AI system being evaluated
UserThe caller, customer, or simulated tester
Function CallA tool/function invoked by the AI (includes data.name and data.arguments)
Function Call ResultThe result returned from a tool call (includes data.name and data.result)

Only these four roles are accepted. Any other value returns a 422 error.

observation_type

ValueWhen to use
voice (default)Phone calls, Vapi, Retell, ElevenLabs — audio recording available or expected
textGenAI / LLM chat sessions — transcript only, no audio

Text observations skip all audio-based standard metrics (latency, silence, interruptions, WPM, transcription accuracy). LLM evaluation metrics still run on the transcript.

call_identifier

This is your own unique ID for the call — typically the session or call ID from your platform.

  • Used for deduplication: submitting the same ID twice returns 409 Conflict
  • Used for retrieval: GET /calls/call-abc-123 works the same as GET /calls/1024

Checking results

After ingesting, poll until analysis is done:

$curl https://api.rubrichq.io/api/public/v1/calls/call-abc-123 \
> -H "Authorization: Bearer <token>"

When analysis_status is "computed", the standard_metrics array will contain results. For text observations, only transcript-based LLM metrics will be populated.