---
title: "Get most recent heartbeat"
method: GET
path: "/api/v1/my/heartbeats/most_recent"
tags: ["My Data"]
---

# Get most recent heartbeat

`GET /api/v1/my/heartbeats/most_recent`

Returns the most recent heartbeat for the authenticated user. Useful for checking if the user is currently active. Authenticate with an OAuth access token with the `read` scope or an API key as a Bearer token in the `Authorization` header (HTTP Basic auth with the API key is also accepted).

## Query parameters

- `source_type` string
- `editor` string

## Response `200`

successful

- object
  - `has_heartbeat` boolean, required — Whether a matching heartbeat was found.
  - `heartbeat` object, nullable, required — The most recent matching heartbeat, or null when none is found.
  - `editor` string, nullable, required — Editor of the matching heartbeat, or null.
  - `time_ago` string, nullable, required — Human-readable time since the heartbeat (e.g. "5 minutes ago"), or null.

## Other responses

- `401` — unauthorized — Returned when the Authorization header is missing, the OAuth token lacks the read scope, or the token is invalid.

## Changes

- **2026-06-07** (v1) `10d87f00ef0b` — 3 info
  - the endpoint scheme security `Bearer` was added to the API
  - the endpoint scheme security `Bearer AND ApiKeyAuth` was removed from the API
  - added the media type `application/json` for the response with the status `200`
- **2026-01-27** (v1) `b6d6849481da` — 1 breaking, 2 info
  - removed the media type `application/json` for the response with the status `200`
  - the endpoint scheme security `Bearer AND ApiKeyAuth` was added to the API
  - the endpoint scheme security `Bearer` was removed from the API

[Change history](https://skmtc.dev/hackclub/apis/hackatime-api/changes/api/v1/my/heartbeats/most_recent/get.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)
