API reference
Links
A link is a short URL on smartlink.sh/l/…, or on a connected custom domain, that sends phone visitors to the right app and desktop visitors to the website. Sign-in stays on smartlink.sh.
The link object
{
"id": "cm1x2y3z4000008l1abcd1234",
"shortCode": "launch",
"shortUrl": "https://smartlink.sh/l/launch",
"originalUrl": "https://www.tiktok.com/@brand/video/7300000000000000000",
"platform": "TIKTOK",
"title": "Launch video",
"description": null,
"ogImage": "https://p16-sign.tiktokcdn.com/…",
"iosUrl": null,
"androidUrl": null,
"isActive": true,
"isPasswordProtected": false,
"expiresAt": null,
"clickCount": 128,
"source": "API",
"createdAt": "2026-09-29T12:00:00.000Z",
"updatedAt": "2026-09-29T12:00:00.000Z"
}platform is detected from originalUrl and controls how the link opens on phones. The possible values are YOUTUBE, INSTAGRAM, TWITTER, FACEBOOK, LINKEDIN, REDDIT, TIKTOK, SPOTIFY, AMAZON, APPSTORE, PLAYSTORE, OTHER. See how app opening works for each device.
clickCount counts every recorded request, including bots. The analytics endpoints exclude bots. Passwords are never returned; isPasswordProtected tells you whether one is set.
Create a link
POST/api/v1/links
| Name | Type | Description |
|---|---|---|
| originalUrlrequired | string | The destination, http or https, up to 2048 characters. |
| customCode | string | Your own short code: 3-32 letters, numbers, "-" or "_". Some words (like api, docs) are reserved. Returns 409 if taken. Omit it to get a random 6-character code. |
| title | string | Display title, 1-200 characters. Defaults to the page title, which is fetched shortly after creation. |
| iosUrl | string | For app links: the App Store URL for iPhone visitors. |
| androidUrl | string | For app links: the Google Play URL for Android visitors. |
| password | string | Visitors must enter this password (4-64 characters) before the link opens. |
| expiresAt | string (ISO 8601) | After this time the link shows an expired page. Must be in the future. |
curl https://smartlink.sh/api/v1/links \
-H "Authorization: Bearer $SMARTLINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"originalUrl": "https://www.tiktok.com/@brand/video/7300000000000000000",
"customCode": "launch",
"title": "Launch video"
}'Returns 201 with the link object. To route an app to the correct store on each phone, send both store URLs:
curl https://smartlink.sh/api/v1/links \
-H "Authorization: Bearer $SMARTLINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"originalUrl": "https://apps.apple.com/app/id1234567890",
"iosUrl": "https://apps.apple.com/app/id1234567890",
"androidUrl": "https://play.google.com/store/apps/details?id=com.example.app"
}'List links
GET/api/v1/links
| Name | Type | Description |
|---|---|---|
| page | integer | Page number, starting at 1. |
| limit | integer | Page size, 1-100. Default 20. |
| search | string | Case-insensitive match on destination, title, or short code. |
| shortCode | string | Exact short code. |
| platform | string | One of the platform values above. |
| isActive | boolean | true for active links, false for deactivated ones. |
curl "https://smartlink.sh/api/v1/links?search=launch&platform=TIKTOK&limit=50" \
-H "Authorization: Bearer $SMARTLINK_API_KEY"Returns { "data": [link, …], "pagination": { … } }, newest first.
Get a link
GET/api/v1/links/{id}
curl https://smartlink.sh/api/v1/links/cm1x2y3z4000008l1abcd1234 \
-H "Authorization: Bearer $SMARTLINK_API_KEY"
# Or look a link up by short code
curl "https://smartlink.sh/api/v1/links?shortCode=launch" \
-H "Authorization: Bearer $SMARTLINK_API_KEY"Update a link
PATCH/api/v1/links/{id}
Send any subset of these fields. The destination URL and short code can’t be changed.
| Name | Type | Description |
|---|---|---|
| title | string | 1-200 characters. |
| isActive | boolean | false pauses the link: it stops redirecting but keeps its analytics. |
| expiresAt | string | null | A new expiry, or null to remove it. |
| password | string | null | A new password, or null to remove protection. |
curl -X PATCH https://smartlink.sh/api/v1/links/cm1x2y3z4000008l1abcd1234 \
-H "Authorization: Bearer $SMARTLINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "isActive": false, "expiresAt": null }'Delete a link
DELETE/api/v1/links/{id}
Permanently deletes the link and its click history, and the short URL stops working. To pause a link instead, set isActive to false.
curl -X DELETE https://smartlink.sh/api/v1/links/cm1x2y3z4000008l1abcd1234 \
-H "Authorization: Bearer $SMARTLINK_API_KEY"