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

# AppIntent

An interface for providing an app-specific capability that people invoke
from system experiences like Siri and the Shortcuts app.

```
protocol AppIntent : PersistentlyIdentifiable, _SupportsAppDependencies, Sendable
```

## Overview

To expose your app’s functionality to system experiences like Siri or the
Shortcuts app, and to support interactivity in widgets, you need to implement
the `AppIntent` protocol. Use it to provide phrases that can launch
the functionality, describe the needed data for the functionality you make available,
and implement the method that performs the functionality.

The system instantiates an app intent you create parameter-less using the
[`init()`](/documentation/AppIntents/AppIntent/init()) initializer whenever a person invokes it through a system service
like Siri, Shortcuts, and so on. If available, the system sets parameters
based on user input or other available sources. With set parameters, the
system attempts to resolve them in the order of their declaration in the
`AppIntent` body. After it resolves all parameters, the system calls
[`perform()`](/documentation/AppIntents/AppIntent/perform()) to perform the app intent with its
configured parameters. Note that the system retains the app intent and
its output only for the duration of the invocation.

> Related sessions from WWDC22:
> Session 10032: [Dive into App Intents](https://developer.apple.com/videos/play/wwdc2022/10032).

### Implement the AppIntent Protocol

Declare a custom intent type by defining a structure that conforms to the
`AppIntent` protocol:

```
struct OrderSoupIntent: AppIntent {
   static var title = LocalizedStringResource("Order Soup")
   static var description = IntentDescription("Orders a soup from your favorite restaurant.")
}
```

Then, declare the AppIntent’s parameters. When you implement an `AppIntent`
type, parameters must be declared with the `@Parameter` property wrapper.
For more information about declaring parameters, see
[Adding parameters to an app intent](/documentation/AppIntents/Adding-parameters-to-an-app-intent).

```
struct OrderSoupIntent: AppIntent {
   @Parameter(title: "Soup")
   var soup: Soup

   @Parameter(title: "Quantity")
   var quantity: Int?
}
```

Next, implement the required [`perform()`](/documentation/AppIntents/AppIntent/perform())function: Validate
your intent’s parameters, execute the intent, and return an [`IntentResult`](/documentation/AppIntents/IntentResult)
that represents the output of a completed intent; for example, a [`PerformResult`](/documentation/AppIntents/AppIntent/PerformResult).

```
struct OrderSoupIntent: AppIntent {
    @Parameter(title: "Soup")
    var soup: Soup

    @Parameter(title: "Quantity")
    var quantity: Int?

    static var parameterSummary: some ParameterSummary {
        Summary("Order \(\.$soup)") {
            \.$quantity
        }
    }

    func perform() async throws -> some IntentResult {
        guard let quantity = quantity, quantity < 10 else {
            throw $quantity.needsValue
        }
        soup.order(quantity: quantity)
        return .result()
    }
}
```

## Topics

### Creating an app intent

[`init()`](/documentation/AppIntents/AppIntent/init())

Creates an app intent.

### Specifying the authentication policy

[`authenticationPolicy`](/documentation/AppIntents/AppIntent/authenticationPolicy)

A property that defines the authentication policy that indicates
whether this app intent requires the device to be unlocked or otherwise
authenticated.

[`IntentAuthenticationPolicy`](/documentation/AppIntents/IntentAuthenticationPolicy)

An enumeration that describes the authentication policy to use when running an app intent.

### Configuring the metadata

[`title`](/documentation/AppIntents/AppIntent/title)

A short, localized, human-readable string that describes the app intent
using a verb and a noun in title case.

[`description`](/documentation/AppIntents/AppIntent/description)

A description of the app intent that the system shows to people.

[`openAppWhenRun`](/documentation/AppIntents/AppIntent/openAppWhenRun)

A boolean property that tells the system to consider the app intent even
if its app is not in the foreground.

[`isDiscoverable`](/documentation/AppIntents/AppIntent/isDiscoverable)

A boolean value that determines whether system features such as Shortcuts
and Spotlight can discover this app intent.

### Performing the action

[`perform()`](/documentation/AppIntents/AppIntent/perform())

Performs the intent after resolving the provided parameters.

[`systemContext`](/documentation/AppIntents/AppIntent/systemContext)

Context information that’s available while the system performs the app intent’s action.

[`PerformResult`](/documentation/AppIntents/AppIntent/PerformResult)

### Requesting confirmation

[`requestConfirmation()`](/documentation/AppIntents/AppIntent/requestConfirmation())

Requests user confirmation before performing the app intent.

[`requestConfirmation(conditions:actionName:dialog:)`](/documentation/AppIntents/AppIntent/requestConfirmation(conditions:actionName:dialog:))

Requests user confirmation before performing the app intent.

[`requestConfirmation(conditions:actionName:dialog:showDialogAsPrompt:content:)`](/documentation/AppIntents/AppIntent/requestConfirmation(conditions:actionName:dialog:showDialogAsPrompt:content:))

Request user confirmation before performing the app intent.

[`requestConfirmation(result:confirmationActionName:showPrompt:)`](/documentation/AppIntents/AppIntent/requestConfirmation(result:confirmationActionName:showPrompt:))

Requests user confirmation before performing the app intent.

[`requestConfirmation(output:confirmationActionName:showPrompt:)`](/documentation/AppIntents/AppIntent/requestConfirmation(output:confirmationActionName:showPrompt:))

### Donating the intent to the system

[`donate()`](/documentation/AppIntents/AppIntent/donate()-1e60c)

Donates the intent to the transcript.

[`donate()`](/documentation/AppIntents/AppIntent/donate()-jp6k)

Donates the intent to the transcript.

[`donate(result:)`](/documentation/AppIntents/AppIntent/donate(result:)-36cia)

Donates the intent and optional result to the transcript.

[`donate(result:)`](/documentation/AppIntents/AppIntent/donate(result:)-9b25i)

Donates the intent and optional result to the transcript.

[`callAsFunction(donate:)`](/documentation/AppIntents/AppIntent/callAsFunction(donate:)-3qvbt)

[`callAsFunction(donate:)`](/documentation/AppIntents/AppIntent/callAsFunction(donate:)-7v1om)

### Summarizing the parameters

[`SummaryContent`](/documentation/AppIntents/AppIntent/SummaryContent)

The type of parameter summary representing this intent.

[`parameterSummary`](/documentation/AppIntents/AppIntent/parameterSummary)

Defines the summary of this intent in relation to how its parameters are populated.

[`parameterSummary`](/documentation/AppIntents/AppIntent/parameterSummary-4vgic)

[`ParameterSummaryBuilder`](/documentation/AppIntents/ParameterSummaryBuilder)

A result builder that allows you to declaratively describe a parameter summary.

[`AppIntent.Parameter`](/documentation/AppIntents/AppIntent/Parameter)

[`AppIntent.Case`](/documentation/AppIntents/AppIntent/Case)

[`AppIntent.DefaultCase`](/documentation/AppIntents/AppIntent/DefaultCase)

[`AppIntent.Summary`](/documentation/AppIntents/AppIntent/Summary)

[`AppIntent.Switch`](/documentation/AppIntents/AppIntent/Switch)

[`AppIntent.When`](/documentation/AppIntents/AppIntent/When)

### URL representation

[`IntentURLRepresentation`](/documentation/AppIntents/IntentURLRepresentation)

The URL representation of an app intent.



---

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)
