Skip to content

Call log

POST
/api/v1/reporting/calls/query
curl --request POST \
--url https://external-api.moja-ai.com/api/v1/reporting/calls/query \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "start_date": "example", "end_date": "example", "timezone": "example", "campaign_id": "example", "publisher_id": "example", "buyer_id": "example", "routing_plan_id": "example", "dial_type_id": "example", "dialed_target": "example", "inbound_from": "example", "inbound_to": "example", "disposition": "example", "custom_query": "example", "call_status": "all", "qai_only": false, "search": "example", "sort_field": "example", "sort_direction": "asc", "limit": 25, "offset": 0, "include_tags": [ "original_state", "original_zip_code", "voice_agent_test" ] }'

Paginated call log rows for your organization. Returns the same columns as the in-app admin call log grid (excluding UI-only and default QAI-only fields), plus cost (computed USD carrier cost per row; zero for Moja Magic calls), cost_per_min (USD per billable minute, same numeric scale as cost), billable_minutes (per-call rounded minutes used for cost), caller city and state derived from the caller ZIP (zipCode) via the NPA/NXX reference table when available, sticky_caller (true when the call was routed via Duplicate Call Routing / Sticky Caller to the same buyer or destination as a prior call), plus a time-limited presigned recording_url when recordings are available. Pass include_tags with system and/or custom tag keys to attach a per-row tags map (e.g. original_state, original_zip_code, after_agent_state, after_agent_zip, or any custom tag).

X-API-Key
Any of:
string
Media typeapplication/json
ReportingCallsQueryRequest

Query call-level transaction rows for the organization (full org access via API key).

object
start_date
required
Start Date

Inclusive range start (ISO 8601 date or datetime, UTC). Matches effective_call_time.

string
end_date
required
End Date

Inclusive range end (ISO 8601 date or datetime, UTC). Matches effective_call_time.

string
timezone
Any of:
string
campaign_id
Any of:
string
publisher_id
Any of:
string
buyer_id
Any of:
string
routing_plan_id
Any of:
string
dial_type_id
Any of:
string
dialed_target
Any of:
string
inbound_from
Any of:
string
inbound_to
Any of:
string
disposition
Any of:
string
custom_query
Any of:
string
call_status
Call Status

Include “all” calls, only “live”, or only “completed” (non-live).

string
default: all
Allowed values: all live completed
qai_only
Qai Only

If true, only calls with a QAI transcript or QAI answers.

boolean
search
Any of:
string
sort_field
Any of:
string
sort_direction
Sort Direction

Sort direction.

string
default: desc
Allowed values: asc desc
limit
Limit

Page size.

integer
default: 25 >= 1 <= 200
offset
Offset

Zero-based row offset.

integer
0
include_tags
Any of:
Array<string>

Successful Response

Media typeapplication/json
ReportingCallsQueryResponse

Paginated call rows plus aggregate call-status counts for the filtered set.

object
data
required
Data

Call log rows aligned with the in-app admin call log table: status, ids, campaign/publisher/buyer names and ids, routing plan, IVR fields, digits, inbound numbers, durations, ring time, dial target (dial_name, dialed_target, dial_type_id, and dial_type — the route action that selected the destination, e.g. route-to-target, route-to-rtb, route-to-rtb-group, route-to-sip-target, route-to-ivr — use this to distinguish a target from an RTB attribution), payouts and adjustment flags, termination fields, zip code, caller city and state (derived from zip code when a match exists), sticky_caller (true when sticky caller routing applied; backed by the STICKY_CALLER_ROUTED system tag), is_moja_magic, cost (computed per-row USD carrier cost: billable rate in cents/minute times ceil(inbound_duration/60) billable minutes divided by 100; zero for Moja Magic calls except for legacy org ids), cost_per_min (USD per billable minute), billable_minutes (per-call rounded minutes used for cost; zero for Moja Magic calls except for legacy org ids), the dedicated rtb_id / rtb_name and target_id / target_name fields (derived from dial_type/dial_type_id/dial_name: rtb_* is populated when dial_type is one of route-to-rtb, rtb_target, route-to-rtb-group, rtb, or rtb_group, and target_* is populated when dial_type is route-to-target or target), and a presigned recording_url when storage is configured. Omits UI-only columns and default QAI-only columns (disposition, category, sentiment). Each row includes two representations of the call timestamp: effective_call_time is the legacy naive UTC value formatted as YYYY-MM-DD HH:MM:SS, and effective_call_time_utc is the same instant in RFC 3339 UTC (YYYY-MM-DDTHH:MM:SSZ). Both fields always represent UTC; the request timezone only affects date filtering and grouping, not the response timestamp value. When the request includes include_tags, each row also has a tags object mapping each requested tag key to either null (not set on that call) or {value, type} where type is system or custom.

Array<object>
object
key
additional properties
any
meta
required
PaginatedResponseMeta
object
limit
required
Limit
integer
offset
required
Offset
integer
count
required
Count
integer
total
required
Total
integer
has_more
required
Has More
boolean
next_offset
Any of:
integer
previous_offset
Any of:
integer
completed_count
required
Completed Count

Count of completed (non-live) calls in the filtered set.

integer
live_count
required
Live Count

Count of live calls in the filtered set.

integer
Examplegenerated
{
"data": [
{}
],
"meta": {
"limit": 1,
"offset": 1,
"count": 1,
"total": 1,
"has_more": true,
"next_offset": 1,
"previous_offset": 1
},
"completed_count": 1,
"live_count": 1
}

Bad Request

Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{
"detail": {
"code": "example",
"message": "example"
}
}

Unauthorized

Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{
"detail": {
"code": "example",
"message": "example"
}
}

Not Found

Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{
"detail": {
"code": "example",
"message": "example"
}
}

Conflict

Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{
"detail": {
"code": "example",
"message": "example"
}
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}

Too Many Requests

Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{
"detail": {
"code": "example",
"message": "example"
}
}