GET /api/threads/{id}
Retrieve a single thread by ID
GET
Authentication
Conditional (Line 116):[AllowAnonymous]
Public sharing enabled: Authentication optional for public/unlisted threads
Private threads: Authentication required
JWT Claims Extraction (Lines 138-142):
Path Parameters
string
required
Thread UUIDFormat: Valid GUIDValidation: Route constraint
:guid (Line 115)Response
string
UUID identifier
string
Owner UUID
string
Thread title
string
"private", "public", or "unlisted"string
ISO8601 UTC timestamp
string
ISO8601 UTC timestamp
Authorization Logic
Feature Flag Check (Line 134):PUBLIC_SHARING Feature Flag States
Side Effects
Database Reads (Lines 121, 134):- SELECT from
threadstable WHEREthread_id = {id} - SELECT from
system_settingstable WHEREkey = 'public_sharing'
Permissions
Who Can Read:- Public threads (when
public_sharing = true): Anyone - Unlisted threads (when
public_sharing = true): Anyone with the link - Private threads: Owner only
- Any visibility (when
public_sharing = false): Owner only
private: Requires auth + ownershippublic: Visible to all when feature enabledunlisted: Visible to all when feature enabled, but not listed in search/discovery
Edge Cases
- Thread doesn’t exist: 404 (Lines 123-131)
- Invalid GUID format: 400 (route constraint, not in controller code)
- Deleted thread: 404 (service returns null)
- Feature flag missing: Treated as
false(default behavior assumed) - User ID claim missing for public thread: Allowed (auth optional, Lines 137-142)
- User ID claim present but thread private: Ownership check applies (Line 169)
Error Conditions
Exception Handling (Lines 181-189):
Behavioral Guarantees
Visibility Check Order:- Thread existence (404 if not found)
- Feature flag + visibility (public access allowed here)
- Authentication (401 if required but missing)
- Ownership (403 if private + wrong owner)
public_sharing setting controls anonymous access
Security Implications
Public Exposure Risk: Whenpublic_sharing = true:
- Public threads visible without authentication
- Unlisted threads accessible via direct link (URL guessing possible)
- No rate limiting documented