Skip to content
AF

HKCategoryValue Enums by Type

30 category types · 28with a named value enum · read from Apple’s documentation on 2026-08-28

28 of HealthKit's 30 category types resolve to a value enum, 2 are honest nulls. What a category sample holds, and why averaging one means nothing.

A HealthKit category sample does not hold a measurement. It holds a value drawn from an enumeration, plus a start date and an end date — and that is the entire payload. 30 of the 240 identifiers in this dataset are category types, and the table on this page pairs each of them with the value enum it resolves to. 28 resolve. Two do not.

The distinction that matters when you write the reading code is between a type-specific enum and the generic one. sleepAnalysis resolves to HKCategoryValueSleepAnalysis, menstrualFlow to HKCategoryValueMenstrualFlow, appleStandHour to HKCategoryValueAppleStandHour, contraceptive to HKCategoryValueContraceptive, ovulationTestResult to HKCategoryValueOvulationTestResult, lowCardioFitnessEvent to HKCategoryValueLowCardioFitnessEvent. Each of those carries real alternatives: a sleep sample says which stage, a menstrual flow sample says how heavy, a stand-hour sample says stood or idle. The value is information.

Then there is plain HKCategoryValue, which is what a type resolves to when its value has nothing to say. mindfulSession, handwashingEvent, toothbrushingEvent, sexualActivity, pregnancy, lactation and intermenstrualBleeding all land here, as do the heart-event types highHeartRateEvent, lowHeartRateEvent and irregularHeartRhythmEvent, and the iOS 16.0 cycle-deviation types irregularMenstrualCycles, infrequentMenstrualCycles, persistentIntermenstrualBleeding and prolongedMenstrualPeriods. For these the sample's meaning lives entirely in its type and its time range: these are the .notApplicable types, and reading the value tells you nothing you did not already know from the query you ran. A mindfulSession sample means someone meditated, from here until there. There is no scale.

This is why averaging a category type is not a slightly wrong answer but a category error. The integer you can pull out of a category sample is an ordinal — a position in a list of alternatives — and arithmetic on ordinals produces a number that measures nothing. The mean of a week of menstrualFlow samples is not a flow. The mean of a month of sleepAnalysis values is not a sleep quality. What category data supports is counting occurrences, measuring elapsed time from the start and end dates, taking the latest value, and grouping by value. If you want a number out of a category type, derive it from the dates or from the count, never from the value.

Two category types have no value enum resolved in this dataset: bleedingAfterMenopause and hypertensionEvent. Both are null on purpose. Resolving these took three passes: taking the first HKCategoryValue* symbol mentioned on the page resolved 29 of 30 and was wrong, because a cross-linked symbol on the pregnancy page would have shipped the wrong enum for a type. Requiring an exact name match resolved far fewer and was structurally biased against every type whose value is .notApplicable. The rule that shipped accepts either the type's own matching enum name or the generic enum, which resolves 28 and leaves two honest nulls. A null here means Apple's page did not state it in a form the parser could stand behind — not that no enum exists. That choice, and why guessing the last two would have been worse than admitting the gap, is written up in building the HealthKit dataset.

Everything above was parsed from Apple's developer documentation on 2026-08-28 for the HealthKit identifier dataset. Which of these types are beta or otherwise unsettled is on HealthKit type status. For the two category types most products actually read, see sleep tracking APIs, what sleep stages are and the menstrual cycle API.

All 30 category types and the enum that decodes them

Apple names a decoding enum for 28 of the 30 category types. For the remaining 2 bleedingAfterMenopause, hypertensionEvent — Apple’s page names no matching enum, so the row says so rather than guessing one.

