<!--
{
  "availability" : [
    "iOS: 12.0.0 - 17.0.0",
    "iPadOS: 12.0.0 - 17.0.0",
    "macCatalyst: 13.1.0 - 17.0.0",
    "macOS: 11.0.0 - 14.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASCredentialIdentityStore/saveCredentialIdentities(_:completion:)-5vs4m",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "c:objc(cs)ASCredentialIdentityStore(im)saveCredentialIdentities:completion:"
  },
  "title" : "saveCredentialIdentities(_:completion:)"
}
-->

# saveCredentialIdentities(_:completion:)

Saves the given credential identities to the store.

```
func saveCredentialIdentities(_ credentialIdentities: [ASPasswordCredentialIdentity], completion: (@Sendable (Bool, (any Error)?) -> Void)? = nil)
```

## Parameters

`credentialIdentities`

An array of [`ASPasswordCredentialIdentity`](/documentation/AuthenticationServices/ASPasswordCredentialIdentity) objects to save to the store.

`completion`

An optional completion handler to be called after adding the credential identities. If the operation fails, an error with domain [`ASCredentialIdentityStoreErrorDomain`](/documentation/AuthenticationServices/ASCredentialIdentityStoreErrorDomain) will be provided and none of the objects in credentialIdentities are saved to the store.

## Discussion

If the store supports incremental updates, call this method to add new credential identities since the last time the store was updated. Otherwise, call this method to pass all credential identities. If some credential identities in `credentialIdentities` already exist in the store, they will be replaced by those from `credentialIdentities`.

---

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)