<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSUserActivityDocumentURLKey",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@NSUserActivityDocumentURLKey"
  },
  "title" : "NSUserActivityDocumentURLKey"
}
-->

# NSUserActivityDocumentURLKey

The key that identifies the document associated with a user activity.

```
let NSUserActivityDocumentURLKey: String
```

## Discussion

You use this key in the <doc://com.apple.documentation/documentation/Foundation/NSUserActivity/userInfo> dictionary of an <doc://com.apple.documentation/documentation/Foundation/NSUserActivity> object. Its value is the URL of the document associated with the user activity.

When the `NSUbiquitousDocumentUserActivityType` key is present in a <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/CFBundleDocumentTypes> entry, AppKit automatically creates an <doc://com.apple.documentation/documentation/Foundation/NSUserActivity> object for documents in iCloud, using the given activity type.

---

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)