Category typeApple’s abstractValue enumiOS
appleStandHourA category sample type that counts the number of hours in the day during which the user has stood and moved for at least one minute per hour.HKCategoryValueAppleStandHour9.0
appleWalkingSteadinessEventA category sample type that records an incident where the user showed a reduced score for their gait’s steadiness.HKCategoryValueAppleWalkingSteadinessEvent15.0
audioExposureEventA category sample type for audio exposure events.HKCategoryValueAudioExposureEvent13.0
bleedingAfterMenopauseAn identifier for samples that record bleeding after menopause.unresolved — Apple’s page names no matching enum27.0
cervicalMucusQualityA category sample type that records the quality of the user’s cervical mucus.HKCategoryValueCervicalMucusQuality9.0
contraceptiveA category sample type that records the use of contraceptives.HKCategoryValueContraceptive14.3
environmentalAudioExposureEventA category sample type that records exposure to potentially damaging sounds from the environment.HKCategoryValueEnvironmentalAudioExposureEvent14.0
handwashingEventA category sample type for handwashing events.HKCategoryValue14.0
headphoneAudioExposureEventA category sample type that records exposure to potentially damaging sounds from headphones.HKCategoryValueHeadphoneAudioExposureEvent14.2
highHeartRateEventA category sample type for high heart rate events.HKCategoryValue12.2
hypertensionEventApple publishes no abstract for this type.unresolved — Apple’s page names no matching enum26.2
infrequentMenstrualCyclesA category sample that indicates an infrequent menstrual cycle.HKCategoryValue16.0
intermenstrualBleedingA category sample type that records spotting outside the normal menstruation period.HKCategoryValue9.0
irregularHeartRhythmEventA category sample type for irregular heart rhythm events.HKCategoryValue12.2
irregularMenstrualCyclesA category sample that indicates an irregular menstrual cycle.HKCategoryValue16.0
lactationA category type that records lactation.HKCategoryValue14.3
lowCardioFitnessEventAn event that indicates the user’s VO2 max values consistently fall below a particular aerobic fitness threshold.HKCategoryValueLowCardioFitnessEvent14.3
lowHeartRateEventA category sample type for low heart rate events.HKCategoryValue12.2
menopausalStateAn identifier for samples that record a person’s menopausal state.HKCategoryValueMenopausalState27.0
menstrualFlowA category sample type that records menstrual cycles.HKCategoryValueMenstrualFlow9.0
mindfulSessionA category sample type for recording a mindful session.HKCategoryValue10.0
ovulationTestResultA category sample type that records the result of an ovulation home test.HKCategoryValueOvulationTestResult9.0
persistentIntermenstrualBleedingA category sample that indicates persistent intermenstrual bleeding.HKCategoryValue16.0
pregnancyA category type that records pregnancy.HKCategoryValue14.3
pregnancyTestResultA category type that represents the results from a home pregnancy test.HKCategoryValuePregnancyTestResult15.0
progesteroneTestResultA category type that represents the results from a home progesterone test.HKCategoryValueProgesteroneTestResult15.0
prolongedMenstrualPeriodsA category sample that indicates a prolonged menstrual cycle.HKCategoryValue16.0
sexualActivityA category sample type that records sexual activity.HKCategoryValue9.0
sleepAnalysisA category sample type for sleep analysis information.HKCategoryValueSleepAnalysis8.0
toothbrushingEventA category sample type for toothbrushing events.HKCategoryValue13.0

What will bite you

The value is an Int, and nothing stops you charting it. A category sample's value arrives as an integer, so it will happily flow through the same rollup code as a step count. Summing or averaging it compiles, runs, and produces a plausible-looking line. Guard this at the boundary: keep category values in a column typed as an enum or a string in your own storage, so that the arithmetic is impossible rather than merely wrong.

Two enums are missing, and inventing them is the failure mode. bleedingAfterMenopause and hypertensionEvent resolve to nothing here. bleedingAfterMenopause is a beta type from iOS 27.0 and hypertensionEvent from iOS 26.2 is listed with no abstract and no discussion at all. If you need either, read Apple's page for that identifier yourself at the moment you build against it, and treat any value set you find as current only for that day.

Generic and specific enums are not interchangeable in a switch. Code written against HKCategoryValue for a handwashing event and copied to read a menstrualFlow sample will compile against raw integers and silently mis-label every value. Match on the type's own enum, and make the default branch of the switch loud rather than a fallback that stores a zero.

Value sets change without the type changing. A category type can stay current while a value inside it is retired or added, and nothing about the identifier's own status will tell you. HealthKit type status covers where that has already happened.

Questions

What is a HealthKit category type?

A type whose samples hold a value from an enumeration plus a start and end date, rather than a number and a unit. 30 of the 240 identifiers in this dataset are category types. A sleep sample says which stage, a stand-hour sample says stood or idle, and an event sample often says nothing beyond the fact that it happened between two times.

Can I average HealthKit category samples?

No, and the arithmetic will not stop you. The integer in a category sample is a position in a list of alternatives, not a measurement, so its mean has no meaning. Count the samples, measure elapsed time from the start and end dates, take the latest value, or group by value instead.

Why do two category types show no value enum?

Because Apple's pages for bleedingAfterMenopause and hypertensionEvent did not state one in a form the parser could stand behind. The dataset stores a null rather than a guess. An earlier rule resolved 29 of 30 by taking the first enum symbol on the page, and it would have shipped the wrong enum for one type.

Derived by AIFitnessAPI from Apple’s published documentation, read 2026-08-28. The full table with units, aggregation and value enums is at every HealthKit type identifier, and the machine-readable export is on datasets.