Overview
Retrieves comprehensive details about a thread, including project information, sandbox configuration, message count, and recent agent runs.This endpoint supports both authenticated and unauthenticated access. Public threads can be accessed without authentication.
Request
string
required
The unique identifier of the thread to retrieve
Authentication
Optional JWT token. If provided, validates user access to private threads.cURL
Python SDK
JavaScript SDK
Response
string
required
The unique identifier of the thread
string
The project this thread belongs to
string
required
The name of the thread (defaults to “New Chat”)
object
required
Additional thread metadata (custom key-value pairs)
boolean
required
Whether the thread is publicly accessible
string
required
ISO 8601 timestamp of thread creation
string
required
ISO 8601 timestamp of last update
object
Associated project details
integer
required
Total number of messages in the thread
array
required
List of recent agent execution runs
boolean
Only present for threads in pending state (optimistic creation)
Response Example
Special Behaviors
Pending Threads
If a thread was just created using optimistic creation and hasn’t been persisted to the database yet, the endpoint returns a minimal response with_pending: true:
Automatic Sandbox Startup
When retrieving a thread with an existing sandbox, the sandbox is automatically started in the background (non-blocking) to ensure it’s ready for use.Error Responses
Source Reference
Implementation:/workspace/source/backend/core/threads/api.py:411