LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmith_openapi_clientresourcesThreadsquery
Method●Since v0.10

query

Query threads within a project (session), with cursor-based pagination. Returns threads matching the given time range and optional filters.

Self-hosted deployments require LangSmith v0.16 or later.

Copy
query(
  body: ThreadQueryParams,
  options: RequestOptions
): PagePromise<ThreadsItemsCursorPostPagination, Thread>

Parameters

NameTypeDescription
body*ThreadQueryParams
optionsRequestOptions

Example

Copy
// Automatically fetches more pages as needed.
for await (const thread of client.threads.query()) {
  // ...
}
View source on GitHub