---
title: "Agent Editor Chat"
method: POST
path: "/v3/agent-editor/chat"
tags: ["agent-editor"]
---

# Agent Editor Chat

`POST /v3/agent-editor/chat`

## Request

- Base URL: `https://api.mentium.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mentium.io/v3/agent-editor/chat`
- Auth: HTTP bearer

Send a message to the agent editor AI. Returns SSE stream.

Auth and workspace scoping are independent here because this endpoint is
dual-mode: catalog edits have no workspace, agent edits do.

## Headers

- `mentium-workspace-id` string, nullable

## Request body

- AgentEditorChatRequest: Request body for the agent editor chat endpoint.
  - `message` string, required
  - `target_kind` 'agent' | 'catalog': Whether editing an agent or a catalog template
  - `draft_id` string, nullable: Draft agent ID to continue editing. If None, a new draft is created.
  - `agent_id` string, nullable: Existing agent ID to create an edit-draft from.
  - `catalog_entry_id` string, nullable: Catalog entry ID when target_kind is 'catalog'.
  - `agent_type` 'text' | 'phone': Agent type: 'text' or 'phone'
  - `yaml_content` string, nullable: Current agent.yaml from the frontend. When provided, the editor draft is updated with this content before the AI runs.
  - `conversation` ConversationMessage[]: Previous messages in this session (from frontend state). Backend uses this instead of server-persisted history.
    - `role` 'user' | 'assistant', required: Message role
    - `content` string, required: Message text

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

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