Health Connect webhook tester

Free, no signup. Copy real example payloads for the Health Connect webhook HC Sync sends, then paste a body, header and secret to check the signature in your browser.

Last updated: 2026-11-08. Scheme source: Health Connect webhooks and the docs.

What headers does a Health Connect webhook carry?

content-type: application/json
x-hcsync-timestamp: 1762500000
x-hcsync-signature: <64 hex characters>

The signature is the hex HMAC-SHA256 of timestamp + "." + raw body, keyed with your project webhook secret (whsec_...). Records use the same shape as the sync API.

Example webhook payloads

Steps (records.synced)

{"id":"evt_9c1f","event":"records.synced","project_id":"prj_123","user_id":"user_42","count":2,"types":["steps"],"records":[{"id":"hc-steps-1","type":"steps","start":"2026-11-07T08:00:00Z","end":"2026-11-07T09:00:00Z","value":{"count":1800},"source":"com.google.android.apps.fitness"},{"id":"hc-steps-2","type":"steps","start":"2026-11-07T12:00:00Z","end":"2026-11-07T13:00:00Z","value":{"count":2400},"source":"com.google.android.apps.fitness"}]}

Sleep session with stages (records.synced)

Sleep stage numbers are Health Connect stage constants; stages must be ordered and inside the session.

{"id":"evt_9c20","event":"records.synced","project_id":"prj_123","user_id":"user_42","count":1,"types":["sleep"],"records":[{"id":"hc-sleep-1","type":"sleep","start":"2026-11-06T23:30:00Z","end":"2026-11-07T06:30:00Z","source":"com.fitbit.FitbitMobile","value":{"stages":[{"stage":4,"start":"2026-11-06T23:30:00Z","end":"2026-11-07T02:30:00Z"},{"stage":5,"start":"2026-11-07T02:30:00Z","end":"2026-11-07T04:00:00Z"},{"stage":6,"start":"2026-11-07T04:00:00Z","end":"2026-11-07T06:30:00Z"}]}}]}

Heart rate (records.synced)

{"id":"evt_9c33","event":"records.synced","project_id":"prj_123","user_id":"user_42","count":1,"types":["heart_rate"],"records":[{"id":"hc-hr-1","type":"heart_rate","start":"2026-11-07T07:00:00Z","end":null,"value":{"bpm":62},"source":"com.fitbit.FitbitMobile"}]}

Deletion (records.deleted)

Deletion events carry only record ids. Delete the matching rows in your database.

{"id":"evt_9c40","event":"records.deleted","project_id":"prj_123","user_id":"user_42","ids":["hc-steps-1","hc-hr-1"]}

User deletion (user.deleted)

{"id":"evt_9c41","event":"user.deleted","project_id":"prj_123","user_id":"user_42"}

Verify a webhook signature

Everything runs in your browser. Web Crypto computes the HMAC locally; nothing is sent to HC Sync or anywhere else. Use a test secret anyway.

Verify the signature in your server

Always verify the original request bytes before parsing, compare in constant time, and return 2xx only after your queue accepts the event.

Node / Express

import { createHmac, timingSafeEqual } from "node:crypto";
import express from "express";
const app = express();
const secret = process.env.HCSYNC_WEBHOOK_SECRET;
function verify(ts, sig, raw) {
  if (!/^\d+$/.test(ts) || Math.abs(Date.now() / 1000 - Number(ts)) > 300 || !/^[a-f0-9]{64}$/.test(sig)) return false;
  const want = createHmac("sha256", secret).update(ts + ".").update(raw).digest();
  return timingSafeEqual(Buffer.from(sig, "hex"), want);
}
// Register before express.json(): the signature covers the original bytes.
app.post("/hcsync", express.raw({ type: "application/json", limit: "1mb" }), (req, res) => {
  if (!Buffer.isBuffer(req.body) || !verify(req.get("x-hcsync-timestamp") || "", req.get("x-hcsync-signature") || "", req.body)) return res.sendStatus(401);
  const event = JSON.parse(req.body.toString("utf8")); // enqueue durably, dedupe event.id, then 2xx
  res.sendStatus(204);
});
app.listen(3000);

