---
title: "Send a webchat message"
method: POST
path: "/api/v1/chat"
tags: ["Chat"]
---

# Send a webchat message

`POST /api/v1/chat`

## Request body

- ChatRequest
  - `username` string — Caller-declared WebChat sender/session owner. This value is used as the message sender identity and may participate in sender-ID-based command permission checks. Treat chat-scoped API keys as trusted backend credentials and map or validate usernames before accepting end-user input.
  - `session_id` string
  - `conversation_id` string — Deprecated alias for session_id.
  - `message` union, required
    - string
    - MessagePart[]
      - `type` 'text' | 'plain' | 'image' | 'file' | 'audio' | 'record' | 'video' | 'reply', required
      - `text` string
      - `attachment_id` string
      - `url` string
      - `filename` string
      - `mime_type` string
  - `config_id` string
  - `config_name` string
  - `selected_provider` string
  - `selected_model` string
  - `enable_streaming` boolean
  - `_skip_user_history` boolean — Internal WebUI flag for edit/regenerate flows.
  - `_llm_checkpoint_id` string — Internal WebUI checkpoint override.
  - `_platform_history_id` string — Internal WebUI platform history override.
  - `_thread_selected_text` string — Internal WebUI side-thread context.

## Response `200`

Standard AstrBot success response

- SuccessEnvelope
  - `status` 'ok', required
  - `message` string
  - `data` unknown, required

## Changes

- **2026-06-14** `6b73b947caab` — 1 breaking, 3 warning, 16 info
  - removed the media type `text/event-stream` for the response with the status `200`
  - removed the request property `message/oneOf[subschema #2]/items/message_id`
  - removed the request property `message/oneOf[subschema #2]/items/path`
  - removed the request property `message/oneOf[subschema #2]/items/selected_text`
  - …16 more
- **2026-03-09** `3d43cee2622a` — 4 breaking, 6 warning, 10 info
  - the request property `username` became required
  - removed the enum value `audio` of the request property `message/oneOf[subschema #2]/items/type`
  - removed the enum value `text` of the request property `message/oneOf[subschema #2]/items/type`
  - removed the media type `application/json` for the response with the status `200`
  - …16 more

[Change history](https://skmtc.dev/astrbotdevs/apis/astrbot-openapi-v1/changes/api/v1/chat/post.md)

---

[API](https://skmtc.dev/astrbotdevs/apis/astrbot-openapi-v1.md) · [All operations](https://skmtc.dev/astrbotdevs/apis/astrbot-openapi-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/astrbotdevs/astrbot-openapi-v1/revisions/aa930a4e8e5e/schema)
