Create Invite Links from Your Server
Use case: your admin panel invites a user by email. The email contains an Openlynk link. When the recipient taps it, they open your app if it's installed, or go through install + deferred deep linking if it isn't.
You do not need a web SDK for this. Call the same create-link API the mobile SDKs use from your backend.
Prerequisites
- An Openlynk app with store URLs and deep linking configured
- An SDK API Key from the dashboard (app → SDK API Key → Generate)
- A secure place to store the key on your server (env var / secrets manager)
Flow
Admin panel → Your backend → POST /api/links/create-sdk
↓
link.url
↓
Invite email to user
↓
User taps link → open app or download
Create the link
curl -X POST https://openlynk.io/api/links/create-sdk \
-H "Authorization: Bearer $OPENLYNK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destination": "/invite/USER_TOKEN",
"metadata": {
"invite_id": "USER_TOKEN",
"utm_source": "email",
"utm_medium": "invite"
}
}'
Successful response includes link.url — for example https://myapp.openlynk.to/1734567890-a1b2c3d4.
Put that URL in your invite email CTA. You do not need Openlynk to send the email; your admin panel keeps sending mail as it does today.
Example (Node.js)
const res = await fetch('https://openlynk.io/api/links/create-sdk', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.OPENLYNK_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
destination: `/invite/${inviteId}`,
metadata: {
invite_id: inviteId,
utm_source: 'email',
utm_medium: 'invite',
},
}),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error || 'Failed to create link');
const inviteUrl = data.link.url;
// Pass inviteUrl into your email template
Destination path
destination must be a relative path starting with / (the in-app route you want after open/install). Examples:
/invite/abc123/welcome?ref=admin/onboarding/step-1
Do not pass a full https:// URL as destination.
What happens when the user taps the link
| App state | Behavior |
|---|---|
| Installed | App opens and navigates to destination (via Universal Links / App Links + SDK) |
| Not installed | User is sent to the store; after install, deferred deep linking restores destination |
Ensure your mobile app uses the Openlynk SDK so restore and deep-link handling work after install.
Security
- Call this API only from a trusted server, not from a public browser page
- Store
OPENLYNK_API_KEYin environment variables or a secrets manager - Never commit the key or put it in client-side JavaScript
- Rotate the key in the dashboard if it leaks
:::note Same key as the mobile SDK
Today, server and mobile share the same per-app ol_ key. Dedicated server-only keys are planned. Until then, treat the key carefully on both sides.
:::
Rate limits and plan limits
- Rate limit: 10 requests per minute per IP for create-link
- Plan limit: SDK-generated links count toward your plan's generated-link quota (
403when exceeded)
For bulk invites, batch or throttle create calls accordingly.
Related
- REST API reference — full endpoint list
- SDK authentication — generate and rotate keys
- Implement deferred deep linking — post-install restore in the app