Python / FastAPI

import hashlib, hmac, os, time
from fastapi import FastAPI, Request, HTTPException
app = FastAPI()
SECRET = os.environ["HCSYNC_WEBHOOK_SECRET"].encode()

def verify(ts: str, sig: str, raw: bytes) -> bool:
    if not ts.isdigit() or len(ts) > 12 or abs(time.time() - int(ts)) > 300:
        return False
    want = hmac.new(SECRET, ts.encode() + b"." + raw, hashlib.sha256).hexdigest()
    return hmac.compare_digest(want, sig)

@app.post("/hcsync", status_code=204)
async def hcsync(request: Request):
    raw = await request.body()  # raw bytes, never request.json() first
    if not verify(request.headers.get("x-hcsync-timestamp", ""), request.headers.get("x-hcsync-signature", ""), raw):
        raise HTTPException(status_code=401)
    event = await request.json()  # enqueue durably, dedupe event["id"], then 2xx

Supabase Edge Function (Deno)

// supabase/functions/hcsync/index.ts  (deploy with --no-verify-jwt; the HMAC is the auth)
const enc = new TextEncoder();
const secret = Deno.env.get("HCSYNC_WEBHOOK_SECRET")!;
const key = await crypto.subtle.importKey("raw", enc.encode(secret), { name: "HMAC", hash: "SHA-256" }, false, ["verify"]);
const bytes = (hex: string) => Uint8Array.from(hex.match(/../g)!.map((h) => parseInt(h, 16)));

Deno.serve(async (req) => {
  const ts = req.headers.get("x-hcsync-timestamp") ?? "", sig = req.headers.get("x-hcsync-signature") ?? "";
  const raw = new Uint8Array(await req.arrayBuffer());
  if (!/^\d+$/.test(ts) || Math.abs(Date.now() / 1000 - Number(ts)) > 300 || !/^[a-f0-9]{64}$/.test(sig)) return new Response(null, { status: 401 });
  const msg = new Uint8Array([...enc.encode(ts + "."), ...raw]);
  if (!(await crypto.subtle.verify("HMAC", key, bytes(sig), msg))) return new Response(null, { status: 401 });
  const event = JSON.parse(new TextDecoder().decode(raw)); // insert into your table (unique on event.id), then 2xx
  return new Response(null, { status: 204 });
});

Get these events from real phones

Free plan, 5 synced users, no card. Create a project, set your webhook URL and fire sample events in two minutes.

Get these events from real phones: free plan, 5 users

Want hands-on help? 30-day setup pilot.

Frequently asked questions

How does HC Sync sign webhooks?

Every delivery has x-hcsync-timestamp (Unix seconds) and x-hcsync-signature: the hex HMAC-SHA256 of the timestamp, a dot and the raw request body, keyed with your project's whsec_ webhook secret. Reject timestamps more than 5 minutes old.

Is my webhook secret sent anywhere when I use this tester?

No. The verifier runs entirely in your browser with Web Crypto. Nothing you paste is sent to HC Sync or any other server. Still, use a test project secret, not a production one.

Why does my signature fail even with the right secret?

Almost always the body changed before verification: JSON parsed and re-serialized, whitespace or a trailing newline added, or a framework decoded it. Verify the original bytes.

Which Health Connect events does HC Sync deliver?

records.synced after an Android upload, records.deleted with record ids, user.deleted when a user is removed, and a test event you can trigger with POST /v1/webhook/test.

Can I get real webhooks without a phone?

Yes. Create a free project and call the sample data endpoint to fire records.synced events with 30 days of steps, sleep and heart rate. The free plan covers 5 synced users.