<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "swift: 4.2.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKDatabase/delete(withSubscriptionID:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:So10CKDatabaseC8CloudKitE6delete18withSubscriptionID17completionHandlerySS_ySSSg_s5Error_pSgtctF"
  },
  "title" : "delete(withSubscriptionID:completionHandler:)"
}
-->

# delete(withSubscriptionID:completionHandler:)

Deletes a specific subscription and delivers the deleted subscription’s identifier to a completion handler.

```
@preconcurrency func delete(withSubscriptionID subscriptionID: CKSubscription.ID, completionHandler: @escaping @Sendable (String?, (any Error)?) -> Void)
```

## Parameters

`subscriptionID`

The identifier of the subscription to delete.

`completionHandler`

The closure to execute after CloudKit deletes the subscription.

## Discussion

The completion handler takes the following parameters:

- The identifier of the deleted subscription, or `nil` if there’s an error.
- An error if a problem occurs, or `nil` if CloudKit successfully deletes the subscription.

For information on a more convenient way to delete subscriptions, see [`modifySubscriptions(saving:deleting:)`](/documentation/CloudKit/CKDatabase/modifySubscriptions(saving:deleting:)).

---

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)