Build a reporting dashboard
Show call and lead totals by day, campaign, buyer or publisher on your own site.
The reports routes add up calls or leads over a period and group them. One request fills a chart or a table.
You need: a key with reports:read. Add campaigns:read, buyers:read and publishers:read if you also show lists.
1. Ask for a period
Give start and end as ISO 8601 times. Both are required, end must be after start, and a report covers at most one year. Use the account's time zone (from GET /v1/account/key) for day boundaries your users expect.
curl 'https://api.traki.io/v1/account/reports/calls?start=2026-11-01T00:00:00-05:00&end=2026-12-01T00:00:00-05:00&groupBy=day' \
-H "Authorization: Bearer $TRAKI_KEY"2. Read the rows
{
"start": "2026-11-01T05:00:00.000Z",
"end": "2026-12-01T05:00:00.000Z",
"groupBy": "day",
"rows": [
{
"group": "2026-11-01",
"label": null,
"calls": 412,
"answered": 371,
"billable": 233,
"durationSec": 98412,
"revenue": "6990.00",
"payout": "4660.00"
}
]
}Money is a decimal string, so it adds up without rounding errors. Convert it with a decimal type, not a float.
3. Group another way
groupBy takes day, campaign, buyer or publisher. For the last three, group is the record's ID and label its name. Narrow any report with campaignId, buyerId or publisherId.
curl 'https://api.traki.io/v1/account/reports/calls?start=2026-11-01T00:00:00Z&end=2026-12-01T00:00:00Z&groupBy=campaign' \
-H "Authorization: Bearer $TRAKI_KEY"Lead reports work the same way at /v1/account/reports/leads.
4. Keep it fast
- Cache each report for a minute or two. Totals for past days do not change often.
- Fetch today's numbers more often than last month's.
- Run the requests from your server and send the results to the page. The key never goes to the browser.
- Watch the
RateLimit-Remainingheader. See rate limits.