For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Logo
Resources
Log inGet a demo
Get startedConnectorsAPI reference
Get startedConnectorsAPI reference
  • Agent Handler
      • POSTCreate Link token

Get started

  • Overview
  • Introduction
  • Unified API
  • Linked Account
  • Merge Link
  • Use cases

Implementation

  • Sandboxes
  • SDKs
  • API access
  • Syncing data
  • Writing data
  • Data minimization
  • Supplemental data
  • Errors
  • Integration metadata

API reference

  • ATS
  • HRIS
  • Accounting
  • Ticketing
  • CRM
  • File Storage
  • Knowledge Base
  • Chat

Resources

  • Help Center
  • Merge.dev
  • Changelog
© Merge 2026Terms of usePrivacy policy
UnifiedAgent HandlerGateway
UnifiedAgent HandlerGateway
Resources
Log inGet a demo
Agent HandlerLink token

Create Link token

POST
https://ah-api.merge.dev/api/v1/registered-users/:registered_user_id/link-token/
POST
/api/v1/registered-users/:registered_user_id/link-token/
$curl -X POST https://ah-api.merge.dev/api/v1/registered-users/41f11808-5387-4be5-9af2-852a372d61e3/link-token/ \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "connector": "linear",
> "external_id": "acme-corp",
> "callback_url": "https://your-app.com/auth/callback",
> "state": "random-csrf-token"
>}'
201Request with external_id and callback_url
1{
2 "link_token": "string",
3 "magic_link_url": "string"
4}
Generates a Link Token for a Registered User to authenticate with Connectors. Also returns a magic link URL that can be shared with the user to authenticate in a browser.
Was this page helpful?
Previous

Update Registered User

Next

List Tool Packs

Authentication

AuthorizationBearer

Token-based authentication with required prefix “Bearer”

Path parameters

registered_user_idstringRequiredformat: "uuid"
Agent Handler ID of the Registered User

Request

This endpoint expects an object.
connectorstringRequired
Slug of the connector to generate a link token for
external_idstring or nullOptional
Optional external ID to scope the link token to a specific application credential. Use this when you have multiple OAuth apps for the same connector.
callback_urlstring or nullOptional
Optional URL to redirect the user to after they complete the authentication flow. Must be added to your organization's allowed callback origins first.
statestring or nullOptional

Optional CSRF protection token returned to your callback_url after authentication. Requires callback_url to be set. Do not include a ‘state’ query parameter in callback_url if using this field.

Response

link_tokenstring
magic_link_urlstring
URL that opens a hosted authentication page. Share this with the user so they can connect their account in a browser.