Skip to content
AF
Health Data

Mental Health Assessments API: PHQ-9 and GAD-7 in HealthKit

Last verified October 4, 2026 · 5 min read

Apple HealthKit stores two standard screening questionnaires as samples: HKPHQ9Assessment for the PHQ-9 and HKGAD7Assessment for the GAD-7, both available from iOS 18.0, watchOS 11.0, macOS 15.0 and visionOS 2.0. You create one from a date and an array of answers, and each sample exposes an integer score inherited from HKScoredAssessment plus a risk value, with five PHQ-9 risk levels and four GAD-7 levels. Apple's reference does not document how the score or risk is derived, and the initializer takes no score or risk argument. These are screening results, not diagnoses, and Google's Health Connect data types page lists no equivalent record.

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.

SymbolDeclarationNotes
HKScoredAssessmentvar score: Int { get }Superclass of both; no description
HKPHQ9Assessmentinit(date:answers:metadata:) with [HKPHQ9Assessment.Answer]Discussion: "Represents the result of a PHQ-9 assessment."
HKPHQ9Assessment.AnswernotAtAll, severalDays, moreThanHalfTheDays, nearlyEveryDay, preferNotToAnswerFive cases
HKPHQ9Assessment.RisknoneToMinimal, mild, moderate, moderatelySevere, severeFive cases
HKGAD7Assessmentinit(date:answers:metadata:) with [HKGAD7Assessment.Answer]No description
HKGAD7Assessment.AnswernotAtAll, severalDays, moreThanHalfTheDays, nearlyEveryDayFour cases, no opt-out
HKGAD7Assessment.RisknoneToMinimal, mild, moderate, severeFour cases
HKScoredAssessmentTypeinit(_ 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 score is computed, or how preferNotToAnswer affects it;
  • the score thresholds behind each Risk case;
  • 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.

SourcePHQ-9 / GAD-7 dataVerified from
Apple HealthKitHKPHQ9Assessment, HKGAD7Assessment, read and writeApple HealthKit reference and updates page, fetched 2026-10-04
Android Health ConnectNo assessment record; no documented Medical Records category for questionnairesHealth Connect data types and medical records data format pages, fetched 2026-10-04
Wearable cloud APIs and aggregatorsNot documented on our pages, so verify with each vendorNone

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.

All 132 questions in Health Data →

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