Skip to content
AF
HealthKit reference

sleepAnalysis: HealthKit category type

HKCategoryTypeIdentifierSleepAnalysis · read from Apple’s documentation on 2026-10-02

HKCategoryTypeIdentifier.sleepAnalysis (Objective-C HKCategoryTypeIdentifierSleepAnalysis) is a HealthKit category type in Apple's "Mindfulness and Sleep" group. Apple's abstract: “A category sample type for sleep analysis information.” Apple's page names HKCategoryValueSleepAnalysis as the enum its sample values come from. It is available from iOS 8.0 and watchOS 2.0. This site's verified cross-platform matrix pairs it with SleepSessionRecord (carries stages) on Android Health Connect in its Sleep row, with the caveat “Stage vocabularies differ and stages are estimated, not measured.”

What Apple says sleepAnalysis is

A category sample type for sleep analysis information.

Apple’s abstract, quoted from its sleepAnalysis reference page, read 2026-10-02. Apple’s discussion of the type runs 29 words.

Swift
HKCategoryTypeIdentifier.sleepAnalysis
Objective-C
HKCategoryTypeIdentifierSleepAnalysis
Family
HKCategoryTypeIdentifier
Apple's topic group
Mindfulness and Sleep

Availability

The versions Apple’s documentation data gives for sleepAnalysis, platform by platform, as read on 2026-10-02.

PlatformIntroducedDeprecated
iOS8.0—
iPadOS8.0—
Mac Catalyst13.0—
macOS13.0—
visionOS1.0—
watchOS2.0—

The rest of that release: HealthKit Types Introduced in iOS 8.

What a sample holds

Value enum

HKCategoryValueSleepAnalysis — the enum Apple’s page for sleepAnalysis names. Every category type’s enum is on the HKCategoryValue reference.

Aggregation style and unit family apply only to quantity types. For a category type the dataset records neither, because the concept does not apply — not because Apple declined to say.

Can apps write sleepAnalysis?

Apple’s documentation for sleepAnalysis does not state that its samples are read-only. Apple states read-only status only in prose, and its silence is not a statement either way, so this page makes no claim that apps can save it.

On Android Health Connect

The verified cross-platform matrix pairs sleepAnalysis with SleepSessionRecord (carries stages) in its Sleep row.

The matrix’s caveat for this row:
Stage vocabularies differ and stages are estimated, not measured. Apple deprecated .asleep in iOS 16.0 and points to .asleepCore, .asleepDeep, .asleepREM or .asleepUnspecified instead (.asleepUnspecified is the rename).

The metric guide for this row: Sleep on every platform.

Questions

Which enum decodes sleepAnalysis sample values?
HKCategoryValueSleepAnalysis. Apple's page for sleepAnalysis names that enum as the one its sample values come from.
Does sleepAnalysis have a Health Connect equivalent?
This site's verified cross-platform matrix pairs HealthKit's sleepAnalysis with SleepSessionRecord (carries stages) in its Sleep row. The caveat recorded with that row: Stage vocabularies differ and stages are estimated, not measured. Apple deprecated .asleep in iOS 16.0 and points to .asleepCore, .asleepDeep, .asleepREM or .asleepUnspecified instead (.asleepUnspecified is the rename).
Which iOS version added sleepAnalysis?
iOS 8.0. Apple's availability data for sleepAnalysis lists iOS 8.0, iPadOS 8.0, Mac Catalyst 13.0, macOS 13.0, visionOS 1.0 and watchOS 2.0.

Sources checked

Apple’s abstract and sentences are quoted for identification; the page layout, the capsule and the cross-platform pairing are AIFitnessAPI’s. Generated from Apple’s documentation by scripts/fetch-healthkit-identifiers.mjs, not typed by hand — the same data as the full identifier table.

← All HealthKit type identifiers · Sleep, mindfulness and self-care