API running

Hono · better-auth · Drizzle · MySQL

Environment
production
Node
v22.23.3
Uptime
546s
Database
twinslab-dev-db-d7mcvn:3306/twinslab
MethodPathNote
GET /api/health liveness JSON
GET /api/status this page as JSON
GET /api/me current user (needs session)
GET /api/drafts approval queue, scoped by role
POST /api/drafts/:id/approve approve a ready draft and queue the send
POST /api/drafts/:id/send-edited send edited draft text
POST /api/drafts/:id/reject reject a draft with a reason
POST /api/drafts/:id/retry re-queue draft generation after a timeout
POST /api/drafts/:id/cancel-auto cancel a pending auto-send
POST /api/auth/sign-up/email better-auth
POST /api/auth/sign-in/email better-auth
GET /api/auth/get-session better-auth
POST /webhooks/minicrew/{message,message-status,channel-status,group-membership} minicrew webhooks (signed)
GET /api/conversations conversations (scoped)
GET /api/conversations/:id conversation
GET /api/conversations/:id/messages thread
POST /api/conversations/:id/{messages,notes,assign} reply, note, assign
POST /api/conversations/:id/messages/:mid/{arrived,resend} delivery follow-up
GET /api/integration/connection minicrew connection state
GET /api/integration/health integration health (admin)
POST /api/integration/sync recover missed messages (admin)
POST /api/integration/test-webhook ask minicrew to send a signed test ping webhook (admin)
GET /api/settings settings
PATCH /api/settings update settings (admin)
GET /api/settings/groups groups & routing
POST /api/settings/groups save group rule (admin)
PATCH /api/settings/channels/:uuid WhatsApp number label (admin)
POST /api/settings/connections/minicrew/test minicrew connection test (admin)
GET /api/settings/connections SQL Accounting, 聚力 and minicrew connection details, secrets masked (admin)
PUT /api/settings/connections/{sql,juli,minicrew} save connection details (admin)
POST /api/settings/connections/{sql,juli}/test SQL Accounting / 聚力 connection test (admin)
GET /api/settings/auto-send/readiness auto-send shadow report; ?days(1-90, default 30) (admin)
GET /api/orders/source 聚力 orders with validation result; ?page&pageSize(≤200)&status=Held,Failed&q → {items,total,page,pageSize,counts}
GET /api/orders/sql SQL Accounting Sales Orders (read-only)
GET /api/orders/runs integration log
GET /api/orders/status last / next poll, write-back, connections
GET /api/orders/mappings 聚力 → SQL Accounting code mapping; ?page&pageSize(≤200)&type&q&unmapped=true → {items,total,page,pageSize}
GET /api/orders/sql-master SQL Accounting customers / items for mapping
POST /api/orders/mappings save mapping, re-validate held orders (admin)
POST /api/orders/source/:juliRef/{retry,skip} create SO / skip with reason (admin)
POST /api/orders/run poll 聚力 now (admin)
POST /api/orders/sync queue a past-orders sync for a MYT date range, max 31 days (admin)
GET /api/faq/proposals FAQ proposals to review (supervisor+)
PATCH /api/faq/proposals/:id edit a pending FAQ proposal
POST /api/faq/proposals/:id/approve insert or update the FAQ in minicrew
POST /api/faq/proposals/:id/discard discard a proposal
GET /api/faq FAQ library, read from minicrew
GET /api/faq/log FAQ learning log (supervisor+)
POST /api/conversations/:id/summary advisory AI summary (not stored, not posted)
GET /api/handoffs hand-offs in scope
GET /api/handoffs/routes routes available for a conversation
GET /api/handoffs/owners active users for owner pickers
POST /api/handoffs request a hand-off (summarises synchronously)
GET /api/handoffs/:id one hand-off
PATCH /api/handoffs/:id edit a waiting hand-off summary
PATCH /api/handoffs/:id/open-points/:index set an open point owner
POST /api/handoffs/:id/post post into the receiving group
POST /api/handoffs/:id/repost post again after a failed delivery
GET /api/settings/handoff-routes hand-off routes (admin)
POST /api/settings/handoff-routes create or update a route (admin)
DELETE /api/settings/handoff-routes/:id deactivate a route (admin)