Wakapi unofficial
POST/heartbeats

Submit multiple heartbeats

Submits multiple heartbeats in one request. Send a JSON array of heartbeat objects to record activity in bulk.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

25 body fields

A JSON array containing multiple heartbeat objects.

ai_input_tokensintegeroptional
ai_line_changesintegeroptional
ai_output_tokensintegeroptional
ai_prompt_lengthintegeroptional
ai_sessionstringoptional
branchstringoptional
categorystringoptional
created_atnumberoptional
https://gorm.io/docs/conventions.html#CreatedAt
cursorposintegeroptional
editorstringoptional
ignored because editor might be parsed differently by wakatime
entitystringoptional
human_line_changesintegeroptional
is_writebooleanoptional
languagestringoptional
line_additionsintegeroptional
line_deletionsintegeroptional
linenointegeroptional
linesintegeroptional
machinestringoptional
ignored because wakatime api doesn't return machines currently
operating_systemstringoptional
ignored because os might be parsed differently by wakatime
projectstringoptional
project_root_countintegeroptional
timenumberoptional
note: on sqlite, table will have an additional column `time_real`, introduced "manually" by migration 20260111 see https://github.com/muety/wakapi/issues/882 for details
typestringoptional
user_agentstringoptional

1 status code
201Returns confirmation that the heartbeats were created.

Error handling

The request body is an array of heartbeat objects, and the schema does not mark any item fields as required. Use the documented field types, such as an integer for cursorpos and a number for created_at.