<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Contacts",
  "identifier" : "/documentation/Contacts/CNSaveRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Contacts"
    ],
    "preciseIdentifier" : "c:objc(cs)CNSaveRequest"
  },
  "title" : "CNSaveRequest"
}
-->

# CNSaveRequest

An object that collects the changes you want to save to the user’s contacts database.

```
class CNSaveRequest
```

## Overview

Create a new `CNSaveRequest` object for each save operation you want to make. You can batch multiple changes into one save request (note that these changes only apply to objects). In the case of overlapping changes in multiple or concurrent save requests, the last change wins.

If you try to add an object (that is, a contact or a group) that already exists in the contact store, you receive the [`CNError.Code.insertedRecordAlreadyExists`](/documentation/Contacts/CNError/Code/insertedRecordAlreadyExists) error and the [`CNErrorUserInfoAffectedRecordsKey`](/documentation/Contacts/CNErrorUserInfoAffectedRecordsKey) array is updated to contain the object you tried to add. If you try to update or delete an object that is not present in the contact store, the save request does not perform the update or deletion, the [`CNError.Code.recordDoesNotExist`](/documentation/Contacts/CNError/Code/recordDoesNotExist) error occurs, and the [`CNErrorUserInfoAffectedRecordsKey`](/documentation/Contacts/CNErrorUserInfoAffectedRecordsKey) array is updated to contain the object you tried to update or delete. Do not access objects in the save request while that request is executing.

## Topics

### Saving contact changes

[`-  addContact:toContainerWithIdentifier:`](/documentation/Contacts/CNSaveRequest/add(_:toContainerWithIdentifier:)-7eut4)

Adds the specified contact to the contact store.

[`-  updateContact:`](/documentation/Contacts/CNSaveRequest/update(_:)-3gaig)

Updates an existing contact in the contact store.

[`-  deleteContact:`](/documentation/Contacts/CNSaveRequest/delete(_:)-8m1tc)

Deletes a contact from the contact store.

### Saving group changes

[`-  addGroup:toContainerWithIdentifier:`](/documentation/Contacts/CNSaveRequest/add(_:toContainerWithIdentifier:)-4ikaa)

Adds a group to the contact store.

[`-  updateGroup:`](/documentation/Contacts/CNSaveRequest/update(_:)-8h6f6)

Updates an existing group in the contact store.

[`-  deleteGroup:`](/documentation/Contacts/CNSaveRequest/delete(_:)-29lsm)

Deletes a group from the contact store.

[`-  addMember:toGroup:`](/documentation/Contacts/CNSaveRequest/addMember(_:to:))

Adds a contact as a member of a group.

[`-  removeMember:fromGroup:`](/documentation/Contacts/CNSaveRequest/removeMember(_:from:))

Removes a contact as a member of a group.

### Adding and removing subgroups

[`-  addSubgroup:toGroup:`](/documentation/Contacts/CNSaveRequest/addSubgroup(_:to:))

Add the specified group to a parent group.

[`-  removeSubgroup:fromGroup:`](/documentation/Contacts/CNSaveRequest/removeSubgroup(_:from:))

Remove a subgroup from the specified parent group.

### Configuring the save request

[`shouldRefetchContacts`](/documentation/Contacts/CNSaveRequest/shouldRefetchContacts)

A Boolean value that indicates whether to refetch the added and updated contacts after the save request executes.

[`transactionAuthor`](/documentation/Contacts/CNSaveRequest/transactionAuthor)

A string that identifies the author of the transaction.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)