> 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/no-data/webhooks-background-delivery-stopping/apple-health-background-delivery-not-configured.md).

# How do I enable Apple Health background delivery?

Apple Health flows from the on-device SDK to Terra's servers; there is no server-side pull, so a server-side `GET /v2/{data_type}?to_webhook=true` only returns data the SDK has already collected. If data only syncs when the user opens the app, **background delivery is not configured**.

To enable it:

{% stepper %}
{% step %}
Add the HealthKit background-delivery entitlement (`com.apple.developer.healthkit.background-delivery`) / enable HealthKit Background Delivery in Xcode capabilities.
{% endstep %}

{% step %}
Call `setUpBackgroundDelivery()` in your AppDelegate's `didFinishLaunchingWithOptions`, per the [iOS SDK docs](https://docs.tryterra.co/health-and-fitness-api/mobile-only-sources/ios-swift).
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Web apps cannot connect to Apple Health at all, an app on the device is required.
{% endhint %}

After a build with background delivery enabled ships, data syncs automatically; opening the app triggers an immediate re-sync. If webhooks are flowing on Terra's side but you are not seeing them, verify your server is registering the incoming webhooks.


---

# 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/no-data/webhooks-background-delivery-stopping/apple-health-background-delivery-not-configured.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.
