HTTP reference

API reference

Route Handlers under src/app/api. Non-public routes expect a Supabase session cookie. Admin routes also require profiles.role = admin.

PublicCallable without a session where the handler allows it.Signed inRequires a signed-in user.AdminAdmin role on your profile.
MethodsPathAccessSummary
POST/api/auth/loginPublicEmail/password sign-in; sets session cookies.
POST/api/auth/logoutPublicClear Supabase session cookies.
GET/api/auth/sessionPublicLightweight session probe for the client.
POST/api/auth/email-registeredPublicCheck whether an email is already registered (signup UX).
POST/api/auth/update-passwordPublicComplete password reset when recovery session is present.Typically used after magic link / recovery flow.
PATCH/api/auth/meSigned inUpdate lightweight auth-adjacent profile fields (e.g. UI language).
GET/api/app/homeSigned inAggregated home payload for the signed-in dashboard.
GET, PATCH/api/profileSigned inRead or update the user profile row (display, avatar, pregnancy prefs, community flags).
GET, POST/api/vitalsSigned inList or create vital sign entries.
GET, POST/api/symptoms/logSigned inList or create symptom log entries.
GET/api/symptoms/log/[id]Signed inFetch a single symptom log by id.
GET, POST/api/appointmentsSigned inList or create appointments.
GET, PUT/api/planner/dailySigned inRead or upsert daily planner entries.
GET/api/planner/foodSigned inPlanner food suggestions or logs for the current context.
POST/api/chatSigned inMain chat completion: context assembly, optional RAG, Gemini with Groq failover.
POST/api/chat/nearby-onceSigned inOne-shot nearby-facilities style completion for chat UX.
POST/api/rag/searchSigned inSemantic search over knowledge chunks (embeddings + RPC).
POST/api/rag/ingestAdminIngest a knowledge chunk into RAG tables (admin-only).
POST/api/reports/analyzeSigned inAnalyze uploaded medical report content with AI.
POST/api/reports/extract-localSigned inClient-side extraction helper endpoint for report pipeline.
GET, POST/api/community/postsSigned inFeed query (filters, sort) or create a new post.
GET, PATCH, DELETE/api/community/posts/[postId]Signed inRead, edit, or soft-delete a post (author or policy-gated).
GET, POST/api/community/posts/[postId]/commentsSigned inList threaded comments or add a comment/reply.
POST/api/community/posts/[postId]/likeSigned inToggle or set like state for the current user.
POST/api/community/posts/[postId]/reportSigned inSubmit a moderation report for a post.
POST/api/community/posts/[postId]/moderateSigned inModerator action on a post (hide/unhide).Requires moderator capability in app policy.
POST/api/community/posts/[postId]/comments/[commentId]/moderateSigned inModerator action on a single comment.
GET/api/community/members/[userId]Signed inPublic-safe member card plus optional extended pregnancy fields when allowed.
GET/api/notificationsSigned inList notifications for the current user.
POST/api/notifications/mark-readSigned inMark one or all notifications as read.
GET/api/admin/dashboardAdminAggregate metrics for the admin home.
GET/api/admin/usersAdminSearch or list users for admin operations.
GET, PATCH/api/admin/users/[userId]AdminInspect or update a user record (role, flags, etc.).
POST/api/admin/users/[userId]/banAdminBan or suspend a user account.
POST/api/admin/users/[userId]/confirm-emailAdminAdmin-triggered email confirmation for a user.
GET/api/admin/feedbackAdminList submitted app feedback tickets.
PATCH/api/admin/feedback/[id]AdminUpdate feedback status or notes.
GET/api/admin/community/reportsAdminList community moderation reports.
PATCH/api/admin/community/reports/[reportId]AdminResolve or update a community report.
GET/api/admin/community/postsAdminAdmin listing of community posts (moderation queue).
PATCH, DELETE/api/admin/community/posts/[postId]AdminForce-edit or remove a community post.
GET, POST/api/admin/knowledge/documentsAdminList or create knowledge documents for RAG.
PATCH, DELETE/api/admin/knowledge/documents/[id]AdminUpdate metadata or delete a knowledge document.
POST/api/admin/knowledge/documents/batchAdminBatch operations on knowledge documents.
POST/api/admin/knowledge/documents/deleteAdminDedicated delete flow for knowledge documents.
GET, PATCH/api/admin/settingsAdminRead or update operator-tunable app settings.
POST/api/feedbackSigned inSubmit in-app product feedback from a signed-in user.
POST/api/facilities/nearbySigned inNearby facilities lookup for maps-style UX.
POST/api/emergency/hospitalsPublicBangladesh hospital catalog lookup (structured POST body).Used by emergency flows; validate body schema in route source.