Browse docs

REST API overview

How the app talks to the server in the browser, and how Pro workspaces call Linktrap from scripts.

You do not need to read this page to use Linktrap in the web UI — the dashboard and create flow call the APIs for you. Use this when you integrate from code or debug auth errors.

Base URL

All paths are relative to your deployment origin, e.g. https://your.app.

Authentication modes

SurfaceAuthNotes
/api/linksClerk session cookieBrowser or same-origin fetch with credentials.
/api/links/[id]Clerk sessionPATCH/DELETE only for links in your workspace.
/api/generate-metaClerk sessionOpenAI + optional Blob; costs accrue to your keys.
/api/stripe/checkout, portalClerk sessionCreates Stripe URLs for the signed-in user's workspace.
/api/stripe/webhookStripe signatureNo Clerk; verify STRIPE_WEBHOOK_SECRET.
/api/v1/linksAuthorization: Bearer lt_…Pro workspace API key; see below.
/api/workspace/api-keysClerk sessionPro only; create/list/revoke keys.
/api/workspace/custom-domainsClerk sessionPro only; register hostnames.

Rate limiting & quota

POST /api/links (and v1 create) apply per-minute rate limits and monthly workspace quotas on the free plan. Errors return 429 or 403 with JSON error messages.

Full v1 reference

Request/response shapes and examples: API v1 reference.