# list_threads

> **Method** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/client/Client/list_threads)

List threads and fetch the runs for each thread.

.. admonition:: Deprecated

    Use :meth:`langsmith.Client.threads.query` instead.
    See https://docs.langchain.com/langsmith/smithdb-sdk-migration#threads-query for the migration guide.
    Will be removed after Jan 31, 2027.

## Signature

```python
list_threads(
    self,
    *,
    project_id: Optional[ID_TYPE] = None,
    project_name: Optional[str] = None,
    limit: Optional[int] = None,
    offset: int = 0,
    filter: Optional[str] = None,
    start_time: Optional[datetime.datetime] = None,
) -> list[ListThreadsItem]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | `Optional[ID_TYPE]` | No | The project (session) id. (default: `None`) |
| `project_name` | `Optional[str]` | No | The project name (alternative to project_id). (default: `None`) |
| `limit` | `Optional[int]` | No | Maximum number of threads to return. Default None (no limit). (default: `None`) |
| `offset` | `int` | No | Pagination offset for threads. Default 0. (default: `0`) |
| `filter` | `Optional[str]` | No | Optional filter for threads and runs. (default: `None`) |
| `start_time` | `Optional[datetime.datetime]` | No | Only include runs from this time. Default: 1 day ago. (default: `None`) |

## Returns

`list[ListThreadsItem]`

List of thread items, each with "thread_id", "runs", "count",

## ⚠️ Deprecated

list_threads() is deprecated and will be removed after Jan 31, 2027. Use client.threads.query() instead. See https://docs.langchain.com/langsmith/smithdb-sdk-migration#threads-query for the migration guide.

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/3f9fe09d8e0698d65aa8bb63ac3316dfcb2ca947/python/langsmith/client.py#L4534)