HTTP reference
API — Posts, comments, likes, members, moderation
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 |
|---|---|---|---|
| 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. |