type=metrics: aggregated figures per agent and channel (conversations, transfers to a human, AI containment, call duration, WhatsApp notifications, recontacts, and daily and hourly series). Use it for reports and dashboards.type=chats: one row per conversation with all its parameters, paginated. Use it to export or reconcile the raw data.
🔑 Authentication
Every request needs an API key with theanalytics_api permission. Ask the Lovi team for one; it is different from the key used by the web widget.
Send the key in the x-api-key header (recommended) or as the access_key query parameter.
The company is always taken from the key. A key can only read its own company’s data, and there is no parameter to choose another one.
Endpoint
Query parameters
Days are interpreted in
tz: date_from=2026-10-01&date_to=2026-10-31 with tz=Europe/Madrid covers from 1 October 00:00 to 1 November 00:00 Madrid time. Daylight-saving changes are handled for you.
All timestamps in responses are UTC (ISO 8601 ending in Z).
Metrics (type=metrics)
Returns one entry per agent and channel, ordered by number of conversations.
Conversations (type=chats)
Returns the conversations of the range one by one, oldest first, 100 per page by default.
Pagination
Whilenext_cursor is not null, request the next page with the same parameters plus cursor=<next_cursor>. Conversations are ordered by created_at and id, so no conversation is repeated or skipped between pages.
Errors
Errors return a JSON body{ "success": false, "message": "…" }.
Limits and good practices
- Up to 31 days per request and 100 conversations per page.
- A
metricsrequest for a full month takes a few seconds. For a monthly or daily report, one call per period is enough: there is no need to poll. - To export a whole month of conversations, walk the pages one after another rather than in parallel.
- Keep the key secret and server-side. Do not use it in a browser or a mobile app.
