Every endpoint underDocumentation 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 requires an API key. There are no user accounts, no session cookies, and no OAuth flows — the key is the principal. linq authenticates by hashing the presented key and looking it up in the api_keys table: a missing key, an unknown key, or a key whose expires_at has passed all produce a 401 Unauthorized response. The only exceptions to this requirement are GET /api/health and GET /llms.txt, which are intentionally unauthenticated.
Accepted Headers
linq accepts an API key in two headers. Both are equivalent; use whichever fits your client: Preferred:Authorization bearer token
X-Api-Key header
X-Api-Key form is provided as a fallback for clients or proxies that cannot set a custom Authorization header. In all other cases, the Authorization: Bearer form is preferred.
curl Examples
Full Example: Creating a Link
The following example creates a short link using Bearer authentication:201 Created with the full link object, including the generated short_url.
Getting Your First Key
linq mints an admin key automatically the first time it starts with an emptyapi_keys table, and prints the plaintext secret to stdout:
Via the REST API
Send a
POST /api/v1/keys request with an existing admin key. The response includes the plaintext secret field — the only time it ever appears.Via the CLI
Run
bun run key:create from the repository root without restarting the server:--preset defaults to admin; --expires <ISO date> sets an expiry.Via the Client UI
Open the Keys page in the web UI. See API Keys for a walkthrough.
Roles
Roles are ordered from least to most privileged:viewer < editor < admin. Every operation in the API states the minimum role it requires. A key with an insufficient role is authenticated successfully but receives a 403 Forbidden response.
| Role | What it can do |
|---|---|
viewer | Read all resources. Cannot create, update, archive, or purge. |
editor | All viewer actions, plus create and update links, rules, and QR codes. |
admin | All editor actions, plus archive/restore/purge links and domains, manage keys, and manage domains. |
401 Unauthorized
A401 is returned when the key is missing, unknown, or expired. The response body follows linq’s standard error envelope:
- No
AuthorizationorX-Api-Keyheader was sent. - The key value is misspelled or truncated.
- The key’s
expires_attimestamp has passed. - The key was revoked with
DELETE /api/v1/keys/{id}.
403 Forbidden
A403 is returned when the key is valid and authenticated, but its role does not meet the minimum required by the operation:
403 also occurs when an admin attempts to revoke or downgrade the key they are currently calling with — linq prevents an admin from accidentally locking itself out.