> 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/something-else/connections-auth-and-permissions/check-healthkit-connection-state.md).

# How do I check if the HealthKit prompt was shown?

HealthKit doesn't expose whether permissions were granted, but you can **check whether a connection was previously created**:

{% stepper %}
{% step %}
Initialise the [Terra SDK](https://docs.tryterra.co/reference/health-and-fitness-api/sdk-references/ios-swift).
{% endstep %}

{% step %}
Call `getUserId`.
{% endstep %}
{% endstepper %}

A non-null user ID means the connection exists (the permission screen was already shown); `null` means it wasn't. Use this to conditionally drive your UI.
