Skip to main content

Overview

Returns all threads owned by the authenticated user with pagination support. Results are ordered by creation date (newest first) and include project and sandbox information.
This endpoint automatically triggers background embedding of unembedded threads for semantic search functionality.

Request

integer
default:1
Page number (1-based). Must be greater than or equal to 1.
integer
default:100
Number of items per page. Must be between 1 and 1000.

Authentication

Requires a valid JWT token via verify_and_get_user_id_from_jwt.
cURL
Python SDK
JavaScript SDK

Response

array
required
Array of thread objects
object
required
Pagination metadata

Response Example

Empty Results

When no threads are found:

Background Processing

When threads are returned, a background task is automatically triggered to embed any unembedded threads for semantic search. This is non-blocking and doesn’t affect the response time.

Error Responses

Implementation Details

  • Threads are ordered by created_at DESC (newest first)
  • The query uses a window function to get total count without a separate query
  • Results include project and sandbox information via LEFT JOINs
  • Maximum limit is 1000 items per page

Source Reference

Implementation: /workspace/source/backend/core/threads/api.py:96
Repository function: /workspace/source/backend/core/threads/repo.py:16