Calls

Calls

Call observations are the core data unit in RubricHQ. Each call contains a transcript, optional audio recording, and metadata. Once added, calls are automatically analyzed with audio metrics, LLM metrics, and code-as-judge metrics.

Add a Call

$POST /api/v1/observability/calls

With transcript:

1{
2 "call": {
3 "agent_id": 210,
4 "transcript": [
5 {"role": "assistant", "content": "Hello, how can I help you today?"},
6 {"role": "user", "content": "I'd like to check my account balance."},
7 {"role": "assistant", "content": "Sure, can you verify your date of birth?"}
8 ],
9 "direction": "inbound",
10 "metadata": {
11 "crm_id": "CRM-12345",
12 "customer_tier": "premium"
13 }
14 }
15}

With audio file:

$curl -X POST https://api.rubrichq.io/api/v1/observability/calls \
> -H "Authorization: Bearer YOUR_TOKEN" \
> -F "call[agent_id]=210" \
> -F "call[direction]=inbound" \
> -F "call[audio_file]=@recording.wav"

With audio URL:

1{
2 "call": {
3 "agent_id": 210,
4 "audio_url": "https://storage.example.com/recordings/call-123.wav",
5 "direction": "inbound"
6 }
7}

Response:

1{
2 "id": 84,
3 "analysis_status": "pending",
4 "agent": {"id": 210, "name": "Debt Collection Agent"},
5 "call_direction": "inbound",
6 "call_duration": null,
7 "metric_results_data": [
8 {"metric_name": "Response Latency", "status": "pending"},
9 {"metric_name": "Silence Detection", "status": "pending"}
10 ]
11}

After creation, the system automatically queues:

  1. Audio analysis — latency, silence, interruptions, WPM, voice tone
  2. LLM evaluation — custom metrics + system metrics
  3. Code-as-judge — runs after audio + LLM complete

List Calls

$GET /api/v1/clients/{workspace_id}/call_observations?page=1&per_page=25

Filter parameters:

ParameterDescriptionExample
agent_idFilter by agent210
call_directioninbound or outboundinbound
analysis_statuspending, completed, failedcompleted
sourcevapi, retell, upload, apiupload
call_end_reasonHow the call endedhangup
tagFilter by tagpriority
date_fromStart date (ISO 8601)2026-04-01
date_toEnd date (ISO 8601)2026-04-04

Response:

1{
2 "call_observations": [
3 {
4 "id": 84,
5 "call_identifier": "call-abc-123",
6 "agent": {"id": 210, "name": "Debt Collection Agent"},
7 "call_direction": "inbound",
8 "call_duration": 120,
9 "call_end_reason": "USER DISCONNECTED",
10 "analysis_status": "completed",
11 "source": "upload",
12 "metric_summary": {
13 "avg_latency_ms": 1685,
14 "user_interruptions": 10,
15 "ai_interruptions": 2
16 }
17 }
18 ],
19 "meta": {
20 "current_page": 1,
21 "total_pages": 3,
22 "total_count": 57
23 }
24}

Get Call Details

$GET /api/v1/clients/{workspace_id}/call_observations/{id}

Returns the full call with transcript, all metric results, recording URL, and analysis data.

Delete a Call

$DELETE /api/v1/clients/{workspace_id}/call_observations/{id}

Returns 204 No Content.

Re-run Analysis

Re-evaluate metrics on an existing call:

$# Re-run everything (audio + LLM + code)
$POST /api/v1/observability/calls/{id}/rerun_all
$
$# Re-run audio metrics only
$POST /api/v1/observability/calls/{id}/rerun_audio
$
$# Re-run LLM metrics only
$POST /api/v1/observability/calls/{id}/rerun_llm

Code-as-judge metrics are triggered automatically after LLM metrics complete.

Webhook Ingestion

For automated call ingestion from external platforms:

$# Vapi webhook
$POST /api/v1/webhooks/call_observations/vapi
$
$# Retell webhook
$POST /api/v1/webhooks/call_observations/retell

Configure these URLs in your Vapi/Retell dashboard to automatically import calls.