| title | REST API |
|---|---|
| description | OpenAPI docs, authentication, CORS, and endpoint index for Sink. |
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.
Send your site password in the Authorization header:
Authorization: Bearer YOUR_SITE_TOKEN(Bearer means “here is the token”.) In single-user mode it must match NUXT_SITE_TOKEN exactly (at least 8 characters). In OIDC multi-user mode, protected APIs require the browser's OIDC session and reject the site token. OIDC access and ID tokens remain on the server and are never stored by the browser.
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.
::: warning 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)
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 |