---
title: HMAddAccessoryRequest
framework: homekit
role: symbol
role_heading: Class
path: homekit/hmaddaccessoryrequest
---

# HMAddAccessoryRequest

A request to add an accessory to a particular home.

## Declaration

```swift
class HMAddAccessoryRequest
```

## Overview

Overview An HMAddAccessoryRequest instance describes an accessory that your app should add to a home. HomeKit calls your home manager delegate’s homeManager(_:didReceiveAddAccessoryRequest:) method with a request. Use the request’s accessoryName and accessoryCategory properties to obtain a token by negotiating with the accessory outside of HomeKit. If the requiresSetupPayloadURL property is true, also prepare a setup payload URL. Then create a setup payload with either the makePayload(url:ownershipToken:) or makePayload(ownershipToken:) method. Complete the request by calling the addAndSetupAccessories(with:completionHandler:) method on the request’s home property.

## Topics

### Characterizing the Request

- [home](homekit/hmaddaccessoryrequest/home.md)
- [accessoryCategory](homekit/hmaddaccessoryrequest/accessorycategory.md)
- [accessoryName](homekit/hmaddaccessoryrequest/accessoryname.md)
- [requiresOwnershipToken](homekit/hmaddaccessoryrequest/requiresownershiptoken.md)
- [requiresSetupPayloadURL](homekit/hmaddaccessoryrequest/requiressetuppayloadurl.md)

### Creating a Payload

- [makePayload(ownershipToken:)](homekit/hmaddaccessoryrequest/makepayload(ownershiptoken:).md)
- [makePayload(url:ownershipToken:)](homekit/hmaddaccessoryrequest/makepayload(url:ownershiptoken:).md)

### Initializers

- [init()](homekit/hmaddaccessoryrequest/init().md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Adding accessories

- [homeManager(_:didReceiveAddAccessoryRequest:)](homekit/hmhomemanagerdelegate/homemanager(_:didreceiveaddaccessoryrequest:).md)
