---
title: "Unified V3 chat handler"
method: POST
path: "/api/v3/ai/conversation/{conversationId}/chat"
tags: ["AI Conversation"]
---

# Unified V3 chat handler

`POST /api/v3/ai/conversation/{conversationId}/chat`

## Request

- Base URL: `https://stackby.com`
- URL: `https://stackby.com/api/v3/ai/conversation/{conversationId}/chat`
- Auth: none declared

Handles PLAN phase (create/modify) and EXECUTE/REJECT phase.

**PLAN phase** (when action is not present):
- If stackId provided → MODIFY existing stack
- If no stackId → CREATE new stack
- LLM generates plan, stores in context.v3Plan, waits for approval

**EXECUTE/REJECT phase** (when action is present):
- If approve → executes via ActionExecutor
- If reject → clears plan and resets phase

Response is Server-Sent Events (SSE) stream.

## Path parameters

- `conversationId` string, required

## Request body

- object
  - `message` string
  - `stackId` string
  - `isCreateFlow` boolean
  - `userSettings` object
    - `companyName` string
    - `industryType` string
    - `team` string
  - `answers` union[]
    - union
      - object
        - `question` string, required
        - `answer` string, required
      - string
  - `web_search` boolean
  - `action` 'approve' | 'reject'

## Response `200`

Server-Sent Events stream with conversation updates

## Other responses

- `400`: Validation error
- `500`: Server error

---

[API](https://skmtc.dev/stackby/apis/stackby-api-complete-documentation.md) - [All operations](https://skmtc.dev/stackby/apis/stackby-api-complete-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/stackby/apis/stackby-api-complete-documentation/revisions/c9909a003a56?raw)
