> 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/connecting/connection-errors-and-api-responses/webhook-30s-timeout-and-historical-data.md).

# Why does the OAuth redirect hang or return missing\_scopes?

Two separate things are happening here.

**The redirect hang:** Terra sends the [authentication webhook](https://docs.tryterra.co/health-and-fitness-api/user-authentication/handling-authentication-events) to your server synchronously. If your server takes longer than 30 seconds to respond, the client-side redirect hangs or errors even though the connection succeeded, so **make your webhook endpoint respond quickly**.

**The missing history:** webhooks only deliver data generated *after* the user connects. For earlier data, call the [historical endpoints](https://docs.tryterra.co/health-and-fitness-api/managing-user-health-data/requesting-historical-data) (e.g. `/v2/activity`, `/v2/daily`) with a `start_date` range and `to_webhook=true`.

Most providers allow full history. Some impose limits: Garmin allows up to 5 years back (subject to Garmin's backfill limits), Coros allows up to 3 months back from now or 24 hours before the user authenticated (whichever is hit first), and Polar allows up to 30 days back but not before the user granted permission.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tryterra.co/faq/help-topics/connecting/connection-errors-and-api-responses/webhook-30s-timeout-and-historical-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
