---
title: "confirm(intent:completion:)"
framework: intents
role: symbol
role_heading: Instance Method
path: "intents/insearchformessagesintenthandling/confirm(intent:completion:)"
---

# confirm(intent:completion:)

Confirms whether you can perform the search.

## Declaration

```swift
optional func confirm(intent: INSearchForMessagesIntent, completion: @escaping @Sendable (INSearchForMessagesIntentResponse) -> Void)
```

```swift
optional func confirm(intent: INSearchForMessagesIntent) async -> INSearchForMessagesIntentResponse
```

## Parameters

- `intent`: The intent object that contains details about the user’s request. The information in this object has already been resolved by your handler object.
- `completion`: The handler block to execute with your response. You must execute this handler while implementing this method. This handler has no return value and takes the following parameter:

## Discussion

Discussion This method validates you can perform the search using the given parameters. If the search involves contacting a remote server, you should also validate that the server is available. At some point in your implementation, execute the provided completion block with a response object indicating your app’s readiness to perform the search.
