---
title: "Send Message"
method: POST
path: "/api/v1/chat-ai/conversations/{conversation_id}/message"
tags: ["chat-ai", "chat_messages"]
---

# Send Message

`POST /api/v1/chat-ai/conversations/{conversation_id}/message`

Send a message to a conversation and stream the agent's response via SSE.

This endpoint:
1. Validates ownership (user must own the conversation)
2. Persists the user message
3. Updates conversation metadata (title, preview, message_count)
4. Creates langgraph_thread_id if missing
5. Streams agent response via SSE with events: token, tool_start, tool_end, done, error
6. Persists the assistant message after completion

SSE Events:
- token: {"delta": "...", "conversation_id": "...", "client_message_id": "..."}
- tool_start: {"tool_name": "...", "tool_call_id": "..."}
- tool_end: {"tool_call_id": "...", "success": true/false}
- done: {"conversation_id": "...", "message_id": "..."}
- error: {"message": "..."}
- heartbeat: {}

## Path parameters

- `conversation_id` string, uuid, required

## Request body

- ChatMessageCreate — Schema for sending a message to a conversation (SSE streaming endpoint).
  - `content` string, required
  - `client_message_id` string, nullable — Optional client-side message ID for correlation
  - `attachments` ChatAttachmentIn[], nullable
    - `s3_key` string, required
    - `filename` string, required
    - `content_type` 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'text/plain' | 'text/csv' | 'text/markdown' | 'application/json', required
    - `file_size` integer, required
  - `page_context` PageContext — Where the person was standing when they sent this message. The chat panel follows the user through the app, so without this every conversation opens by re-establishing context the app already has. Assembled client-side from the URL and the workspace date range rather than from any page's internal state — the reporting filters are URL-backed by design, which keeps the chat surface from importing a page's internals and makes a filtered view the agent describes the same one a person could paste to a colleague. Every field is optional and the whole object may be absent: an older client, or any surface that does not supply it, must produce exactly the prompt it produces today.
    - `route` string, required
    - `filters` object, nullable
    - `date_range` PageDateRange — The workspace date range in force when the message was sent.
      - `start_date` string, required
      - `end_date` string, required
      - `preset` string, required
    - `dashboard_id` string, nullable
    - `category_id` string, nullable
    - `property_id` string, nullable
    - `website_page_path` string, nullable
    - `annotations` PageAnnotation[], nullable
      - `label` integer, required
      - `x` number, required
      - `y` number, required
      - `w` number, required
      - `h` number, required
      - `text` string, nullable
    - `available_routes` RouteOption[], nullable
      - `href` string, required
      - `name` string, required
      - `section` string, required
      - `description` string, nullable
  - `approve_writes` boolean
  - `skill_slug` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-03** `d65b8fefae34` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2026-09-03** `fbb95eac3965` — 3 info
  - added the new optional request property `page_context/anyOf[subschema #1: PageContext]/annotations`
  - added the new optional request property `page_context/anyOf[subschema #1: PageContext]/property_id`
  - added the new optional request property `page_context/anyOf[subschema #1: PageContext]/website_page_path`

[Change history](https://skmtc.dev/getanana/apis/cleon-api/changes/api/v1/chat-ai/conversations/:conversation_id/message/post.md)

---

[API](https://skmtc.dev/getanana/apis/cleon-api.md) · [All operations](https://skmtc.dev/getanana/apis/cleon-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getanana/cleon-api/revisions/a9141b6e4e7e/schema)
