# HealthKit Metadata Keys: Reading the Extra Fields on an Apple Health Entry

By The Optimized Team (Product). Published: 2026-11-26T05:47:24.867796+00:00. Updated: 2026-11-26T05:47:25.598675+00:00.
Canonical: https://optimizedtracker.com/blog/healthkit-metadata-keys-extra-fields-on-an-entry

Some Apple Health entries carry extra fields called metadata. A short guide to what the predefined keys say, and why many entries have none.

HealthKit metadata keys are the labels on an optional dictionary of extra fields that an Apple Health entry can carry. Apple defines a set of predefined keys, apps can add their own, and plenty of entries have none at all. When a key is present, it tells you something about how the entry came to exist, which is useful if you want a record you can audit later.

This piece is about reading those fields. It says nothing about what any number means. If you want the basics of the entry itself first, start with [reading a HealthKit type identifier](/blog/healthkit-type-identifier-in-an-export-record).

## What the metadata dictionary is

According to [Apple's documentation for HKObject metadata](https://developer.apple.com/documentation/healthkit/hkobject/metadata.md), the metadata dictionary "contains extra information describing this object." Its keys are all strings. The values can be strings, numbers or dates.

Two details matter for a record keeper:

- **It is read-only on the object.** The property is declared as a getter, and Apple says you set metadata when the object is created. Nothing on that page describes editing it afterward.
- **It is optional.** The property is declared as an optional dictionary, so an entry can simply have no metadata.

Apple's [Samples page](https://developer.apple.com/documentation/healthkit/samples.md) adds one more piece of context. If a sample's start and end dates are the same, it represents a point in time. If the end date is later, it represents an interval. Metadata rides along with either kind.

## Predefined key groups

Apple lists its predefined keys on the [Metadata Keys page](https://developer.apple.com/documentation/HealthKit/metadata-keys.md), described as "constants used to add metadata to objects stored in HealthKit." The page says to use them to facilitate sharing data between apps. It groups them roughly like this:

| Group | Example key | Apple's description |
|---|---|---|
| General | `HKMetadataKeyWasUserEntered` | Whether the sample was entered by the user |
| General | `HKMetadataKeyTimeZone` | The user's time zone when the object was created |
| General | `HKMetadataKeyExternalUUID` | A unique identifier set by the source |
| Device information | `HKMetadataKeyDeviceName` | The name of the device that took the reading |
| Sync | `HKMetadataKeySyncIdentifier` | A unique string so data can be updated and synced |
| Lab | `HKMetadataKeyWasTakenInLab` | Whether the sample was taken in a lab |
| Algorithm | `HKMetadataKeyAlgorithmVersion` | The version of the algorithm used to calculate the value |

The same page also lists groups for weather, nutrition, audio exposure, heart rate sensors, blood glucose and others. You will not see most of them on a typical entry. A key exists because Apple defined a place for it, not because every source fills it in.

## Was user entered, time zone and source ID

Three general keys do most of the work when you are asking "where did this entry come from?"

**Was user entered.** Apple's page for [HKMetadataKeyWasUserEntered](https://developer.apple.com/documentation/HealthKit/HKMetadataKeyWasUserEntered.md) says the key indicates "whether the sample was entered by the user," true if so and false otherwise. A typed value and a sensor reading can look the same in a chart. This flag is one way an app can tell them apart. If it is missing, you cannot conclude either way, because the key is up to the source to set.

**Time zone.** Apple describes the time zone key as the user's time zone when the object was created. That is a different thing from the offset shown in an export file; see [the time zone offset in an export](/blog/apple-health-export-time-zone-offset) for how those two differ.

**External UUID.** Apple's wording is "a unique identifier for an HKObject that is set by its source." In practice it is the source's own ID for the entry, which helps if you ever need to match a row in Health against a row in the app that wrote it. Apple does not say which sources set it.

## Device keys

A handful of keys describe the hardware: the device name, the manufacturer name, the serial number, and a digital signature "that can be used to validate the origin of the HealthKit object." These are the closest thing in the dictionary to provenance for a measurement.

They're also easy to over-read. A device name tells you which gadget a source says took the reading. It does not tell you whether the gadget was worn correctly or calibrated. For more on that, see [what a device or app name tells you](/blog/what-a-device-or-app-name-tells-you-in-an-entry).

## Sync identifier and version

This pair changes how you think about an entry. Apple's [sync identifier page](https://developer.apple.com/documentation/HealthKit/HKMetadataKeySyncIdentifier.md) says the key takes a string, and that if you add it you must also add the sync version key, which takes a number.

Then the rule: when an object is saved with a sync identifier, the system looks for an existing object with the same identifier. If it finds one, it compares the version numbers. If the new object has a greater version, the system replaces the old one.

For a record, that means an entry can be replaced by a newer one from the same source without any visible edit. The row you exported last month may not be the row Health holds today. This is one more reason to keep a dated copy of any export you rely on. Apple's pages do not say how often sources use these keys, so read them as a possibility, not a pattern.

## Custom keys

Apple's metadata page says the predefined keys help share data between apps, and that you are also encouraged to create your own custom keys to extend what a HealthKit object can carry. Apple's pages do not state a naming convention or a size limit for custom keys.

When you meet a key you don't recognize, read it as one app's private note. Its meaning belongs to the app that wrote it, and you would need that app's own documentation to interpret it. The same logic applies to your own log: a few well-chosen fields help, and [which custom fields are worth attaching](/blog/log-entry-metadata-what-to-attach) is worth deciding before you start, not after.

## What to record

Metadata describes the entry, not the substance or the outcome. A short, practical way to use it:

1. Note whether an entry was typed in or measured, when the key is present, and leave the field blank when it is not.
2. Keep the source name next to the entry, since the metadata can be empty.
3. Keep a dated copy of any export, because a higher sync version can replace an entry.
4. Do not infer anything from a missing key. Missing means unrecorded, not false.

A tracker such as OptimizedTracker keeps its own fields beside whatever Apple Health supplies, so the two sources stay distinguishable in one timeline. Either way, the aim is the same: a record where every row says where it came from.
