Mental Health Assessments API: PHQ-9 and GAD-7 in HealthKit
Last verified October 4, 2026 · 5 min read
Covered here:HealthKitHealth Connect
This page describes two HealthKit data types that hold answers to clinical screening questionnaires. It does not explain how to interpret them, and nothing here is medical advice. If your product shows these results to someone, a clinician should decide what it says and what happens next.
What Apple ships#
Apple's HealthKit updates page, under June 2024, says apps can "Read and write mental well-being samples using the HKStateOfMind, HKPHQ9Assessment, and HKGAD7Assessment data types." Both assessment classes list iOS 18.0, iPadOS 18.0, Mac Catalyst 18.0, macOS 15.0, visionOS 2.0 and watchOS 11.0, and both inherit from HKScoredAssessment, which inherits from HKSample.
| Symbol | Declaration | Notes |
|---|---|---|
HKScoredAssessment | var score: Int { get } | Superclass of both; no description |
HKPHQ9Assessment | init(date:answers:metadata:) with [HKPHQ9Assessment.Answer] | Discussion: "Represents the result of a PHQ-9 assessment." |
HKPHQ9Assessment.Answer | notAtAll, severalDays, moreThanHalfTheDays, nearlyEveryDay, preferNotToAnswer | Five cases |
HKPHQ9Assessment.Risk | noneToMinimal, mild, moderate, moderatelySevere, severe | Five cases |
HKGAD7Assessment | init(date:answers:metadata:) with [HKGAD7Assessment.Answer] | No description |
HKGAD7Assessment.Answer | notAtAll, severalDays, moreThanHalfTheDays, nearlyEveryDay | Four cases, no opt-out |
HKGAD7Assessment.Risk | noneToMinimal, mild, moderate, severe | Four cases |
HKScoredAssessmentType | init(_ identifier: HKScoredAssessmentTypeIdentifier) | Subclass of HKSampleType |
The only prose on any of these pages is the PHQ-9 discussion: "Represents the result of a PHQ-9 assessment. Learn more about Pfizer's PHQ-9 at https://support.apple.com/en-us/105070". Apple's HKScoredAssessmentTypeIdentifier page, fetched 2026-10-04, lists only init(rawValue:) and no named constants, so check the SDK headers for the identifier values your Xcode version exposes.
What Apple does not document#
All of these symbols were read from Apple's documentation JSON on 2026-10-04. Apple does not document:
- how many answers each assessment needs, or the order they map to the questionnaire items;
- how
scoreis computed, or howpreferNotToAnsweraffects it; - the score thresholds behind each
Riskcase; - whether saving a sample with the wrong number of answers fails, and with which error.
One thing the declarations do settle. init(date:answers:metadata:) takes no score and no risk, and both properties are get-only. Your app supplies answers and HealthKit supplies the rest. That is convenient, and it also means your UI is showing a number whose method Apple has not published.
Screening data, labelled as such#
PHQ-9 and GAD-7 are questionnaires. A sample records what a person answered on a given date. It is not a diagnosis of depression or anxiety, and a Risk case is a band, not a clinical finding. Three rules follow for anyone building on these types:
- Say what it is. Label results as questionnaire responses and screening bands. Do not write copy that tells a person what condition they have.
- Do not act alone. If your app reacts to a result, for example by suggesting the person talk to someone, that response is a clinical decision. Have qualified people design it and review it.
- Know where you stand. An app that scores a validated instrument and responds to the score may be making medical claims. Our FDA fitness app regulation page sets out how the general-wellness and medical-device framing is usually drawn. Use it to prepare for a conversation with counsel.
Android has no counterpart#
Google's Health Connect data types page, fetched 2026-10-04, lists no questionnaire, assessment or screening record. Its Wellness category, described as data "related to a user's mental health and well-being", holds only MindfulnessSessionRecord. Health Connect's Medical Records feature stores FHIR resources, but its data format page maps Observation resources only into named categories such as vital signs, laboratory, pregnancy and social history, and states that "Observations not belonging to any of these categories are not written to Health Connect." Google does not document a category for questionnaire results.
| Source | PHQ-9 / GAD-7 data | Verified from |
|---|---|---|
| Apple HealthKit | HKPHQ9Assessment, HKGAD7Assessment, read and write | Apple HealthKit reference and updates page, fetched 2026-10-04 |
| Android Health Connect | No assessment record; no documented Medical Records category for questionnaires | Health Connect data types and medical records data format pages, fetched 2026-10-04 |
| Wearable cloud APIs and aggregators | Not documented on our pages, so verify with each vendor | None |
Traps#
- Two enums, one shape. The PHQ-9 and GAD-7 answer enums share four case names but are different Swift types. PHQ-9 has
preferNotToAnswer; GAD-7 does not. Shared UI code needs to handle the extra case. - Other writers. Any app with write access can save these samples. Read the source before you plot a history, because a sample from another app followed a flow you did not design.
- Silent read denial. Apple's authorization guide says your app "doesn't know whether someone granted or denied permission to read data." An empty assessment history says nothing about the person.
- Pair with mood carefully. These types arrived alongside State of Mind. Putting a mood trend next to a screening band invites people to read one as evidence for the other. Keep them separate unless a clinician has designed the view.
Privacy#
Screening answers are among the most sensitive records an app can hold, and questions about whether they count as protected health information depend on who you are and who you work with. Our page on whether fitness data is PHI covers the usual tests. Apple's HealthKit rules on advertising, disclosure and sale apply here as to every type. Keep results on the device where possible, encrypt what you sync, and make deletion real. None of this is legal advice.
Before you ship#
Re-read Apple's assessment pages each release, because the scoring description may appear. Validate answer arrays yourself. Show results as screening responses, with clinical review of every message attached to them. On Android, plan your own storage.
Frequently asked questions
- What answer values do HKPHQ9Assessment and HKGAD7Assessment accept?
- Both answer enums share four cases: notAtAll, severalDays, moreThanHalfTheDays and nearlyEveryDay. HKPHQ9Assessment.Answer adds a fifth, preferNotToAnswer, which the GAD-7 enum does not have. You pass an array of these to init(date:answers:metadata:). Apple's reference, fetched 2026-10-04, does not state how many answers each assessment requires or what happens if the count is wrong, so validate the array before you save.
- What risk levels does HealthKit attach to PHQ-9 and GAD-7 samples?
- HKPHQ9Assessment.Risk has five cases: noneToMinimal, mild, moderate, moderatelySevere and severe. HKGAD7Assessment.Risk has four: noneToMinimal, mild, moderate and severe. Apple publishes no score thresholds for these cases. The risk property is read-only and the initializer does not take it, so the value comes from HealthKit's side. Show it as the questionnaire's screening band, never as a diagnosis or a recommendation.
- Can I compute my own PHQ-9 score instead of reading HealthKit's?
- You can, but then two numbers exist for one questionnaire. HKScoredAssessment exposes score as an Int, and Apple does not document how HealthKit computes it or how a preferNotToAnswer response affects it. If you score independently, store which method produced the number and do not mix the two in one chart. The scoring rules belong to the questionnaire's publisher, so take them from that source and have a clinician review your use.
- Is there a Health Connect record for depression or anxiety screening?
- Google's data types page, fetched 2026-10-04, lists no questionnaire, assessment or screening record. Its Wellness category contains only MindfulnessSessionRecord. Medical Records maps FHIR Observation resources only into named categories such as vital signs, laboratory and social history, and Google states that observations outside those categories are not written to Health Connect. An Android version needs its own storage.
Keep reading
Elsewhere on the site
Pages that share this one’s concepts and sources, from other sections.
Next steps
Was this page useful?
Independent comparison, last reviewed October 4, 2026. Pricing, rate limits, and feature availability change often — confirm current details in each provider’s official documentation before you commit. Product and company names are trademarks of their respective owners; AIFitnessAPI is not affiliated with, endorsed by, or sponsored by any product listed here.
← All health data · by AIFitnessAPI