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.
| Methods | Path | Access | Summary |
|---|---|---|---|
| POST | /api/auth/login | Public | Email/password sign-in; sets session cookies. |
| POST | /api/auth/logout | Public | Clear Supabase session cookies. |
| GET | /api/auth/session | Public | Lightweight session probe for the client. |
| POST | /api/auth/email-registered | Public | Check whether an email is already registered (signup UX). |
| POST | /api/auth/update-password | Public | Complete password reset when recovery session is present.Typically used after magic link / recovery flow. |
| PATCH | /api/auth/me | Signed in | Update lightweight auth-adjacent profile fields (e.g. UI language). |
| GET | /api/app/home | Signed in | Aggregated home payload for the signed-in dashboard. |
| GET, PATCH | /api/profile | Signed in | Read or update the user profile row (display, avatar, pregnancy prefs, community flags). |
| GET, POST | /api/vitals | Signed in | List or create vital sign entries. |
| GET, POST | /api/symptoms/log | Signed in | List or create symptom log entries. |
| GET | /api/symptoms/log/[id] | Signed in | Fetch a single symptom log by id. |
| GET, POST | /api/appointments | Signed in | List or create appointments. |
| GET, PUT | /api/planner/daily | Signed in | Read or upsert daily planner entries. |
| GET | /api/planner/food | Signed in | Planner food suggestions or logs for the current context. |
| POST | /api/chat | Signed in | Main chat completion: context assembly, optional RAG, Gemini with Groq failover. |
| POST | /api/chat/nearby-once | Signed in | One-shot nearby-facilities style completion for chat UX. |
| POST | /api/rag/search | Signed in | Semantic search over knowledge chunks (embeddings + RPC). |
| POST | /api/rag/ingest | Admin | Ingest a knowledge chunk into RAG tables (admin-only). |
| POST | /api/reports/analyze | Signed in | Analyze uploaded medical report content with AI. |
| POST | /api/reports/extract-local | Signed in | Client-side extraction helper endpoint for report pipeline. |
| GET, POST | /api/community/posts | Signed in | Feed query (filters, sort) or create a new post. |
| GET, PATCH, DELETE | /api/community/posts/[postId] | Signed in | Read, edit, or soft-delete a post (author or policy-gated). |
| GET, POST | /api/community/posts/[postId]/comments | Signed in | List threaded comments or add a comment/reply. |
| POST | /api/community/posts/[postId]/like | Signed in | Toggle or set like state for the current user. |
| POST | /api/community/posts/[postId]/report | Signed in | Submit a moderation report for a post. |
| POST | /api/community/posts/[postId]/moderate | Signed in | Moderator action on a post (hide/unhide).Requires moderator capability in app policy. |
| POST | /api/community/posts/[postId]/comments/[commentId]/moderate | Signed in | Moderator action on a single comment. |
| GET | /api/community/members/[userId] | Signed in | Public-safe member card plus optional extended pregnancy fields when allowed. |
| GET | /api/notifications | Signed in | List notifications for the current user. |
| POST | /api/notifications/mark-read | Signed in | Mark one or all notifications as read. |
| GET | /api/admin/dashboard | Admin | Aggregate metrics for the admin home. |
| GET | /api/admin/users | Admin | Search or list users for admin operations. |
| GET, PATCH | /api/admin/users/[userId] | Admin | Inspect or update a user record (role, flags, etc.). |
| POST | /api/admin/users/[userId]/ban | Admin | Ban or suspend a user account. |
| POST | /api/admin/users/[userId]/confirm-email | Admin | Admin-triggered email confirmation for a user. |
| GET | /api/admin/feedback | Admin | List submitted app feedback tickets. |
| PATCH | /api/admin/feedback/[id] | Admin | Update feedback status or notes. |
| GET | /api/admin/community/reports | Admin | List community moderation reports. |
| PATCH | /api/admin/community/reports/[reportId] | Admin | Resolve or update a community report. |
| GET | /api/admin/community/posts | Admin | Admin listing of community posts (moderation queue). |
| PATCH, DELETE | /api/admin/community/posts/[postId] | Admin | Force-edit or remove a community post. |
| GET, POST | /api/admin/knowledge/documents | Admin | List or create knowledge documents for RAG. |
| PATCH, DELETE | /api/admin/knowledge/documents/[id] | Admin | Update metadata or delete a knowledge document. |
| POST | /api/admin/knowledge/documents/batch | Admin | Batch operations on knowledge documents. |
| POST | /api/admin/knowledge/documents/delete | Admin | Dedicated delete flow for knowledge documents. |
| GET, PATCH | /api/admin/settings | Admin | Read or update operator-tunable app settings. |
| POST | /api/feedback | Signed in | Submit in-app product feedback from a signed-in user. |
| POST | /api/facilities/nearby | Signed in | Nearby facilities lookup for maps-style UX. |
| POST | /api/emergency/hospitals | Public | Bangladesh hospital catalog lookup (structured POST body).Used by emergency flows; validate body schema in route source. |