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

How do I make production sync reliable?

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:

1

Listen for the auth-success webhook (type auth, status success) carrying user_id.

2

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?