---
title: "deleteSubscription(withID:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckdatabase/deletesubscription(withid:)"
---

# deleteSubscription(withID:)

Deletes a specific subscription and returns the deleted subscription’s identifier to an awaiting caller.

## Declaration

```swift
@discardableResult func deleteSubscription(withID subscriptionID: CKSubscription.ID) async throws -> CKSubscription.ID
```

## Parameters

- `subscriptionID`: The identifier of the subscription to delete.

## Return Value

Return Value The identifier of the deleted subscription.

## Discussion

Discussion This method throws an error if the request fails, such as when the network is unavailable or the device doesn’t have an active iCloud account. For information on a more convenient way to delete subscriptions, see modifySubscriptions(saving:deleting:).

## See Also

### Modifying Subscriptions

- [modifySubscriptions(saving:deleting:)](cloudkit/ckdatabase/modifysubscriptions(saving:deleting:).md)
- [modifySubscriptions(saving:deleting:completionHandler:)](cloudkit/ckdatabase/modifysubscriptions(saving:deleting:completionhandler:).md)
- [save(_:completionHandler:)](cloudkit/ckdatabase/save(_:completionhandler:)-9pona.md)
- [delete(withSubscriptionID:completionHandler:)](cloudkit/ckdatabase/delete(withsubscriptionid:completionhandler:).md)
