How do I make production sync reliable?
Use webhooks as your primary data source.
1
2
PreviousWhy are daily step totals inconsistent across webhooks?NextHow do I dedupe two payloads for the same event?
Last updated
Was this helpful?
Use webhooks as your primary data source.
Use webhooks as your primary data source. Terra polls the provider and fires a webhook on new or updated data, so you do not need your own polling. (Background syncs cannot be disabled, but you can choose not to process events and instead pull via the API on your own schedule.)
Key behaviours:
Provider data is eventually consistent (sleep and readiness finalise hours later, daily totals accumulate), so you will receive multiple webhooks for the same date. Always overwrite rather than treating the first delivery as final.
Historical data is not pulled automatically on connect; request specific date ranges via REST for backfill.
On a first cloud-provider connect, an empty GET array is expected because Terra fetches in the background. Do not poll the read endpoint in a loop. Instead:
Listen for the auth-success webhook (type auth, status success) carrying user_id.
Immediately call the GET endpoint with a start_date, a window of 28 days or less, and to_webhook=false to get it synchronously.
A nightly REST pull for the previous day is a reasonable safety net, but most customers do fine with webhooks alone.
Last updated
Was this helpful?
Was this helpful?