<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/SyncableEntity",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents14SyncableEntityP"
  },
  "title" : "SyncableEntity"
}
-->

# SyncableEntity

An interface that indicates your entity has an identifier that’s consistent across devices.

```
protocol SyncableEntity : AppEntity
```

## Overview

Adopt the `SyncableEntity` protocol in your entity types when they have an identifier that’s the same across devices. The presence of this
protocol tells the system that it can refer to your entity consistently across devices. For eample, Siri uses this capability to transfer a conversation
from one device to another.

If you configure entities with an identifier that’s already consistent across devices, you can adopt this protocol without any additional changes.
For example, if you initialize entities with a UUID you retrieve from your server, you can use that value for the identifier and not make any
additional changes to your type. The following example shows an app entity type that adopts `SyncableEntity` and uses a
server-based UUID.

```swift
struct Article: AppEntity, SyncableEntity {
    var id: UUID  // No changes needed!
    var title: String
}
```

If your entity maintains different local and stable identifiers, adopt this protocol and set the type of your identifier to [`SyncableEntityIdentifier`](/documentation/AppIntents/SyncableEntityIdentifier).
When creating an entity, initialize its `id` property with both the local and stable identifier values for your type, as shown in the following example.
When you need to refer to an entity in your code, use the local identifier.

```swift
struct Photo: AppEntity, SyncableEntity {
    var id: SyncableEntityIdentifier<String, String>
    var creationDate: Date

    init(localID: String, stableID: String, creationDate: Date) {
        self.id = SyncableEntityIdentifier(local: localID, stable: stableID)
        self.creationDate = creationDate
    }
}
```

---

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)