Call summary
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://external-api.moja-ai.com/api/v1/reporting/calls/summary"), Headers = { { "X-API-Key", "<X-API-Key>" }, }, Content = new StringContent("{ \"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\" ] }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://external-api.moja-ai.com/api/v1/reporting/calls/summary"
payload := strings.NewReader("{ \"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\" ] }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<X-API-Key>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://external-api.moja-ai.com/api/v1/reporting/calls/summary';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"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"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Aggregated metrics grouped by a single dimension (same options as the in-app summary report).
object
Summary dimension: route-to-target, campaign, publisher, buyer, routing_plan, caller_id, target_number, publisher_number, ivr_menu, or date.
Inclusive range start (ISO 8601).
Inclusive range end (ISO 8601).
If true, only calls with QAI transcript or answers.
Responses
Section titled “Responses”Successful Response
object
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).
object
Examplegenerated
{ "data": [ {} ]}Bad Request
object
object
Examplegenerated
{ "detail": { "code": "example", "message": "example" }}Unauthorized
object
object
Examplegenerated
{ "detail": { "code": "example", "message": "example" }}Not Found
object
object
Examplegenerated
{ "detail": { "code": "example", "message": "example" }}Conflict
object
object
Examplegenerated
{ "detail": { "code": "example", "message": "example" }}Validation Error
object
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}Too Many Requests
object
object
Examplegenerated
{ "detail": { "code": "example", "message": "example" }}
