Skip to content

Community API

Community JSON lives under /api/v1/community. Public reads do not require a session when the requested content is public. Mutations require a Better Auth session, a verified email, an active community profile, and a same-origin request.

MethodPathAuthPurpose
GET/api/v1/community/postsOptionalFeed, search, tags, and cursor pagination.
POST/api/v1/community/postsRequiredCreate a post.
GET/api/v1/community/posts/{postId}OptionalRead a post and comments.
PATCH / DELETE/api/v1/community/posts/{postId}AuthorEdit or delete a post.
POST/api/v1/community/posts/{postId}/commentsRequiredCreate a comment or reply.
PUT/api/v1/community/posts/{postId}/reactionRequiredToggle a like.
PUT/api/v1/community/posts/{postId}/bookmarkRequiredToggle a bookmark.
PUT/api/v1/community/posts/{postId}/pinAuthorPin or unpin.
POST/api/v1/community/posts/{postId}/archiveAuthorArchive.
POST/api/v1/community/posts/{postId}/restoreAuthorRestore.
GET/api/v1/community/notificationsRequiredList or count notifications.
PUT/api/v1/community/notifications/{notificationId}/readRequiredMark one notification read.
PUT/api/v1/community/notifications/read-allRequiredMark all visible notifications read.
GET/api/v1/community/tagsOptionalList tags with visible post counts.
GET/api/v1/community/tags/preferencesRequiredList tag preferences.
PUT/api/v1/community/tags/{tag}/preferenceRequiredSet follow, mute, or null.
PUT/api/v1/community/users/{uid}/{follow|block|mute}RequiredSet a user relationship.
PUT/api/v1/community/posts/{postId}/feedbackRequiredSet discovery feedback.
DELETE/api/v1/community/me/post-feedbackRequiredClear discovery feedback.
POST/api/v1/community/reportsRequiredReport a post, comment, or user.
PATCH / DELETE/api/v1/community/comments/{commentId}AuthorEdit or delete a comment.
PUT/api/v1/community/comments/{commentId}/reactionRequiredToggle a comment like.
GET/api/v1/community/me/commentsRequiredList the signed-in user’s comments.

For request and response field details, see Posts, Profiles, and Uploads.

Post responses include the canonical community DTO fields:

{
"id": "post-uuid-from-the-service",
"title": "A post title",
"body": "Post body",
"visibility": "public",
"moderationStatus": "allow",
"state": "active",
"version": 1,
"createdAt": 1730000000000,
"updatedAt": 1730000000000,
"lastEditedAt": 1730000000000,
"commentCount": 0,
"likeCount": 0,
"pinnedAt": null,
"archivedAt": null,
"commentsLockedAt": null,
"authorUid": 1001,
"authorName": "Example user",
"authorImage": null,
"avatarSeed": "opaque-avatar-seed",
"device": null,
"ipLocation": null,
"tags": [],
"attachments": []
}

IDs and avatar seeds in this example are labels for response fields, not values clients should construct. The post detail envelope carries viewer-specific flags separately under viewer; list items carry their own viewer flags in the list response.

User-authored text is inspected before publication. The response can be 201 or 202 with moderationQueued; a post or comment may remain pending until moderation completes. A client should display the returned object and its state instead of assuming every successful write is immediately searchable.