# Custom Actions

To create an action which calls into native code, use a `link` action type with a deeplink into your app.&#x20;

An example link to your "edit profile experience could be: `you-app-scheme:profile/photo?mode=edit`. It has the the following components:

* App scheme `you-app-scheme:`: the app scheme you[ setup and define for your app](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app)
* The path `profile/photo`: a specific screen or action in your app you are linking to
* A query string `?mode=edit`: Any serialized data you want to pass through and handle in your code.

To implement you can use [iOS deeplinks](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app), or [universal links](https://developer.apple.com/ios/universal-links/).

To not set `useEmbeddedBrowser` for deeplinks. This option is only supported for http/https links.

### Example Custom Action Config

```json
"edit_profile_photo_deeplink_action": {
    "actionType": "link",
    "actionData": {
        "url": "you-app-scheme:profile/photo?mode=edit"
    }
},
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.criticalmoments.io/actions-in-app-messaging/custom-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
