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

# Create a thread and start a run

`POST /v1/fleet/threads/runs`

Creates a thread bound to `agent_id` and starts a run on it in one call. Returns the upstream run record (pending/running, not yet complete). Run kwargs are passed through; thread-creation flags go in the optional `thread` envelope. The new thread is rolled back if the run fails to start.

## Request body

- ThreadsCreateThreadAndRunRequest
  - `agent_id` string
  - `thread` ThreadsCreateThreadAndRunThread
    - `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 `200`

OK

- object

## Other responses

- `201` — Created
- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `409` — Conflict
- `422` — Unprocessable Entity
- `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)
