Skip to main content
POST
/
partner
/
links
Create a magic link
curl --request POST \
  --url https://m2m-backend-qa.up.railway.app/partner/links \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "referenceId": "user-12345",
  "expiresInMinutes": 120,
  "metadata": {
    "orderId": "ORD-2026-001",
    "campaign": "february-promo"
  },
  "flow": "m2m-basic",
  "theme": "dark",
  "language": "es",
  "callbackUrl": "https://api.example.com/callbacks/m2m"
}
'
{
  "success": true,
  "data": {
    "linkId": "link_acme_a1b2c3d4e5f6",
    "referenceId": "user-12345",
    "status": "created",
    "url": "https://widget.m2m.leapfinancial.com/link_acme_a1b2c3d4e5f6/m2m-basic",
    "token": "550e8400-e29b-41d4-a716-446655440000",
    "expiresAt": "2026-02-11T12:00:00.000Z",
    "createdAt": "2026-02-10T12:00:00.000Z"
  }
}

Authorizations

X-API-Key
string
header
required

Your partner API key. Use m2m_test_* keys for the sandbox environment.

Body

application/json
referenceId
string
required

Your unique identifier for the end user in your system. Used to correlate M2M users with your records and to detect returning users.

Example:

"user-12345"

expiresInMinutes
number
default:60

Link time-to-live in minutes. The link becomes inaccessible after expiration. Minimum: 5 minutes. Maximum: 10,080 minutes (7 days). Defaults to the partner-level configuration (usually 60 minutes).

Required range: 5 <= x <= 10080
Example:

120

userData
object

Pre-filled user data. Any fields provided here will be pre-populated in the widget, allowing the user to skip those steps.

metadata
object

Arbitrary key-value metadata to attach to the link. Useful for storing internal references, campaign IDs, etc. Returned in link detail and webhook payloads.

Example:
{
"orderId": "ORD-2026-001",
"campaign": "february-promo"
}
flow
string
default:m2m-basic

Widget flow type that determines the user experience. Defaults to "m2m-basic" if not specified.

Example:

"m2m-basic"

theme
string

Theme identifier to customize the widget appearance. Overrides the partner-level theme configuration for this link.

Example:

"dark"

language
enum<string>

Language code for the widget UI (ISO 639-1). Overrides browser detection.

Available options:
en,
es
Example:

"es"

callbackUrl
string

URL to receive callback notifications for this specific link. Overrides the partner-level webhook URL for link-specific events.

Example:

"https://api.example.com/callbacks/m2m"

Response

Magic link created successfully

success
boolean
required
Example:

true

data
object
required