Skip to content

Threads API

Threads are the public discussion surface in Community Edition. The repo supports public discovery, replies, signed-in feeds, and owner-managed thread lifecycle actions.

Primary database surfaces

  • content.threads
  • content.thread_replies
  • content.entity_translations
  • content.reactions
  • content.tag_map
  • vw_content_threads_public

Canonical DTOs and view models

From threads.types.ts:

  • CreateThreadDTO
  • ThreadRecord
  • ThreadFeedItem
  • ThreadDetailViewModel
  • ThreadReplyRecord
  • ThreadReplyViewModel

Supported flows

  • public thread listing
  • tag-filtered listing
  • thread detail
  • reply pagination
  • trending threads
  • personal feed
  • following feed
  • create thread
  • create reply
  • update thread
  • delete thread

Existing thread RPCs

RPCPurpose
fn_content_create_threadatomic thread creation
fn_content_get_threads_by_tagtag-filtered thread listing
fn_get_thread_replies_pagepaginated replies
fn_content_get_trending_threadspublic trending threads
fn_content_get_personal_threadssigned-in personal feed
fn_content_get_following_threadsfollowing feed

Example DTO

ts
type CreateThreadDTO = {
  title: string
  content: string
  tagIds: string[]
  visibility: 'public' | 'community' | 'private'
}

Example flows

ts
await threadsService.getTrendingThreads('en', 0, 20)

Threads for a tag

ts
await threadsService.getThreadsByTag('workflows', 'newest', 0, 20)

Following feed

ts
await threadsService.getFollowingFeed(lenserId, 0, 20)

Create thread

ts
await threadsService.createThread({
  title: 'Sharing a local workflow pattern',
  content: 'Here is how I am chaining research and validation lenses locally.',
  tagIds: ['<tag-id>'],
  visibility: 'public',
})

Auth and access

OperationAuth
public listing/detailanon for public threads
personal/following feedsauthenticated
create reply / create threadauthenticated
update/delete threadowner-only

Notes

  • Thread creation is not a raw table-write contract in the repo; the web app uses fn_content_create_thread.
  • Reply reads support pagination through limit and offset.
  • Docs should describe thread visibility using the same public / community / private values used in CreateThreadDTO.