Skip to main content
GET

Authentication

Required: JWT Bearer token JWT Claims Extraction (Lines 39-43):

Query Parameters

integer
default:"20"
Maximum threads to returnValidation: None (controller accepts any integer)Default: 20 (Line 34)Range: Not enforced by API contract (database-dependent)

Response

array
Array of thread objects

Authorization

Ownership Filter (Line 50):
Guaranteed Behavior:
  • Returns ONLY threads owned by authenticated user
  • userId extracted from JWT claims
  • No visibility filtering (returns all user’s threads regardless of visibility)
Visibility Rules:
  • User sees all their own threads (private, public, unlisted)
  • User NEVER sees threads owned by others

Side Effects

Database Reads (Line 50):
  • SELECT from threads table WHERE user_id = userId
  • Ordered by creation date (descending, assumed from service)
No Database Writes: Read-only endpoint

Permissions

Who Can Read:
  • Authenticated user (their own threads only)
Who Cannot Read:
  • Unauthenticated users
  • Other authenticated users (cross-user access forbidden)

Edge Cases

  1. Missing user ID claim: 401 error (Lines 45-48)
  2. Zero threads: Returns {"items": []} (empty array)
  3. Limit = 0: Behavior not enforced by server contract (service-dependent)
  4. Limit < 0: Behavior not enforced by server contract (service-dependent)
  5. Limit > database max: Service may cap internally (not documented)

Error Conditions

Exception Handling (Lines 54-62):
  • All service exceptions return 500
  • Error message exposed to client

Pagination Behavior

Current Implementation: Simple limit-based No Cursor/Offset: Controller does not support pagination beyond limit Ordering: Not specified by API contract (service-defined) Server Contract: Returns first limit threads (ordering implementation-defined)

Performance Characteristics

Database Query: Single SELECT with WHERE clause Index Requirements: threads.user_id should be indexed for performance Response Size: Proportional to limit value (uncapped by controller)