The linq REST API is a JSON-over-HTTP interface built on Hono, running on Bun’s HTTP server. Every resource — links, domains, rules, QR codes, analytics, visits, and keys — is accessible under the versioned prefixDocumentation 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.
/api/v1. All request and response bodies use application/json. There are no XML endpoints, no form-encoded payloads, and no cookies: authentication is entirely key-based, which means every request is stateless and every client is treated identically regardless of origin.
Base URL
For a self-hosted deployment, the base URL is the host you configured during setup:LINQ_PORT in your .env file and defaults to 3000. Every endpoint documented in this reference is relative to this base URL unless noted otherwise.
Health Check
/api/v1 intentionally. It returns the server’s status and the running version, making it suitable for container readiness probes and load-balancer health checks.
Response:
version field reflects the running binary’s version string.
Content Type
All endpoints accept and returnapplication/json. Set the Content-Type header on every request that carries a body:
Content-Type on a body-bearing endpoint will fail validation.
Resource Groups
Links
Create and manage short links, set destinations, configure expiry, and attach dynamic routing rules. The core resource.
Domains
Register and manage the hostnames that short links live on. Each domain carries its own fallback and redirect configuration.
Rules
Ordered conditional rules attached to a link. The first rule whose conditions all match supplies the redirect destination.
QR Codes
Styled QR codes tied to a link’s short URL. Customise dot color, background color, and pattern shape.
Analytics
Aggregated visit totals, daily timeseries, and breakdowns by referer, OS, browser, platform, slug, or destination.
Visits
The raw visit log — individual redirect events with user agent, platform, OS, browser, referer, and query string.
Keys
API keys are the principals. Mint one to grant access; revoke it to remove access. No user accounts exist.
Pagination
All list endpoints return results in a shared envelope:| Field | Type | Description |
|---|---|---|
data | array | The items on this page. |
total | integer | Total matching rows across all pages, not just this one. |
limit | integer | The page size applied (mirrors the limit query parameter). |
offset | integer | The row offset applied (mirrors the offset query parameter). |
| Parameter | Type | Default | Max | Description |
|---|---|---|---|---|
limit | integer | 50 | 200 | Number of items to return. |
offset | integer | 0 | — | Zero-based row offset for cursor-style paging. |
offset by limit on each request until offset >= total.
CORS
All/api/* endpoints allow cross-origin requests from any origin. The API key is the only credential — linq issues no cookies and does not rely on browser same-origin policy for security. This means:
- You can call the API directly from a browser app on a different domain.
- No
Access-Control-Allow-Originallowlist to configure. - No CSRF mitigations needed, because no cookies are involved.
docs/adr/0006 for the full reasoning behind this design.
llms.txt
listed: true. Archived, expired, and unlisted links never appear. The response is intended for AI crawlers and follows the llms.txt convention.
The Host header selects which domain’s catalogue is returned. A 404 is returned if the host does not match an active domain.
Identity Endpoint
GET /api/v1/me returns the calling key’s id, name, claims, preset, prefix, and expires_at. It is a quick way to confirm that your key is valid, inspect which claims it carries, and verify connectivity before making further calls. Use it as a smoke test when setting up a new integration.