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

# Create a thread

`POST /threads`

Create a thread with an initial message and optionally wait for the agent response.

## Request body

- object
  - `projectId` string, uuid — Project to create the thread in. Auto-filled from CLI and SDK context when omitted.
  - `message` string, required — Initial user message that starts the thread.
  - `wait` boolean — Whether the server should wait for the agent run before responding.
  - `timeoutSeconds` integer — Maximum seconds to wait when wait is true before handing off to polling.
  - `automationId` string, uuid — Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run.
  - `ambientServiceRun` unknown

## Response `201`

OK

- object — Deferred run result for creating a thread.
  - `completed` boolean, required — Whether the run has reached a terminal status.
  - `threadId` string, uuid, required — Thread ID associated with the run.
  - `runId` string, uuid, required — Run ID for subsequent polling.
  - `messageId` string, uuid — ID of the user message that triggered this run.
  - `status` 'processing' | 'completed' | 'aborted' | 'error', required — Current run lifecycle status.
  - `response` string, nullable, required — Assistant response text when the run has completed.

---

[API](https://skmtc.dev/sazabi/apis/sazabi-public-api.md) · [All operations](https://skmtc.dev/sazabi/apis/sazabi-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sazabi/sazabi-public-api/revisions/1d12b71c735a/schema)
