Skip to content

Call summary

POST
/api/v1/reporting/calls/summary
curl --request POST \
--url https://external-api.moja-ai.com/api/v1/reporting/calls/summary \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "group_by": "route-to-target", "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", "qai_only": false, "search": "example", "qai_visible_columns": [ "example" ] }'

Aggregated call metrics grouped by one dimension (campaign, publisher, buyer, routing_plan, caller_id, target_number, publisher_number, ivr_menu, route-to-target, or date, etc.). Admin cost excludes Moja Magic minutes.

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

Aggregated metrics grouped by a single dimension (same options as the in-app summary report).

object
group_by
Group By

Summary dimension: route-to-target, campaign, publisher, buyer, routing_plan, caller_id, target_number, publisher_number, ivr_menu, or date.

string
default: campaign
Allowed values: route-to-target campaign publisher buyer routing_plan caller_id target_number publisher_number ivr_menu date
start_date
required
Start Date

Inclusive range start (ISO 8601).

string
end_date
required
End Date

Inclusive range end (ISO 8601).

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
qai_only
Qai Only

If true, only calls with QAI transcript or answers.

boolean
search
Any of:
string
qai_visible_columns
Any of:
Array<string>

Successful Response

Media typeapplication/json
ReportingCallsSummaryResponse
object
data
required
Data

Summary rows with metrics: calls, unique_calls, revenue, payout, profit, billable_minutes (admin: sum of per-call ceil(inbound_duration/60) with Moja Magic minutes excluded except for legacy org ids), cost (admin: sums per-call carrier cost with Moja Magic minutes excluded except for legacy org ids), conversion fields, etc., depending on group_by (same semantics as the in-app reporting summary).

Array<object>
object
key
additional properties
any
Examplegenerated
{
"data": [
{}
]
}

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"
}
}