The Flit API

Everything the app does, over REST — plus an MCP server so AI agents can use Flit directly. Machine-readable spec: /openapi/v1.json · agent map: /llms.txt

Authentication

The API and MCP server are Pro features ($7/mo). Create a key at /app/api-keys (choose its permissions), then send it as a bearer token. Keys look like flit_sk_… and are shown once.

curl https://flitlink.com/api/v1/links \
  -H "Authorization: Bearer flit_sk_YOUR_KEY"

Permissions: links:read · links:write · stats:read. Rate limit: 600 requests/min per key (429 + Retry-After beyond that).

Endpoints

Method & pathScopeWhat it does
POST /api/v1/linkslinks:writeCreate a link (body: url, slug?, title?, domain?)
GET /api/v1/linkslinks:readList links (limit, cursor)
GET /api/v1/links/{id}links:readGet one link
PATCH /api/v1/links/{id}links:writeUpdate url / title / status
DELETE /api/v1/links/{id}links:writeDelete a link
GET /api/v1/links/{id}/statsstats:readTotal + 30-day daily clicks & uniques
GET /api/v1/links/{id}/qrlinks:readQR image (format=png|svg, size=)
GET /api/v1/domainslinks:readDomains you can mint links on
curl -X POST https://flitlink.com/api/v1/links \
  -H "Authorization: Bearer flit_sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/some/long/path", "slug": "launch"}'

# → 201
# {"id": "…", "short_url": "https://flitl.ink/launch", "slug": "launch",
#  "domain": "flitl.ink", "url": "https://example.com/some/long/path",
#  "title": null, "status": "active", "clicks": 0, "created_at": "…"}

Errors

Errors are RFC 9457 application/problem+json with a stable machine code:

{"type": "https://flitlink.com/docs/api#errors", "title": "slug taken",
 "status": 400, "code": "slug_taken",
 "detail": "That slug is already taken on this domain."}

Codes: invalid_api_key (401) · invalid_request · slug_taken · unknown_domain · unsafe_destination (400) · free_plan_limit · api_requires_pro (402) · not_found (404). POST /links accepts an Idempotency-Key header — retries return the original link.

MCP — for AI agents

Flit runs an MCP server at https://flitlink.com/mcp (Streamable HTTP) with tools create_link, list_links, get_link_stats, delete_link, authenticated with the same API keys. Claude Code setup:

claude mcp add flit --transport http https://flitlink.com/mcp \
  --header "Authorization: Bearer flit_sk_YOUR_KEY"

Each tool enforces the key's permissions — a read-only key can list links and read stats but not create or delete.