---
title: errorAuthorizationDenied
framework: healthkit
role: symbol
role_heading: Type Property
path: healthkit/hkerror/errorauthorizationdenied
---

# errorAuthorizationDenied

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

## Declaration

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

## Discussion

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 Setting up HealthKit.

## See Also

### Accessing errors

- [HKError.Code](healthkit/hkerror/code.md)
- [noError](healthkit/hkerror/noerror.md)
- [errorHealthDataUnavailable](healthkit/hkerror/errorhealthdataunavailable.md)
- [errorHealthDataRestricted](healthkit/hkerror/errorhealthdatarestricted.md)
- [errorInvalidArgument](healthkit/hkerror/errorinvalidargument.md)
- [errorAuthorizationNotDetermined](healthkit/hkerror/errorauthorizationnotdetermined.md)
- [errorRequiredAuthorizationDenied](healthkit/hkerror/errorrequiredauthorizationdenied.md)
- [errorDatabaseInaccessible](healthkit/hkerror/errordatabaseinaccessible.md)
- [errorUserCanceled](healthkit/hkerror/errorusercanceled.md)
- [errorAnotherWorkoutSessionStarted](healthkit/hkerror/erroranotherworkoutsessionstarted.md)
- [errorUserExitedWorkoutSession](healthkit/hkerror/erroruserexitedworkoutsession.md)
- [errorNoData](healthkit/hkerror/errornodata.md)
