For the complete documentation index, see llms.txt. This page is also available as Markdown.

How do I dedupe two payloads for the same event?

A data point is uniquely identified by the tuple (user_id, metric/type, start_time, end_time, summary_id), even when summary_id or timestamps are null.

A data point is uniquely identified by the tuple (user_id, metric/type, start_time, end_time, summary_id), even when summary_id or timestamps are null.

  • When two payloads share the same metadata.summary_id, the later one is an update to the same record (providers often send an initial estimate revised as more data syncs). Treat the most recent payload as truth and overwrite earlier values.

  • Deduplicate on metadata.summary_id, not start_time (for sleep, summary_id is always present). Use metadata start_time / end_time to determine when the record actually occurred.

  • Sessions that overlap a date boundary (e.g. sleep spanning midnight) intentionally appear in queries for both days, so complete sessions are never cut off at boundaries.

See the data models reference for field details.

Last updated

Was this helpful?