---
title: Send a message / start a turn in a thread
description: "Appends a turn and its message.user to the thread, then streams the turn's output on the event stream; the run stays alive between turns (idle, not ended)."
api_method: POST
api_path: "/v1/agent-runs/{runId}/threads/{threadId}/turns"
canonical_url: https://wiblo.app/docs/developers/api/agent-threads/create-agent-turn
last_updated: 2026-07-28T17:31:44+02:00
md_url: https://wiblo.app/docs/developers/api/agent-threads/create-agent-turn.md
---

# Send a message / start a turn in a thread

`POST /v1/agent-runs/{runId}/threads/{threadId}/turns`

Appends a turn and its `message.user` to the thread, then streams the turn's output on the event stream; the run stays alive between turns (`idle`, not `ended`). A `409` `turn_already_active` is returned if a turn is already running in the thread and the provider cannot start a second — the client should steer or wait. Per-user rate-limited at 30/60s.

## Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `runId` | `string` | Yes |  |
| `threadId` | `string` | Yes |  |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | `CreateAgentRunMessage` | Yes |  |

### The CreateAgentRunMessage object

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | No |  |
| `content` | `array<AgentUserContent>` | Yes |  |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/agent-runs/{runId}/threads/{threadId}/turns \
  -X POST \
  -H "Authorization: Bearer $WIBLO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "message": {
    "content": []
  }
}'
```

**TypeScript**

```ts
import { createSdk, createAgentTurn } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await createAgentTurn({
  client: sdk,
  path: { runId: "...", threadId: "..." },
  body: {
    "message": {
      "content": []
    }
  },
})
```

## Responses

**`201`** — The turn was created; output streams via events. Returns `TurnResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `turn` | `AgentTurn` | Yes |  |
| `latestSeq` | `integer` | Yes |  |

**`400`** — Request body failed Zod validation (`VALIDATION_FAILED`). Returns `ApiErrorEnvelope`.

**`401`** — No valid session cookie or `wbl_*` bearer was present. Returns `ApiErrorEnvelope`.

**`404`** — No thread visible to the caller with this id in this run (`AGENT_THREAD_NOT_FOUND`). Returns `ApiErrorEnvelope`.

**`409`** — A turn is already running in this thread (`TURN_ALREADY_ACTIVE`). Returns `ApiErrorEnvelope`.

**`422`** — Path param failed UUID validation (`INVALID_PARAMS`). Returns `ApiErrorEnvelope`.

**`429`** — Rate limit exceeded. The body's `error.code` is `RATE_LIMITED` and `error.details.retry_after` is the same number of seconds as the `Retry-After` header. Returns `ApiErrorEnvelope`.

### The AgentTurn object

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes |  |
| `threadId` | `string` | Yes |  |
| `runId` | `string` | Yes |  |
| `status` | `"running" \| "completed" \| "aborted" \| "awaiting_approval" \| "awaiting_input" \| "error"` | Yes |  |
| `startedSeq` | `integer` | Yes |  |
| `createdAt` | `string` | Yes |  |
| `completedAt` | `string \| null` | Yes |  |
