---
title: "New chat"
method: POST
path: "/chat/threads"
tags: ["chat"]
---

# New chat

`POST /chat/threads`

## Request

- Base URL: `https://www.dench.com/api/v1`
- URL: `https://www.dench.com/api/v1/chat/threads`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Start a new chat-turn workflow.

## Request body

- object
  - `environment` string
  - `prompt` string, required: The user message that starts the turn.
  - `model` string
  - `fileContextPath` string
  - `visibility` 'private' | 'shared'
  - `yolo` boolean: Bypass approval gates for this turn.
  - `title` string

## Response `200`

Successful response

- object
  - `threadId` string, required
  - `runId` string, required
  - `workflowRunId` string, nullable, required
  - `threadUrl` string, required: Web URL of the thread.
  - `streamUrl` string, required: SSE stream URL for the live response.
  - `yolo` boolean, required

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid authentication
- `404`: Operation or resource not found
- `500`: Server error

---

[API](https://skmtc.dev/dench/apis/dench-api.md) - [All operations](https://skmtc.dev/dench/apis/dench-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dench/apis/dench-api/revisions/4a145b38f19c?raw)
