Skip to main content

Links

A link is a destination URL with a short code and its settings. These endpoints create, find, change and delete links.

Every link endpoint returns this object. Fields you never set come back as null, false, 0 or [].

FieldTypeDescription
idstringUnique id (UUID). Use it in paths.
codestringThe short code, for example spring-sale.
urlstringThe destination, with any UTM parameters already added.
short_urlstringThe full short link, on lny.me or your custom domain.
custom_aliasstring | nullThe alias you chose, if any.
created_atstringWhen the link was made (ISO 8601).
expires_atstring | nullWhen the link stops redirecting.
activates_atstring | nullWhen the link starts redirecting.
clicksintegerLifetime clicks.
max_clicksinteger | nullClick cap. The link stops after this many clicks.
clicks_remaininginteger | nullClicks left under the cap.
last_click_atstring | nullTime of the latest click.
tagsstring[]Lowercase tags.
campaign_idstring | nullThe campaign this link belongs to.
domain_idstring | nullThe custom domain this link uses.
domain_hoststring | nullThat domain's host, for example go.example.com.
utmobject | nullUTM values: source, medium, campaign, term, content.
previewobject | nullPage metadata LinkLane fetched: title, description, og_image, favicon, fetched_at.
has_passwordbooleantrue if visitors must enter a password. The password itself is never returned.
routingobject | nullSmart routing rule. See Smart routing.
fallback_urlstring | nullWhere to send visitors when the destination is down.
snapshot_urlstring | nullWayback Machine copy used as a last-resort fallback.
snapshot_taken_atstring | nullWhen the snapshot was saved.
og_overridesobject | nullCustom social preview: title, description, image.
geo_blockobject | null{ "mode": "deny" | "allow", "countries": ["US"] }
bot_protectionstring | null"block" or "challenge".
pixelsobject | nullRetargeting pixel ids: facebook, google, pinterest, tiktok.
overlayobject | nullCTA banner shown before the redirect. See CTA overlays.
track_conversionsbooleantrue if LinkLane adds a click id (ll_cid) to the destination.
conversionsintegerConversions recorded for this link.
conversion_valuenumberSum of their values.
public_statsbooleantrue if the public stats page is on.
share_tokenstring | nullToken for the public stats page.
archivedbooleanArchived links still redirect but are hidden from the default list.
favoritebooleanStarred in the app.
owner_idstring | nullThe user who owns the link.
POST/api/links
Auth
API key, session or none · links:write
Plan
All plans

Creates a short link. Only url is required. Every new link counts toward your monthly link limit.

Body parameters​

NameTypeRequiredDescription
urlstringYesThe destination. Must start with http:// or https://.
custom_aliasstringNoYour own code: 3–32 letters, numbers, - or _. Returns 409 if taken. Without it, LinkLane picks a random 7-character code.
domain_idstringNoServe the link on a verified custom domain. Get ids from GET /api/domains.
tagsstring[]NoUp to 10 tags, each 1–32 characters. Stored lowercase; spaces become -.
utmobjectNosource, medium, campaign, term, content. Added to the destination as utm_* parameters.
expires_in_daysintegerNoThe link stops redirecting after this many days.
campaign_idstringNoAdd the link to a campaign. Pro and above.
passwordstringNoVisitors must enter it first. Up to 128 characters. Pro and above.
max_clicksintegerNoStop after this many clicks (1–1,000,000). Pro and above.
activates_atstringNoISO 8601 time when the link starts working. Pro and above.
routingobjectNoSend visitors to different URLs. Pro and above; appstore routing needs Growth. See Smart routing.
fallback_urlstringNoUsed when the destination is down. Pro and above.
geo_blockobjectNomode ("deny" or "allow") and countries (two-letter codes). Pro and above.
bot_protectionstringNo"block" or "challenge". Pro and above.
og_overridesobjectNoSocial preview: title (≤120), description (≤300), image (URL). Pro and above.
track_conversionsbooleanNoAdd a click id so you can record conversions. Pro and above.
pixelsobjectNoPixel ids: facebook, google, pinterest, tiktok. Growth and above.
overlayobjectNoCTA banner: headline, message, button_text, button_url, theme, countdown. Growth and above.

A setting your plan doesn't include returns 402 with the feature name. See Errors.

Example​

curl -X POST https://api.linklane.io/api/links \
-H "Authorization: Bearer $LINKLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://shop.example.com/spring",
"custom_alias": "spring-sale",
"tags": ["email", "q2"],
"utm": { "source": "newsletter", "medium": "email" }
}'
Response · 200 OK (trimmed)
{
"id": "6f1c2b9e-1d4a-4c39-9a51-0c7e8b2d4f10",
"code": "spring-sale",
"url": "https://shop.example.com/spring?utm_source=newsletter&utm_medium=email",
"short_url": "https://lny.me/spring-sale",
"custom_alias": "spring-sale",
"created_at": "2026-11-30T10:02:11.204000+00:00",
"expires_at": null,
"clicks": 0,
"tags": ["email", "q2"],
"utm": { "source": "newsletter", "medium": "email" },
"campaign_id": null,
"has_password": false,
"track_conversions": false,
"archived": false,
"claim_token": null
}
Calls without a key

The landing page can create a link with no auth. Those links have no owner, are limited to 10 an hour per IP, and come back with a one-time claim_token that moves the link into an account at sign-up. With an API key, claim_token is always null.

GET/api/links
Auth
API key or session · links:read
Plan
All plans

