Skip to content

Analytics API

Retrieve pre-aggregated daily analytics for your assistant. Use this to build custom dashboards, pipe data into BI tools, or trigger N8N workflows based on usage patterns.

Terminal window
curl "https://your-ragtime-instance.com/api/v1/projects/{projectId}/analytics?from=2026-03-01&to=2026-03-25&category=usage" \
-H "Authorization: Bearer rt_live_YOUR_KEY_HERE"
ParameterTypeDefaultDescription
fromstring30 days agoStart date (YYYY-MM-DD).
tostringTodayEnd date (YYYY-MM-DD), inclusive.
categorystringallFilter to a single category (see table below).
livebooleantrueWhen true, returns only live traffic. Set to false to include test/preview traffic.
deviceIdstringFilter analytics to a specific device/kiosk by its slug (e.g. lobby-kiosk). When set, stats are computed from raw event logs instead of daily aggregates.
CategoryDescription
usageMessage counts by user type (public, logged_in).
sourceMost‑cited knowledge sources (key = source ID). Source names are included in the sources array.
actionAction button clicks by action slug.
languageConversation language distribution.
countryUser country based on IP geolocation.
deviceDevice type breakdown (desktop, mobile, tablet).
ragRAG retrieval stats (hit, miss).
conversationConversation metrics (total, avg_messages).
sessionSession counts and durations.
{
"projectId": "proj-uuid-...",
"range": { "from": "2026-03-01", "to": "2026-03-25" },
"category": "usage",
"liveOnly": true,
"stats": [
{ "date": "2026-03-25", "category": "usage", "key": "public", "value": 142, "isLive": true },
{ "date": "2026-03-25", "category": "usage", "key": "logged_in", "value": 38, "isLive": true },
{ "date": "2026-03-24", "category": "usage", "key": "public", "value": 129, "isLive": true }
],
"sources": []
}

When the source category is included, the sources array maps source IDs (used as key in stats) to human-readable names.

The analytics endpoint is rate-limited per API key. Default: 30 requests per minute. Rate limit headers are included in every response:

HeaderDescription
X-RateLimit-LimitMaximum requests per window.
X-RateLimit-RemainingRemaining requests in current window.
X-RateLimit-ResetUnix timestamp when the window resets.
Retry-AfterSeconds to wait (only on 429).
StatusMeaning
400Invalid date format or unrecognized category.
401Missing or invalid API key.
403Key doesn’t match the project or lacks analytics:read scope.
429Rate limit exceeded. Check Retry-After header.

Use an HTTP Request node to fetch analytics and feed them into dashboards, Slack alerts, or spreadsheets:

// N8N HTTP Request node configuration:
// Method: GET
// URL: https://your-ragtime-instance.com/api/v1/projects/{projectId}/analytics
// Authentication: Header Auth
// Header Name: Authorization
// Header Value: Bearer rt_live_YOUR_KEY_HERE
// Query Params:
// from: {{ $now.minus(7, 'days').format('yyyy-MM-dd') }}
// to: {{ $now.format('yyyy-MM-dd') }}