WakaTime Compatibility
Push heartbeats in bulk (WakaTime compatible)
Bulk variant of the heartbeat ingest endpoint, used by WakaTime clients via the ".bulk" format extension. Resolves to the same controller action (push_heartbeats) which detects params["format"] == "bulk". Accepts up to 100 heartbeats per request and returns a per-heartbeat array of [attributes_or_error, status_code] pairs.
post/api/hackatime/v1/users/{id}/heartbeats.bulk
Path parameters
idstring required
User ID or "current" (recommended). The authenticated user is resolved from the API token, not this path segment.
Request body
Example request
[
{
"entity": "app/models/user.rb",
"type": "file",
"time": 1710946200,
"project": "hackatime",
"branch": "main",
"ai_model": "gpt/5.3-codex",
"ai_session": "session-123",
"ai_subscription_plan": "pro",
"ai_input_tokens": 1200,
"ai_output_tokens": 350,
"ai_prompt_length": 240,
"ai_line_changes": 18,
"human_line_changes": 7,
"language": "Ruby",
"is_write": true,
"lineno": 42,
"cursorpos": 12,
"lines": 350,
"category": "coding",
"created_at": "2024-03-20T15:30:00Z",
"dependencies": [
"rails"
],
"editor": "VS Code",
"line_additions": 8,
"line_deletions": 3,
"machine": "Orpheus-MacBook-Pro",
"operating_system": "Mac",
"project_root_count": 4,
"user_agent": "wakatime/v1.115.2 (darwin-24.6.0) go1.23 vscode/1.96.0",
"plugin": "vscode/1.96.0 vscode-wakatime/24.6.0"
}
]Response
created