The Xentree Profile & Analytics APIs expose user learning data — XP, streaks, token balance, daily quests, and detailed activity history. These are the core data points organizations need to track learner engagement and progress.Core capabilities#
retrieve full XP profile including level, streak, and token balance
access any user's public profile without authentication
fetch daily quest progress
query streak status and saver inventory
retrieve weekly XP activity for dashboards
pull 365-day learning pulse (heatmap) data
get aggregated learning time analytics with optional date filter
Authentication and scopes#
Most endpoints require a Bearer token or API key.
GET /api/xp/public-profile/{username} is the only unauthenticated endpoint.Recommended API key scopes:conversations:read — needed by the analytics endpoint (it reads session data)
Main endpoints#
My XP profile#
Returns the authenticated user's complete XP profile, including:level and XP progress to next level
current and longest streak
active XP booster (multiplier and end time)
today's combined XP (segments + quizzes)
Public profile#
GET /api/xp/public-profile/{username}
No authentication required. Returns public-safe data only (no email, tokens, or internal IDs). Useful for embedding learner cards in external dashboards or LMS integrations.Streak status#
GET /api/xp/streak-status
Returns detailed streak information:current_streak and longest_streak
freezes_available / freezes_used — streak saver inventory
last_activity — last date the user earned XP
streak_at_risk — true if the streak will break unless the user learns today
Weekly activity#
GET /api/xp/weekly-activity
XP earned per day for the current week (Sunday–Saturday), resolved to the user's local timezone. Also includes freeze_covered_dates — dates where streak was preserved by a streak saver.Use this to build a weekly progress widget.Learning pulse (365-day heatmap)#
GET /api/xp/learning-pulse
Returns an entry for each of the past 365 days. Each day includes:| Field | Description |
|---|
xp_earned | XP earned that day |
learning_time | Learning time in seconds |
sessions | Number of learning sessions |
quizzes | Total quizzes attempted |
quizzes_passed | Quizzes passed |
level | Intensity level for heatmap display (0–4) |
Also returns totals: total_learning_time, total_sessions, total_quizzes, total_quizzes_passed.Daily quests#
Returns today's active daily quests with current progress and status (active, ready_to_complete, completed). Quests reset daily in the user's local timezone.Learning time analytics#
GET /api/analytics/learning-time
Aggregated learning time with optional date range filter:GET /api/analytics/learning-time?from=2026-01-01&to=2026-04-23
| Parameter | Type | Description |
|---|
from | date | Start date (inclusive), format YYYY-MM-DD. Omit for all-time. |
to | date | End date (inclusive), format YYYY-MM-DD. Omit for all-time. |
Response includes totalLearningTime (seconds), totalSessions, avgSessionLength, and a dailyBreakdown array. Modified at 2026-04-23 02:03:01