Links are the core entity in linq. Every short URL is a link: a slug on a domain that either redirects a visitor to a long destination or serves a hosted link-tree page. Links carry their own metadata, optional expiry, visit counters, and a full lifecycle from creation through optional soft-deletion to permanent purge. Understanding how links and slugs work is the foundation for everything else you build with the API.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/org-quicko/linq/llms.txt
Use this file to discover all available pages before exploring further.
Link Kinds
Every link has akind that controls what happens when a visitor lands on its short URL.
- redirect
- tree
A
redirect link sends visitors to a Destination URL with an HTTP 302 response. This is the standard short-link use case. A redirect link may carry up to 50 conditional Rules (see Dynamic Links) to route different visitors to different destinations.Slugs
A slug is the path segment after the host that uniquely identifies a link within a domain — theabc123 in https://go.example.com/abc123.
Random slugs
When you omit
slug on create, linq generates a random slug using base-62 characters ([A-Za-z0-9_-]). The default length is 6 characters, controlled by the LINQ_SLUG_LENGTH environment variable. With the default length you have 62⁶ ≈ 56 billion possible slugs per domain.Custom slugs
Supply any value matching
^[A-Za-z0-9_-]{1,64}$ in the slug field when creating a link. If that slug is already taken on the domain, the API returns 409 Conflict. Reserved path segments (such as /api and the Client UI base path) are rejected with 400.Slugs are immutable once set — changing a slug would break any live short URL. To move a link to a different slug, archive the old one and create a new link. A slug remains reserved for as long as its link row exists, archived or not; only a Purge releases it.
Short URL Format
Theshort_url field on every link response contains the fully assembled URL. The scheme is chosen automatically:
localhostor127.0.0.1(with or without a port) →http://- Any other host →
https://
localhost:3000 produces http://localhost:3000/abc123, while a production domain like go.example.com always produces https://go.example.com/abc123.
Link Fields
The full shape of a link returned by the API:Unique identifier for the link. UUIDv7, so it is time-sortable.
The domain this link belongs to. Set at create time and immutable.
The host string of the domain, e.g.
go.example.com. Joined into every response for convenience.Path segment. Immutable. Pattern:
^[A-Za-z0-9_-]{1,64}$.Fully assembled short URL:
https://<domain_host>/<slug> (or http:// for localhost).The long URL visitors are sent to when the link resolves.
Human-readable label. Auto-populated from the destination page’s
<title> when LINQ_FETCH_LINK_METADATA is enabled, falling back to the destination host. Up to 200 characters.Optional description. Auto-populated from the destination’s
<meta name="description"> when metadata fetching is enabled. Up to 500 characters.Favicon or icon URL fetched from the destination page’s
<head> when LINQ_FETCH_LINK_METADATA is enabled. null if not fetched or not found.Up to 20 free-form tags (each up to 50 chars). Used for filtering in
GET /api/v1/links.When
true, the caller’s incoming query string is merged into the destination URL at redirect time. Defaults to true. Also gates preset_params.Key–value pairs (up to 20, keys ≤ 64 chars, values ≤ 512 chars) applied to the destination at redirect time. When
forward_query is true, preset params overwrite any colliding key from either the destination’s own query or the forwarded query. See Query Forwarding and Preset Params below.Current lifecycle state. See Link Lifecycle.
When set, the link stops redirecting after this timestamp.
null means the link never expires.Opt-in flag controlling whether this link appears in the domain’s
GET /llms.txt catalogue for AI crawlers. Defaults to false.The number of conditional rules attached to this link. When greater than zero, the Client UI marks the link as routing dynamically.
Cumulative visit count for requests that were not detected as bots or link-preview crawlers.
Cumulative visit count for requests that were detected as bots or link-preview crawlers.
Query Forwarding and Preset Params
Whenforward_query is true (the default), linq merges the visitor’s own query string into the destination URL before redirecting. Preset params are then applied on top, winning any collision:
color=red (destination’s own query) is overridden by color=blue (forwarded), which is then overridden by color=green (preset param). Preset params always win on collision.
Setting
forward_query: false disables both query forwarding and preset params in one step, since preset params are only applied when the link forwards its query.Link Lifecycle
Links move through a three-stage lifecycle. Only admins can archive or purge.Active
The link resolves normally. Visits are recorded. The short URL works. This is the initial state after creation.
Archived
A soft delete triggered by
DELETE /api/v1/links/{id}. The slug is still reserved — no other link can claim it. Existing visits are retained. An archived link never redirects: visitors land on the domain’s fallback URL or get a 404. Archiving is reversible by patching status back to "active".DELETE /api/v1/links/purge destroys every archived link at once and is also admin-only.
Link Expiry
Settingexpires_at to an ISO 8601 datetime makes the link behave as an orphan after that timestamp — the visitor is sent to the domain’s fallback URL or gets a 404. The link row is not automatically deleted; it stays in active status and can have its expiry extended by patching expires_at.
Because a cached redirect entry can outlive its
expires_at timestamp without the cache knowing, linq intentionally treats expired links as orphans at read time rather than filtering them in SQL. The cache TTL (default 5 minutes, set via LINQ_CACHE_TTL) is the maximum extra time an expired link can still redirect.OG Preview
When a link-preview crawler (Slack, iMessage, Twitter Cards, etc.) hits a short URL, linq detects the crawler’s User-Agent and returns a small HTML page carrying the link’s own Open Graph tags —og:title, og:description, and og:image — instead of a 302. This ensures social cards show your curated metadata, not the destination’s own tags, and avoids a live fetch to the destination on every crawler hit.
The
listed field controls whether a link appears in GET /llms.txt — a plain-text catalogue read by AI crawlers and LLMs to discover the short links on a domain. It defaults to false. Set it to true only for links you want AI tools to know about publicly.