---
title: "Create Thread"
method: POST
path: "/threads"
tags: ["Threads"]
---

# Create Thread

`POST /threads`

Create a thread.

## Request body

- ThreadCreate — Payload for creating a thread.
  - `thread_id` string, uuid — The ID of the thread. If not provided, a random UUID will be generated.
  - `assistant_id` string, uuid — The assistant to bind to the thread.
  - `metadata` object — Metadata to add to thread.
  - `if_exists` 'raise' | 'do_nothing' — How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).

## Response `200`

Success

- Thread
  - `thread_id` string, uuid, required — The ID of the thread.
  - `created_at` string, date-time, required — The time the thread was created.
  - `updated_at` string, date-time, required — The last time the thread was updated.
  - `metadata` object, required — The thread metadata.
  - `status` 'idle' | 'busy' | 'interrupted' | 'error', required — The status of the thread.
  - `values` object — The current state of the thread.

## Other responses

- `409` — Conflict
- `422` — Validation Error

---

[API](https://skmtc.net/xpert-ai/apis/agent-protocol.md) · [All operations](https://skmtc.net/xpert-ai/apis/agent-protocol/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xpert-ai/agent-protocol/versions/ac9dbe16ea2f/schema)
