<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMAccessorySetupPayload/init(url:ownershipToken:)-32mrj",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMAccessorySetupPayload(im)initWithURL:ownershipToken:"
  },
  "title" : "init(url:ownershipToken:)"
}
-->

# init(url:ownershipToken:)

Creates an accessory setup payload instance that includes an ownership token.

```
init?(url setupPayloadURL: URL, ownershipToken: HMAccessoryOwnershipToken?)
```

## Parameters

`setupPayloadURL`

The payload used to securely authenticate the accessory. This is the same payload you would receive by scanning the accessory’s QR code.

`ownershipToken`

A token that proves ownership of the accessory. You typically negotiate this token with the accessory outside of HomeKit.

## Discussion

For details about the payload’s content, join the [MFi Program](https://developer.apple.com/programs/mfi/).

---

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)