How do I dedupe sleep webhooks with the same start time?
Use the summary_id field under metadata to uniquely identify and update sleep records, rather than the start_time/end_time pair.
Use the summary_id field under metadata to uniquely identify and update sleep records, rather than the start_time/end_time pair. A sleep session can be re-sent with an extended end time but the same summary_id, which is why the timestamp pair breaks dedup.
Recommended approach:
Match on
summary_idfirst, falling back to start/end times only whensummary_idis absent.Sleep payloads return one record per session.
For daily summaries (where steps, distance, calories, and temperature delta live), query
/v2/dailywithto_webhook=falseandwith_samples=false.To compute a day's total sleep, use the session whose
end_timefalls in the morning of the target date (filtering naps via theis_napflag), rather than summing overlapping sessions. This matches how providers report nightly sleep.
Last updated
Was this helpful?