Magic Link
Let your agent share a URL for users to authenticate — no frontend component needed.
Instead of embedding the Link component in a frontend, your agent can get a URL back that it shares directly with users. The user opens it in a browser, authenticates, and closes the tab.
No changes are needed on your end to start using this — the magic link URL is returned automatically.
Link token API
When you call POST /registered-users/{id}/link-token, the response now includes a magic_link_url field:
Your agent can send that URL to the user however it likes — in a chat message, email, or in-app notification. The user clicks it, connects their account, and clicks “Done” to close the tab.
The link_token field still works exactly as before if you want to embed the Link component yourself.
Authenticate tools (MCP / agent tool calls)
When your agent calls an authenticate_* tool, the result payload now includes a message and magic link URL:
Callback URLs
You can automatically redirect users back to your application after they complete authentication via a Magic Link. This is especially useful for mobile deep linking and desktop apps.
1. Register allowed origins
Before using callback URLs, register the allowed origins for your organization in the Merge dashboard under Settings → API keys → Allowed callback origins.
An origin is the scheme and host of your callback URL. Valid origins include:
2. Append the callback URL
Add a callback_url query parameter to the Magic Link URL:
The origin of the callback_url (e.g. https://myapp.com) must match one of the origins you registered. If it doesn’t match, the redirect is silently skipped.
3. Handle the redirect
After the user completes (or exits) the authentication flow, they are redirected to your callback URL with a status query parameter:
For example:
Mobile deep link example
Register your app’s custom URL scheme as an allowed origin (myapp://), then pass a deep link as the callback URL:
After authentication, the browser redirects to myapp:///integrations/complete?status=success, which opens your native app via its registered URL scheme.