> For the complete documentation index, see [llms.txt](https://docs.tryterra.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryterra.co/faq/help-topics/data-api-sdk/webhooks-dedup-and-sync-reliability/sleep-dedup-summary-id.md).

# 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. 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_id` first**, falling back to start/end times only when `summary_id` is absent.
* Sleep payloads return one record per session.
* For daily summaries (where steps, distance, calories, and temperature delta live), query `/v2/daily` with `to_webhook=false` and `with_samples=false`.
* To compute a day's total sleep, use the session whose `end_time` falls in the morning of the target date (filtering naps via the `is_nap` flag), rather than summing overlapping sessions. This matches how providers report nightly sleep.
