Developer API

JSON endpoints for creating and managing links. No SDK required.

Open API v1 docs

Application API v1

https://4u.fyi/api/v1/ is the secured shared API for the Android application and future approved clients. It provides short-lived access tokens, rotating refresh sessions, links, 4u Pages, blocks, analytics, audience data and validated image uploads.

The interactive OpenAPI reference is available at /api/v1/docs. Browser dashboard sessions continue to use secure HTTP-only cookies.

Authentication

Generate a token in Account → API access, then send it as a bearer header.

Authorization: Bearer YOUR_API_TOKEN

Endpoints

MethodPathDescription
POST/api/linksCreate a short link
GET/api/linksList your links
GET/api/links/{alias}Read a single link
GET/api/healthPublic service health check

Create a link

POST /api/links — JSON body

{
  "destination": "https://example.com/launch",   # required, http(s) only
  "alias": "launch",                          # optional, 3–63 chars
  "title": "Product launch",                 # optional
  "redirectType": "302",                     # 301 | 302
  "expiresAt": "2026-12-31T23:59:00Z",     # optional
  "maxClicks": 10000                         # optional
}

Returns 201 with the link, including ready-to-use QR endpoints:

{
  "ok": true,
  "link": {
    "alias": "launch",
    "url": "https://4u.fyi/launch",
    "qrPng": "/qr.php?code=launch&type=png",
    "qrSvg": "/qr.php?code=launch&type=svg"
  }
}

Notes

  • • Destinations must be http or https; local/private addresses are rejected.
  • • Aliases are case-insensitive and reserved words (e.g. api, login) cannot be used.
  • • Errors return JSON with an error field and appropriate 4xx status codes.
  • • QR codes for active links are public at /qr.php?code={alias}.