---
title: CNSaveRequest
framework: contacts
role: symbol
role_heading: Class
path: contacts/cnsaverequest
---

# CNSaveRequest

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

## Declaration

```swift
class CNSaveRequest
```

## Overview

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 error and the 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 error occurs, and the 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

- [add(_:toContainerWithIdentifier:)](contacts/cnsaverequest/add(_:tocontainerwithidentifier:)-7eut4.md)
- [update(_:)](contacts/cnsaverequest/update(_:)-3gaig.md)
- [delete(_:)](contacts/cnsaverequest/delete(_:)-8m1tc.md)

### Saving group changes

- [add(_:toContainerWithIdentifier:)](contacts/cnsaverequest/add(_:tocontainerwithidentifier:)-4ikaa.md)
- [update(_:)](contacts/cnsaverequest/update(_:)-8h6f6.md)
- [delete(_:)](contacts/cnsaverequest/delete(_:)-29lsm.md)
- [addMember(_:to:)](contacts/cnsaverequest/addmember(_:to:).md)
- [removeMember(_:from:)](contacts/cnsaverequest/removemember(_:from:).md)

### Adding and removing subgroups

- [addSubgroup(_:to:)](contacts/cnsaverequest/addsubgroup(_:to:).md)
- [removeSubgroup(_:from:)](contacts/cnsaverequest/removesubgroup(_:from:).md)

### Configuring the save request

- [shouldRefetchContacts](contacts/cnsaverequest/shouldrefetchcontacts.md)
- [transactionAuthor](contacts/cnsaverequest/transactionauthor.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Fetch and save requests

- [CNContactFetchRequest](contacts/cncontactfetchrequest.md)
- [CNFetchRequest](contacts/cnfetchrequest.md)
- [CNFetchResult](contacts/cnfetchresult.md)
