Admin Utils
Get admin user stats
Get detailed stats for a user (Admin view). When start_date/end_date are provided, heartbeats are filtered to that range; otherwise the single date param (default: current date) is used.
get/api/admin/v1/user/stats
Query parameters
user_idstring
User ID. Either user_id or id may be supplied.
idstring
Alias for user_id. If both id and user_id are supplied, id takes precedence.
start_datestring
Start date (YYYY-MM-DD or epoch seconds). When present (with or without end_date), defines the time range and overrides the date param. Defaults to 10 years ago.
end_datestring
End date (YYYY-MM-DD or epoch seconds). Defaults to end of the current day.
datestring date
Single day (YYYY-MM-DD) to scope stats to. Only used when neither start_date nor end_date is supplied. Defaults to the current date.
Response
successful
Example response
{
"user_id": 42,
"username": "orpheus",
"start_date": "2024-03-20",
"end_date": "2024-03-20",
"timezone": "America/New_York",
"total_heartbeats": 152,
"total_duration": 7200,
"heartbeats": [
{
"id": 987654,
"time": "1710946200.0",
"created_at": "2024-03-20T15:30:00Z",
"project": "hackatime",
"branch": "main",
"category": "coding",
"dependencies": "rails,sidekiq",
"editor": "VS Code",
"entity": "app/models/user.rb",
"language": "Ruby",
"machine": "Orpheus-MacBook-Pro",
"operating_system": "Mac",
"type": "file",
"user_agent": "wakatime/v1.115.2 (darwin-24.6.0) go1.23 vscode/1.96.0",
"line_additions": 8,
"line_deletions": 3,
"lineno": 42,
"lines": 350,
"cursorpos": 12,
"project_root_count": 4,
"is_write": true,
"source_type": "direct_entry",
"ip_address": "203.0.113.7"
}
]
}