Link types
There are three types of Magic Links: Provider (multiple providers) lets the user connect to any of your enabled providers in one session. Requires provider app info to be registered with Leaf first (same setup as Leaf Link). Authentication (single provider) restricts the flow to one specific provider. Useful when you know which provider the user needs to connect. File Upload lets the user upload.zip files containing machine data for processing.
Creating a Magic Link
Each link type has its own creation endpoint underhttps://api.withleaf.io/services/widgets/api.
With an existing Leaf user
With automatic Leaf user creation
You can also create a Magic Link without specifying aleafUserId. In that flow, Leaf creates or reuses the Leaf user as part of link creation based on the external ID you provide:
Endpoints
| Action | Method | Path |
|---|---|---|
| List provider links | GET | /magic-link/provider |
| Get provider link | GET | /magic-link/provider/{magicLinkId} |
| Create provider link (existing user) | POST | /magic-link/users/{leafUserId}/provider |
| Create provider link (new user) | POST | /magic-link/provider |
| Delete provider link | DELETE | /magic-link/provider/{magicLinkId} |
| List authentication links | GET | /magic-link/authentication |
| Get authentication link | GET | /magic-link/authentication/{magicLinkId} |
| Create authentication link (existing user) | POST | /magic-link/users/{leafUserId}/authentication |
| Create authentication link (new user) | POST | /magic-link/authentication |
| Delete authentication link | DELETE | /magic-link/authentication/{magicLinkId} |
| List file upload links | GET | /magic-link/file-upload |
| Get file upload link | GET | /magic-link/file-upload/{magicLinkId} |
| Create file upload link (existing user) | POST | /magic-link/users/{leafUserId}/file-upload |
| Create file upload link (new user) | POST | /magic-link/file-upload |
| Delete file upload link | DELETE | /magic-link/file-upload/{magicLinkId} |
Customization
All Magic Link creation endpoints accept asettings object for branding:
| Setting | Type | Description |
|---|---|---|
backgroundColor | String | Background color of the link page |
companyLogo | String | URL to your company logo |
companyName | String | Your company name |
headerImage | String | URL for a header image |
showLeafUserName | Boolean | Display the Leaf user name |
disconnectEnabled | Boolean | Allow users to disconnect providers from the link page |
What to do next
- Leaf Link for embedding widgets directly in your application.
- Leaf Connect for sharing data between API owners.
- Magic Link API Reference for full endpoint details.

