---
title: "updateAuthorizationData(_:completionHandler:)"
framework: homekit
role: symbol
role_heading: Instance Method
path: "homekit/hmcharacteristic/updateauthorizationdata(_:completionhandler:)"
---

# updateAuthorizationData(_:completionHandler:)

Sets or clears authorization data used when writing to the characteristic.

## Declaration

```swift
func updateAuthorizationData(_ data: Data?, completionHandler completion: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func updateAuthorizationData(_ data: Data?) async throws
```

## Parameters

- `data`: New authorization data to use. Pass nil to remove authorization data.
- `completion`: The block executed after the request is processed.

## See Also

### Controlling a characteristic

- [value](homekit/hmcharacteristic/value.md)
- [readValue(completionHandler:)](homekit/hmcharacteristic/readvalue(completionhandler:).md)
- [writeValue(_:completionHandler:)](homekit/hmcharacteristic/writevalue(_:completionhandler:).md)
