<!--
{
  "availability" : [
    "*: -",
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/AssistantSchemas/MailEntity/message",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "App Intents",
      "AppIntents"
    ],
    "preciseIdentifier" : "s:10AppIntents16AssistantSchemasO10MailEntityPAAE7messageQrvp"
  },
  "title" : "message"
}
-->

# message

The app entity describes an email message.

```
var message: some AssistantSchemas.Entity { get }
```

## Overview

Use Swift macros that generate additional properties and add protocol conformance
for your app entity implementation. The following example shows an app entity that conforms to the `.mail.message` schema:

```swift
@AppEntity(schema: .mail.message)
struct MailMessageEntity: AppEntity {
    struct Query: EntityStringQuery {
        func entities(for identifiers: [MailMessageEntity.ID]) async throws -> [MailMessageEntity] { [] }
        func entities(matching string: String) async throws -> [MailMessageEntity] { [] }
    }

    static var defaultQuery = Query()
    var displayRepresentation: DisplayRepresentation { "Mail Message" }

    let id = UUID()

    @Property
    var to: [IntentPerson]

    @Property
    var cc: [IntentPerson]

    @Property
    var bcc: [IntentPerson]

    @Property
    var subject: String?

    @Property
    var body: AttributedString?

    @Property
    var attachments: [IntentFile]

    @Property
    var sender: IntentPerson

    @Property
    var dateSent: Date

    @Property
    var dateReceived: Date

    @Property
    var isRead: Bool

    @Property
    var isJunk: Bool

    @Property
    var isFlagged: Bool

    @Property
    var account: MailAccountEntity

    @Property
    var mailbox: MailboxEntity
}
```

For more information about the `.mail` app intent domain,
see [Mail](/documentation/AppIntents/app-schema-domain-mail).
For general information about app intent domains, see [Making actions and content discoverable by Apple Intelligence](/documentation/AppIntents/making-actions-and-content-discoverable-by-apple-intelligence).

---

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)