---
title: AppEntity
framework: appintents
role: symbol
role_heading: Protocol
path: appintents/appentity
---

# AppEntity

An interface for making a custom type or app-specific concept discoverable by Apple Intelligence and experiences like Siri or the Shortcuts app.

## Declaration

```swift
protocol AppEntity : AppValue, DisplayRepresentable, Identifiable where Self == Self.ValueType, Self.ID : EntityIdentifierConvertible, Self.ID : Sendable
```

## Mentioned in

Defining app entities for your custom data types Making app entities available in Spotlight Adding parameters to an app intent Responding to the Action button on Apple Watch Ultra Getting started with the App Intents framework Providing contextual cues to Apple Intelligence and Siri

## Overview

Overview To use a data model object to app intents, update it to conform to the AppEntity protocol. Declare properties using the @Property property wrapper to make them visible to the system. The following example from the Accelerating app interactions with App Intents sample app shows a data model for a trail: struct TrailEntity: AppEntity {     // Provide the system with the interface required to query `TrailEntity` structures.     static let defaultQuery = TrailEntityQuery()

// The system requires the `AppEntity` identifier to be unique and persistant because the system may save it in a shortcut.     var id: Trail.ID

@Property var name: String

@Property(title: "Region")     var regionDescription: String

@Property var trailLength: Measurement<UnitLength>

var imageName: String

var currentConditions: String

/**     Information on how to display the entity to people — for example, a string like the trail name. Include the optional subtitle     and image for a visually rich display.     */     var displayRepresentation: DisplayRepresentation {         DisplayRepresentation(title: "\(name)",                               subtitle: "\(regionDescription)",                               image: DisplayRepresentation.Image(named: imageName))     }

init(trail: Trail) {         self.id = trail.id         self.imageName = trail.featuredImage         self.currentConditions = trail.currentConditions         self.name = trail.name         self.regionDescription = trail.regionDescription         self.trailLength = trail.trailLength     } }

extension TrailEntity: URLRepresentableEntity {     static var urlRepresentation: URLRepresentation {         // Use string interpolation to fill values from your entity necessary for constructing the universal link URL.         // This example URL uses the unique and persistant identifier for the `TrailEntity` in the URL.         "https://example.com/trail/\(.id)/details"     } } For additional property types, see EntityProperty. It is up to you whether you want to conform to the AppEntity protocol directly on the data models of your app, or if you create data models specific to your app intents implementation. In many cases, it’s a good idea to create models specific to app intents that shadow your app data models to keep entities separate from the rest of your app’s logic.

## Topics

### Specifying properties

- [AppEntity.Property](appintents/appentity/property.md)

### Making the entity queryable

- [defaultQuery](appintents/appentity/defaultquery-4khg7.md)
- [DefaultQuery](appintents/appentity/defaultquery-swift.associatedtype.md)
- [defaultResolverSpecification](appintents/appentity/defaultresolverspecification-2dpf2.md)
- [defaultResolverSpecification](appintents/appentity/defaultresolverspecification-589eq.md)

### URL representation

- [EntityURLRepresentation](appintents/entityurlrepresentation.md)

### Ownership and sharing

- [EntityOwnership](appintents/entityownership.md)

### Type Aliases

- [AppEntity.ValueRepresentation](appintents/appentity/valuerepresentation.md)

### Default Implementations

- [Identifiable Implementations](appintents/appentity/identifiable-implementations.md)

## Relationships

### Inherits From

- [AppValue](appintents/appvalue.md)
- [CustomLocalizedStringResourceConvertible](foundation/customlocalizedstringresourceconvertible.md)
- [DisplayRepresentable](appintents/displayrepresentable.md)
- [Identifiable](swift/identifiable.md)
- [InstanceDisplayRepresentable](appintents/instancedisplayrepresentable.md)
- [PersistentlyIdentifiable](appintents/persistentlyidentifiable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [TypeDisplayRepresentable](appintents/typedisplayrepresentable.md)

### Inherited By

- [AssistantEntity](appintents/assistantentity.md)
- [AssistantSchemaEntity](appintents/assistantschemaentity.md)
- [FileEntity](appintents/fileentity.md)
- [IndexedEntity](appintents/indexedentity.md)
- [OwnershipProvidingEntity](appintents/ownershipprovidingentity.md)
- [SyncableEntity](appintents/syncableentity.md)
- [TransientAppEntity](appintents/transientappentity.md)
- [URLRepresentableEntity](appintents/urlrepresentableentity.md)
- [UniqueAppEntity](appintents/uniqueappentity.md)

## See Also

### App entity types

- [FileEntity](appintents/fileentity.md)
- [IndexedEntity](appintents/indexedentity.md)
- [SyncableEntity](appintents/syncableentity.md)
- [TransientAppEntity](appintents/transientappentity.md)
- [UniqueAppEntity](appintents/uniqueappentity.md)
- [OwnershipProvidingEntity](appintents/ownershipprovidingentity.md)
- [UnionValue()](appintents/unionvalue().md)
- [AppUnionValue](appintents/appunionvalue.md)
- [AppUnionValueCasesProviding](appintents/appunionvaluecasesproviding.md)
