L lnklab

API

REST + JSON, base URL https://lnklab.us/api/v1.

Authentication

Send your token as a bearer header. Issue tokens from your dashboard.

Authorization: Bearer lnk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Endpoints

Method Path Purpose
GET /ping Public health check.
GET /me Current authenticated user (id, email, tier).
GET /links List your links (most recent 200).
POST /links Create a simple link. Body: {"target_url": "...", "custom_slug": "..."}.
GET /links/{id} Fetch one of your links.
DELETE /links/{id} Soft-disable (sets is_active=false).

Errors

Uniform JSON envelope with HTTP status:

{ "error": "invalid", "message": "target_url is not a valid http(s) URL" }

Codes: unauthorized (401), invalid (400), tier_limit (403), not_found (404), conflict (409).

Webhooks

Configure webhook destinations from Notifications. We POST signed JSON bodies with header X-Lnklab-Signature: sha256=<hmac>, keyed off your account secret — verify before trusting the payload.

Quickstart

curl https://lnklab.us/api/v1/links \
  -H "Authorization: Bearer lnk_xxx..." \
  -H "Content-Type: application/json" \
  -d '{"target_url": "https://example.com/long-page"}'

We use first-party cookies for sign-in and CSRF protection. With your permission, we'd also load Google Analytics to understand aggregate site usage (anonymized IP, no cross-site profiles). Privacy notice.