Developer API
JSON endpoints for creating and managing links. No SDK required.
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
| Method | Path | Description |
|---|---|---|
| POST | /api/links | Create a short link |
| GET | /api/links | List your links |
| GET | /api/links/{alias} | Read a single link |
| GET | /api/health | Public 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
httporhttps; local/private addresses are rejected. - • Aliases are case-insensitive and reserved words (e.g.
api,login) cannot be used. - • Errors return JSON with an
errorfield and appropriate 4xx status codes. - • QR codes for active links are public at
/qr.php?code={alias}.