Lenklyst Documentation
API Specification

Developer API Reference

Integrate Lenklyst branding controls and referral metrics programmatically. Our endpoints accept JSON payloads and authenticate using standard Bearer keys.


1. Authentication

Retrieve your API tokens in the developer dashboard under **Settings** > **Developer Keys**. All requests must include the token in the headers as authorization:

Authorization: Bearer <YOUR_API_KEY>

2. Shorten URL (Smart Link)

POST/api/external/v1/links

Create custom branded URLs programmatically. You can supply deep links for mobile redirecting, passwords for gates, and customize path aliases.

curl -X POST https://lenklyst.com/api/external/v1/links \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://mybrand.com/promo-item",
    "slug": "blackfriday26",
    "password": "secretPassword",
    "iosDeepLink": "mybrand://promo/item",
    "androidDeepLink": "mybrand://promo/item"
  }'

Response Example (200 OK)

{
  "success": true,
  "shortUrl": "https://lenklyst.com/r/blackfriday26",
  "slug": "blackfriday26",
  "destinationUrl": "https://mybrand.com/promo-item"
}

3. Referral Conversion Event

POST/api/external/v1/referrals/convert

Submit conversions generated through referral campaigns. This rewards point values to advocates and fires webhooks.

curl -X POST https://lenklyst.com/api/external/v1/referrals/convert \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "referralCode": "alex",
    "event": "purchase",
    "value": 49.00,
    "currency": "USD"
  }'

Response Example (200 OK)

{
  "success": true,
  "pointsAwarded": 10,
  "advocate": "alex",
  "referralCode": "alex"
}

Error Responses

Status CodeError MessageResolution
401 UnauthorizedInvalid token or header structureSupply bearer authentication keys retrieved in developer settings.
409 ConflictAlias slug already in useSupply a unique alias or slug, or let the ecosystem auto-generate one.
429 Rate LimitedDaily rate limit threshold reachedUpgrade your subscription tier to increase daily program requests.

Webhooks are fired instantly following program creations. Set up target webhooks inside the **Dashboard Integrations** tab.