---
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

---

[API](https://skmtc.net/hackclub/apis/hackatime-api.md) · [All operations](https://skmtc.net/hackclub/apis/hackatime-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hackclub/hackatime-api/versions/4214f8ab061e/schema)
