<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKError/errorAuthorizationDenied",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "s:SC11HKErrorCodeLeV24errorAuthorizationDeniedSoAAVvpZ"
  },
  "title" : "errorAuthorizationDenied"
}
-->

# errorAuthorizationDenied

The user hasn’t given the app permission to save data.

```
static var errorAuthorizationDenied: HKError.Code { get }
```

## Discussion

This error occurs only when your app attempts to save data. If your app isn’t authorized to query data, it receives only the data that the app has saved into HealthKit. For more information, see <doc://com.apple.healthkit/documentation/HealthKit/setting-up-healthkit>.

---

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)