> This page is for Unified.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Magic Link

> How to use Magic Link to send end users a URL to connect their integration, without embedding Merge Link in your frontend.

---

### Overview

Our **Magic Link** allows you to deliver an in-browser Link experience without requiring any frontend code.

The Magic Link experience is sent to your end users via a secure URL.

Benefits:

* **Fast proof of concept of Merge** without making frontend changes to embed Link into your app
* **Your users can authorize integrations** without logging into your app, enabling custom user journeys

---

## Generating Magic Link URL

A Magic Link instance can be generated in two ways:

* **From your Merge dashboard** *(basic)*
* **Programmatically via API** *(advanced)*

### Dashboard

![Merge Link demo in dashboard](/_fern-files/merge-test.docs.buildwithfern.com/edf1ef539bdd280799617f002e66df32f0469a69790918a2cfa8013968bbf20d/docs/assets/images/docs/guides/magic-link/MergeLinkGIF.gif)

You can initialize a Magic Link from the Merge Dashboard in **four easy steps**.

1. Navigate to **Linked Accounts** in the left navigation
2. Under Production Linked Accounts, click the button to **Send Link via URL**
3. Enter your end user's information and the integration categories you want to make available to them
4. Click **Generate URL**

That's it! You will be presented with a unique URL that you can send to your customer.

*The URL will expire within 7 days*

### API

Merge also offers the ability to programmatically generate Magic Link URLs via API.

To do this, make a POST request to the [/link-token](/hris/link-token/) endpoint.

In the body parameters of your POST request, set the `should_create_magic_link_url` parameter to `true`.

> **Note**
>
> In your POST request, we recommend setting the `link_expiry_mins` body parameter to the maximum of `10080` so that the Magic Link URL expires after 7 days. If this parameter is not explicitly set, the generated Magic Link URL will expire 30 minutes after creation.

---

## Accessing Account Tokens for Linked Accounts Created with Magic Link

Once your customer has successfully integrated their third-party platform through Magic Link, you will need the new Linked Account's **account token** to make API requests to Merge on behalf of that Linked Account.

You are able to access the account tokens of Linked Accounts created through Magic Link in one of two ways:

* **From your Merge Dashboard** *(basic)*
* **Programmatically via Merge Webhook** *(advanced)*

### Dashboard

You can access the account token of a Product Linked Account directly in the Merge Dashboard with the following steps.

1. Navigate to **Linked Accounts** in the left navigation
2. Under "Production Linked Accounts", select a Linked Account to go to its overview
3. In the overview screen, the account token is in the **bottom right**

> **Warning**
>
> Account tokens are only visible to users with the **Admin** role.

### Webhook

You can also receive the account token of a new Production Linked Account as soon as a connection is created by setting up a **Linked Account linked** webhook in your [Merge Dashboard](https://app.merge.dev/configuration/webhooks/emitters).

This webhook will notify you in real time when a Production Linked Account is created, indicated by `is_relink` returning `false` and the payload will contain the new Linked Account's account token.

```json
{
  "account_token": "xxxxxxxxxxxxxxxxxxxxx",
  "category": "hris",
  "company": "Test Company",
  "integration": {
    "name": "BambooHR",
    "categories": ["hris"],
    "image": "https://example.com/image.png",
    "square_image": "https://example.com/square_image.png",
    "color": "#5B4FC6",
    "slug": "bamboohr",
    "is_in_beta": false,
    "api_endpoints_to_documentation_urls": {}
  },
  "is_duplicate": false,
  "is_relink": false,
  "end_user_email_address": "user@example.com",
  "end_user_organization_name": "Test Org",
  "end_user_origin_id": "test-user-123"
}
```

To learn more about Merge Webhooks, view our [Webhooks](/merge-unified/reading-data/webhooks/overview) guide.