Skip to content

Routes Reference

Authentication Endpoints

MethodPathDescription
POST/api/auth/loginLogin (supports admin and registered users)
POST/api/auth/logoutLogout
POST/api/auth/registerRegister new user
POST/api/auth/switchPassword-free user switch for logged-in users
GET/api/auth/sessionGet session state (includes userId and role)
GET/api/auth/oauth-providersGet enabled OAuth provider list (public, no secrets)
GET/api/auth/oauth/[provider]Initiate OAuth login (redirect to third-party auth page)
GET/api/auth/oauth/[provider]/callbackOAuth callback handler
Request/Response Examples

POST /api/auth/login

json
// Request
{ "username": "admin", "password": "your-password", "rememberMe": true }

// Response
{ "ok": true, "username": "admin", "role": "admin" }

POST /api/auth/register

json
// Request
{ "username": "newuser", "password": "123456", "confirmPassword": "123456" }

// Response
{ "ok": true, "username": "newuser" }

GET /api/auth/session

json
{ "isAuthenticated": true, "username": "admin", "userId": "__admin__", "role": "admin" }
MethodPathDescription
GET/api/navigation/cardsPaginated all cards list (sites + social + notes)
GET/api/navigation/site-cardsPaginated site card list (only sites with empty card_type)
GET/api/navigation/tagsVisible tags list
GET/api/navigation/social-cardsSocial card list (public)
GET/api/navigation/note-cardsNote card list (public)
Query Parameters & Response Examples

GET /api/navigation/cards and GET /api/navigation/site-cards

ParameterDescription
scope"all" or "tag"
tagIdTag ID (required when scope=tag)
qSearch keyword
cursorPagination cursor
json
{ "items": [Card], "total": 100, "nextCursor": "eyJvZmZzZXQiOjEyfQ==" }

/api/navigation/cards returns all card types, /api/navigation/site-cards returns only site cards (card_type is empty).

Management Endpoints (Auth Required)

MethodPathDescription
GET / POST/api/site-cardsGet all / Create site
PUT / DELETE/api/site-cardsUpdate / Delete site
POST/api/site-cards/batchBatch create sites (bookmark import)
POST/api/site-cards/check-onlineBatch online check
POST/api/site-cards/check-online-singleSingle site instant online check
PATCH/api/site-cards/memoUpdate site memo notes
POST/api/site-cards/reorder-globalGlobal site reordering
GET / POST/api/tagsGet all / Create tag
PUT / DELETE/api/tagsUpdate / Delete tag
POST/api/tags/reorderTag reordering
POST/api/tags/[tagId]/sites/reorderReorder within tag
PUT/api/tags/[tagId]/sites/restoreRestore tag-site association
GET / PUT/api/appearanceGet / Update appearance config
GET / PUT/api/settingsGet / Update app settings
GET / PUT/api/floating-buttonsGet / Update floating button config

Admin Endpoints

MethodPathDescription
GET/api/admin/bootstrapGet all data needed for editor initialization
GET / PUT/api/admin/registrationGet/Update registration toggle
GET / PUT / DELETE/api/admin/usersUser list/role update/user delete
GET / PUT/api/admin/oauthGet/Update OAuth provider config
POST/api/admin/oauth/testTest OAuth provider connectivity
Request/Response Examples

GET /api/admin/bootstrap

json
{
  "tags": [Tag],
  "sites": [Site],
  "appearances": { "light": {...}, "dark": {...} },
  "settings": AppSettings
}

Asset Endpoints

MethodPathDescription
POST/api/assets/wallpaperUpload wallpaper/Logo/Favicon/icon
GET/api/assets/[assetId]/fileGet asset file
POST/api/assets/cleanupBatch cleanup orphan icon resources

Config Endpoints (Admin Global Level)

MethodPathDescription
POST/api/config/exportExport global config as ZIP
POST/api/config/importImport global config from ZIP
POST/api/config/detectDetect uploaded file type
POST/api/config/resetReset global config to defaults (password confirmation required)

