<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKDocumentSample",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKDocumentSample"
  },
  "title" : "HKDocumentSample"
}
-->

# HKDocumentSample

An abstract class that represents a health document in the HealthKit store.

```
class HKDocumentSample
```

## Overview

You should never instantiate an `HKDocumentSample` object directly. Instead, you always work with a concrete subclass. In iOS 10 and watchOS 3, the only concrete class is the [`HKCDADocumentSample`](/documentation/HealthKit/HKCDADocumentSample) class.

Document samples are immutable: You set the sample’s properties when you create it, and they cannot change.

### Extend Document Samples

Like many HealthKit classes, you should not create any custom subclasses of the `HKDocumentSample` class. You can extend the `HKDocumentSample` class and its subclasses by adding custom metadata keys and values to the metadata dictionary when the object is instantiated.

## Topics

### Accessing the Document Sample Properties

[`documentType`](/documentation/HealthKit/HKDocumentSample/documentType)

The type of document represented by the sample.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)