> ## Documentation Index
> Fetch the complete documentation index at: https://docs.staging.questra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Content edit

> survey.content_edit — chat over programmed content with AI SDK UIMessage SSE.

Conversations edit programmed content with a survey-editor agent. Each user turn streams an AI SDK `UIMessage` response. Live chat uses the AI SDK `UIMessage` protocol, not the NDJSON progress stream.

<Info>
  The Program **Review** UI does **not** use this workflow as the document source of truth. Review keeps the Monaco buffer as document source of truth, runs coding-agent tools in the browser, persists chat via conversations, and writes tip revisions only on explicit Save. See [Review chat](/workflows/review-chat).
</Info>

## Send a message

```http theme={null}
POST /v1/surveys/{surveyId}/conversations/{conversationId}/messages
Content-Type: application/json

{ /* AI SDK UIMessage */ }
```

* Response: `text/event-stream` (UIMessage SSE)
* Client disconnect aborts the in-flight turn for that request

## Persistence and tip reconcile

| Channel                      | Role                                                      |
| ---------------------------- | --------------------------------------------------------- |
| UIMessage SSE                | Live tokens / parts for the turn                          |
| `GET .../messages`           | Persisted UIMessage history on reload                     |
| `POST .../messages/truncate` | Drop messages from a checkpoint (edit/regenerate flows)   |
| Webhook `content.updated`    | Fired when a successful turn finalizes a content revision |
| `GET .../content`            | Tip revision after finalize                               |

Tools may edit a draft; Save paths persist tip revisions explicitly (or via agent save tools).

## Not on `/workflows/.../stream` as UIMessage

Content-edit exposes UIMessage SSE on the conversation messages POST. Do not expect clarifications/programming/audit-style NDJSON chunks on `GET /v1/workflows/{id}/stream` for chat UX — use the conversation SSE body.

See [Live updates](/workflows/live-updates#surveycontent_edit).
