REST API
Interactive docs
Every Sink instance publishes API docs at:
https://your-domain/_docs/openapi.json— machine-readable OpenAPIhttps://your-domain/_docs/scalar— friendly UIhttps://your-domain/_docs/swagger— classic Swagger UI
Use your own domain. Public demo: https://sink.cool/_docs/scalar.
Authentication
Send your site password in the Authorization header:
http
Authorization: Bearer YOUR_SITE_TOKEN(Bearer means “here is the token”.) It must match NUXT_SITE_TOKEN exactly (at least 8 characters). With Cloudflare Access enabled, browsers can also authenticate with a verified Access login.
CORS
Optional. Set NUXT_API_CORS=true at build time to allow browser apps on other sites to call /api/**. Login is still required. See configuration.
Before you call link APIs
Storage must be ready
Until you open Dashboard → Links once after deploy, most /api/link/** calls fail with “storage not ready” (HTTP 423). See storage setup.
upsertcreates when free; if the short code exists, returns it withstatus: "existing"(does not overwrite)searchmatches short code, URL, comment, and tagscheckprobes target URLs from the serververifychecks how you are authenticatedlocationreturns approximate coordinates when Cloudflare provides them- Image upload needs R2 (JPEG/PNG/WebP/GIF, max 5 MB)
Endpoint groups
Use the OpenAPI UI for full request/response details.
| Group | Routes |
|---|---|
| Links | /api/link/create, edit, upsert, delete, query, search, list, check, tags |
| Import/export | /api/link/import, /api/link/export — Import and Export |
| Storage setup | /api/link/migration/status, /api/link/migration/run — storage setup |
| AI | /api/link/ai, /api/link/og-ai — Workers AI |
| Analytics | /api/stats/**, /api/logs/** — Analytics |
| Utilities | /api/verify, /api/location, /api/upload/image, /api/backup |