Webhooks and sync

Keep health data fresh without creating retry storms.

PostHealth supports scheduled and manual refreshes, plus Google Health webhook routing for connected accounts.

Manual sync

POST /api/v1/sync
Authorization: Bearer fbt_live_...

The endpoint queues a bounded refresh. Poll GET /api/v1/connection or GET /api/v1/data-quality to read the latest sync state and freshness.

Historical backfill

POST /api/v1/backfill
Authorization: Bearer fbt_live_...
Content-Type: application/json

{"days":365}

Backfills are durable, account-scoped jobs processed in safe provider windows. Use GET /api/v1/backfill to inspect progress.

Freshness semantics

The data-quality resource reports covered days, latest observations, recent sync runs, and a freshness status. Current ranges become stale after 48 hours without a new observation; historical ranges are labeled observed rather than incorrectly marked stale.

Provider authentication failures do not create unbounded retries. Transient partial/error runs can queue a bounded self-heal job when no recovery job is already active.

On this page