---
title: "sendChanges(_:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/cksyncengine-5sie5/sendchanges(_:)"
---

# sendChanges(_:)

Sends pending local changes to the server.

## Declaration

```swift
final func sendChanges(_ options: CKSyncEngine.SendChangesOptions = .init()) async throws
```

## Parameters

- `options`: The options to use when sending changes. For more information, see doc://com.apple.cloudkit/documentation/CloudKit/CKSyncEngine-5sie5/SendChangesOptions.

## Discussion

Discussion Use this method to request the sync engine sends all pending local changes to the server before your app continues. This isn’t necessary in normal use, as the engine automatically syncs your app’s records. It is useful, however, in scenarios where you require greater control over sync, such as a “Backup now” button or unit tests. note: sendChanges(_:) returns only after your sync delegate finishes processing all related send events. note: An error if the send operation fails. Common errors include network failures, authentication issues, conflicts, or server-side problems.

## See Also

### Invoking manual sync operations

- [fetchChanges(_:)](cloudkit/cksyncengine-5sie5/fetchchanges(_:).md)
- [CKSyncEngine.FetchChangesOptions](cloudkit/cksyncengine-5sie5/fetchchangesoptions.md)
- [CKSyncEngine.SendChangesOptions](cloudkit/cksyncengine-5sie5/sendchangesoptions.md)
