---
title: "Create a thread"
method: POST
path: "/v1/fleet/threads"
tags: ["fleet threads"]
---

# Create a thread

`POST /v1/fleet/threads`

Create a thread, optionally bound to an agent. Subsequent runs are started on it via `POST /v1/fleet/threads/{thread_id}/runs/stream`.

## Request body

- ThreadsCreateThreadRequest
  - `agent_id` string
  - `if_exists` 'do_nothing' | 'raise'
  - `metadata` object
  - `options` ThreadsCreateThreadOptions
    - `skip_memory_write_protection` boolean — SkipMemoryWriteProtection lets runs on this thread bypass the default long-term-memory write protection.
    - `test_run` boolean — TestRun marks the thread as a test run; filtered out of usage and analytics.
  - `thread_id` string, uuid

## Response `201`

Created

- ThreadsThread
  - `agent_id` string, uuid
  - `created_at` string, date-time
  - `id` string, uuid
  - `metadata` object
  - `status` 'idle' | 'busy' | 'interrupted' | 'error'
  - `updated_at` string, date-time

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `409` — Conflict
- `502` — Bad Gateway

---

[API](https://skmtc.net/langchain-ai/apis/langsmith.md) · [All operations](https://skmtc.net/langchain-ai/apis/langsmith/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langchain-ai/langsmith/revisions/a0acb3a6a101/schema)
