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 startedAPI referenceImplementation
Get startedAPI referenceImplementation
    • Overview
          • POST/link-token
        • Field Mapping
UnifiedAgent HandlerGateway
UnifiedAgent HandlerGateway
Resources
Log inGet a demo
Linked AccountLink token

/link-token

POST
/hris/v1/link-token
POST
/api/hris/v1/link-token
$curl -X POST https://api.merge.dev/api/hris/v1/link-token \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "end_user_email_address": "example@gmail.com",
> "end_user_organization_name": "Test Organization",
> "end_user_origin_id": "12345",
> "categories": [
> "hris",
> "ats"
> ]
>}'
200Successful
1{
2 "link_token": "necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0",
3 "integration_name": "Lever",
4 "magic_link_url": "https://link.merge.dev/asdfjkl12345jsndfgi2i83n"
5}
Creates a link token to be used when linking a new end user. The link token expires after single use.
Was this page helpful?
Previous

/linked-accounts

Next

Field Mapping

Built with

Authentication

AuthorizationBearer

Token-based authentication with required prefix “Bearer”

Request

This endpoint expects an object.
end_user_email_addressstringRequired1-100 characters

Your end user’s email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

end_user_organization_namestringRequired1-100 characters
Your end user's organization.
end_user_origin_idstringRequired1-100 characters
This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.
categorieslist of enumsRequired
The integration categories to show in Merge Link.
integrationstring or nullOptional>=1 character

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

link_expiry_minsintegerOptional30-10080Defaults to 30

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

should_create_magic_link_urlboolean or nullOptionalDefaults to false

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

hide_admin_magic_linkboolean or nullOptionalDefaults to false

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

common_modelslist of objects or nullOptional

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

category_common_model_scopesmap from strings to lists of objects or nullOptional
When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.
languageenum or nullOptional

The following subset of IETF language tags can be used to configure localization.

  • en - en
  • de - de
Allowed values:
are_syncs_disabledboolean or nullOptionalDefaults to false
The boolean that indicates whether initial, periodic, and force syncs will be disabled.
integration_specific_configmap from strings to any or nullOptional

A JSON object containing integration-specific configuration options.

completed_account_initial_screenenum or nullOptional

When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account.

  • SELECTIVE_SYNC - SELECTIVE_SYNC
Allowed values:
linked_destination_idstring or nullOptionalformat: "uuid"
The UUID of the linked destination that you want this Linked Account to be tied to.
credential_idstring or nullOptionalformat: "uuid"
The id of the credential that you want this Linked Account to be tied to.

Response

link_tokenstring
integration_namestring
magic_link_urlstring