User Data Endpoints (Auth Required, User-Isolated)

MethodPathDescription
POST/api/user/data/exportExport current user data as ZIP
POST/api/user/data/importImport data from ZIP to current user space
POST/api/user/data/resetReset current user data
POST/api/user/data/clearClear current user's tags and sites
POST/api/user/data/detectDetect import file type

Search Endpoints

MethodPathDescription
GET/api/search/suggest?q=keywordGet search suggestions

AI Endpoints

MethodPathDescription
POST/api/ai/recommendAI smart site recommendations
POST/api/ai/workflowAI workflow planning (needs → ordered steps)
POST/api/ai/analyze-site-cardAI site analysis (scope: basic / full)
POST/api/ai/checkAI connectivity check
POST/api/ai/import-bookmarksAI external bookmark file analysis
Request/Response Examples

POST /api/ai/recommend

json
// Request
{ "keyword": "design tools", "_draftAiConfig": { "aiApiKey": "sk-xxx", "aiBaseUrl": "https://api.example.com/v1", "aiModel": "deepseek-chat" } }

// Response
{ "recommendations": [{ "name": "Figma", "url": "https://figma.com", "reason": "..." }] }

💡 _draftAiConfig is an optional parameter. Admins can use it to temporarily override AI config for preview debugging.

POST /api/ai/analyze-site-card

json
// Request (full analysis)
{ "url": "https://example.com", "siteId": "site-uuid", "scope": "full" }

// Response
{ "title": "Example Site", "description": "...", "matchedTags": [...], "siteRecommendContext": "...", "recommendations": [...] }

Social Card Endpoints

MethodPathDescription
GET/api/social-cardsGet all social cards (auth required)
POST/api/social-cardsCreate social card (auth required)
PUT/api/social-cardsUpdate social card (auth required)
DELETE/api/social-cards?id=xxxDelete single card (auth required)
DELETE/api/social-cardsDelete all social cards (auth required)
PUT/api/social-cards/reorderCard drag reordering
GET/api/social-cards/[id]Get single card (public)

Note Card Endpoints

MethodPathDescription
GET/api/note-cardsGet all note cards (auth required)
POST/api/note-cardsCreate note card (auth required)
PUT/api/note-cardsUpdate note card (auth required)
DELETE/api/note-cards?id=xxxDelete single note card
POST/api/note-cards/upload-imageUpload note image (max 5MB)
POST/api/note-cards/upload-fileUpload note file (max 10MB)
GET/api/note-cards/img/[imageId]Get note image (public)
GET/api/note-cards/file/[fileId]Download note file (public)
GET/api/note-cards/attachment?noteId=xxxGet attachment list for a note
POST/api/note-cards/attachmentUpload note attachment (max 100MB)
PUT/api/note-cards/attachmentRename attachment
DELETE/api/note-cards/attachment?id=xxxDelete attachment

Snapshot Endpoints (Auth Required)

MethodPathDescription
GET/api/snapshotsGet current user's snapshot list
POST/api/snapshotsCreate snapshot
DELETE/api/snapshots?id=xxxDelete single snapshot
PATCH/api/snapshots?id=xxxRename snapshot
POST/api/snapshots?action=restore&id=xxxRestore snapshot
POST/api/snapshots?action=cleanupCleanup expired snapshots (admin only)

Health Check

MethodPathDescription
GET/api/healthUsed by Docker HEALTHCHECK

User Endpoints (Auth Required)

MethodPathDescription
GET/api/user/profileGet current user profile
PUT/api/user/profileUpdate user nickname
POST/api/user/avatarUpload/update avatar
DELETE/api/user/avatarDelete avatar
PUT/api/user/passwordChange password
PUT/api/user/usernameChange username (once only)
GET/api/user/oauth-bindGet OAuth binding list
DELETE/api/user/oauth-bindUnbind OAuth account
POST/api/user/delete-accountDelete account

Personal Space Pages

PathDescription
/profilePersonal space page (view/edit profile, upload avatar, change password, OAuth bind/unbind, manage API tokens, delete account)