Returns links in your workspace, newest first, as a JSON array. Archived links are left out unless you ask for them.

Query parameters​

NameTypeRequiredDescription
qstringNoSearch the short code and the destination URL.
tagstringNoOnly links with this tag.
campaign_idstringNoOnly links in this campaign.
domain_idstringNoOnly links on this custom domain.
statusstringNoactive, expired, archived or all. Default: every link that isn't archived.
favoritebooleanNotrue for starred links only.
sortstringNorecent (default), clicks or alpha.
limitintegerNo1–500. Default 500.
cursorstringNoPaging token from the X-Next-Cursor response header.

Paging​

When more links exist, the response has an X-Next-Cursor header. Send its value as cursor to get the next page. No header means you have them all.

# -i prints the headers, so you can see X-Next-Cursor
curl -i "https://api.linklane.io/api/links?tag=email&sort=clicks&limit=100" \
-H "Authorization: Bearer $LINKLANE_API_KEY"
Response · 200 OK (one item, trimmed)
[
{
"id": "6f1c2b9e-1d4a-4c39-9a51-0c7e8b2d4f10",
"code": "spring-sale",
"short_url": "https://lny.me/spring-sale",
"url": "https://shop.example.com/spring?utm_source=newsletter&utm_medium=email",
"clicks": 1284,
"tags": ["email", "q2"],
"last_click_at": "2026-11-30T09:58:40.117000+00:00"
}
]
GET/api/links/count
Auth
API key or session · links:read
Plan
All plans

Counts links that match a filter. Takes the same filters as List links: q, tag, campaign_id, domain_id, status and favorite.

curl "https://api.linklane.io/api/links/count?status=expired" \
-H "Authorization: Bearer $LINKLANE_API_KEY"
Response · 200 OK
{ "count": 12 }
GET/api/links/{link_id}
Auth
API key or session · links:read
Plan
All plans

Returns one link object. Returns 404 if the link isn't in your workspace.

curl https://api.linklane.io/api/links/6f1c2b9e-1d4a-4c39-9a51-0c7e8b2d4f10 \
-H "Authorization: Bearer $LINKLANE_API_KEY"
PATCH/api/links/{link_id}
Auth
API key or session · links:write
Plan
All plans

Changes only the fields you send. Takes every create parameter except that expires_in_days counts from now. It returns the updated link.

To remove a setting, send its clear flag set to true. Sending null does nothing.

NameTypeRequiredDescription
clear_expirationbooleanNoRemove the expiry.
clear_utmbooleanNoRemove UTM values and strip utm_* from the destination.
clear_campaignbooleanNoTake the link out of its campaign.
clear_passwordbooleanNoRemove the password.
clear_max_clicksbooleanNoRemove the click cap.
clear_activationbooleanNoRemove the start time.
clear_tagsbooleanNoRemove all tags.
clear_routingbooleanNoRemove the routing rule.
clear_fallbackbooleanNoRemove the fallback URL.
clear_og_overridesbooleanNoRemove the custom social preview.
clear_geo_blockbooleanNoRemove geo-blocking.
clear_bot_protectionbooleanNoTurn off bot protection.
clear_pixelsbooleanNoRemove retargeting pixels.
clear_overlaybooleanNoRemove the CTA banner.
public_statsbooleanNoTurn the public stats page on or off. Pro and above.
archivedbooleanNoArchive or unarchive. All plans.
favoritebooleanNoStar or unstar. All plans.

If you change url and send no utm, the link keeps its UTM values on the new destination.

A new alias is a new short link

Changing custom_alias changes the short code. The old short URL stops working, so printed QR codes and shared links that use it break.

curl -X PATCH https://api.linklane.io/api/links/6f1c2b9e-1d4a-4c39-9a51-0c7e8b2d4f10 \
-H "Authorization: Bearer $LINKLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://shop.example.com/summer", "clear_password": true }'
Response · 200 OK (trimmed)
{
"id": "6f1c2b9e-1d4a-4c39-9a51-0c7e8b2d4f10",
"code": "spring-sale",
"url": "https://shop.example.com/summer?utm_source=newsletter&utm_medium=email",
"has_password": false
}
DELETE/api/links/{link_id}
Auth
API key or session · links:write
Plan
All plans

Deletes the link and all of its click events. This can't be undone. To hide a link but keep its data, set archived: true instead.

curl -X DELETE https://api.linklane.io/api/links/6f1c2b9e-1d4a-4c39-9a51-0c7e8b2d4f10 \
-H "Authorization: Bearer $LINKLANE_API_KEY"
Response · 200 OK
{ "ok": true }

The app uses these. They need a dashboard session, not an API key.

POST/api/links/{link_id}/goals
Auth
Dashboard session only
Plan
Pro and above

Adds a click goal: kind (clicks_total or clicks_unique), threshold (1–10,000,000) and an optional notify_email. Up to 5 goals per link. GET on the same path lists them, and DELETE /api/links/{link_id}/goals/{goal_id} removes one.

GET/api/tags
Auth
Dashboard session only
Plan
All plans

Lists your tags with how many links use each: [{ "name": "email", "count": 14 }].

POST/api/links/{link_id}/refresh-preview
Auth
Dashboard session only
Plan
All plans

Fetches the destination's title, description and image again.

POST/api/links/{link_id}/snapshot
Auth
Dashboard session only
Plan
Pro and above

Saves a Wayback Machine copy of the destination. LinkLane serves it if the destination goes down. Returns 502 if the Wayback Machine doesn't answer.