---
title: "Push heartbeats (WakaTime compatible)"
method: POST
path: "/api/hackatime/v1/users/{id}/heartbeats"
tags: ["WakaTime Compatibility"]
---

# Push heartbeats (WakaTime compatible)

`POST /api/hackatime/v1/users/{id}/heartbeats`

Endpoint used by WakaTime plugins to send heartbeat data to the server. This is the core endpoint for tracking time.

## Path parameters

- `id` string, required

## Request body

- object[] — Array of heartbeats. The single (non-bulk) variant only processes the first element of the array.
  - `entity` string — File path or entity being tracked
  - `type` string — Entity type, e.g. "file"
  - `time` number — Unix timestamp (seconds, float)
  - `project` string
  - `branch` string
  - `ai_model` string
  - `ai_session` string
  - `ai_subscription_plan` string
  - `ai_input_tokens` integer
  - `ai_output_tokens` integer
  - `ai_prompt_length` integer
  - `ai_line_changes` integer
  - `human_line_changes` integer
  - `language` string
  - `is_write` boolean
  - `lineno` integer
  - `cursorpos` integer
  - `lines` integer
  - `category` string
  - `created_at` string, date_time
  - `dependencies` string[] — May also be sent as a string
  - `editor` string
  - `line_additions` integer
  - `line_deletions` integer
  - `machine` string
  - `operating_system` string
  - `project_root_count` integer
  - `user_agent` string
  - `plugin` string — Accepted but not persisted

## Response `202`

accepted

## Other responses

- `400` — no data provided
- `401` — unauthorized
- `403` — account pending deletion
- `422` — heartbeat rejected

## Changes

> 27 revisions in range; 1 could not be searched.

- **2026-07-22** (v1) `a1a9c5475659` — 9 info
  - added the new optional request property `items/ai_input_tokens`
  - added the new optional request property `items/ai_line_changes`
  - added the new optional request property `items/ai_model`
  - added the new optional request property `items/ai_output_tokens`
  - …5 more
- **2026-06-07** (v1) `10d87f00ef0b` — 12 info
  - added the new optional request property `items/created_at`
  - added the new optional request property `items/dependencies`
  - added the new optional request property `items/editor`
  - added the new optional request property `items/line_additions`
  - …8 more
- **2026-01-27** (v1) `b6d6849481da` — 10 warning, 2 info
  - removed the request property `items/created_at`
  - removed the request property `items/dependencies`
  - removed the request property `items/editor`
  - removed the request property `items/line_additions`
  - …8 more

[Change history](https://skmtc.dev/hackclub/apis/hackatime-api/changes/api/hackatime/v1/users/:id/heartbeats/post.md)

---

[API](https://skmtc.dev/hackclub/apis/hackatime-api.md) · [All operations](https://skmtc.dev/hackclub/apis/hackatime-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hackclub/hackatime-api/revisions/172c35ec816f/schema)
