> For the complete documentation index, see [llms.txt](https://docs.criticalmoments.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.criticalmoments.io/actions-in-app-messaging/open-link.md).

# Open Link

`link` actions open a variety of links. This includes:&#x20;

* Web links (http/https) in Safari, or an in-app browser
* Deep links into [parts of you app, or triggering native code](/actions-in-app-messaging/custom-actions.md)
* System links, like linking to settings with `app-settings:`&#x20;
* Deep linking into other apps, like `spotify:album:4oktVvRuO1In9B7Hz0xm0a`&#x20;

<figure><img src="/files/kCILpelH6Vh94MiqtDMb" alt="" width="160"><figcaption><p>Opening a link in the in-app browser and Safari</p></figcaption></figure>

### Link Action Config

Links have the actionType `link` and an actionData object with the following keys:

* `url` \[string, required]: the URL to open
* `useEmbeddedBrowser` \[bool, optional]: If true, will open the link in an in-app browser instead of launching to Safari. Only valid for http/https links.

### Config Examples

```
"web_link_action": {
    "actionType": "link",
    "actionData": {
        "url": "https://criticalmoments.io"
    }
},
"web_link_embedded_action": {
    "actionType": "link",
    "actionData": {
        "url": "https://criticalmoments.io",
        "useEmbeddedBrowser": true
    }
},
"settings_link_action": {
    "actionType": "link",
    "actionData": {
        "url": "app-settings:"
    }
},
"main_screen_deeplink_action": {
    "actionType": "link",
    "actionData": {
        "url": "critical-moments-sampleapp:main"
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/open-link.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.
