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

# Send a webchat message

`POST /api/v1/chat`

**Required scope:** `chat`

**Conditional sensitive scope:** `chat:admin`

## Request body

- ChatRequest
  - `username` string — Caller-declared WebChat sender/session owner. Configured AstrBot administrator IDs require the chat:admin API key sub-scope.
  - `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
      - `stored_filename` string
      - `mime_type` string
  - `config_id` string
  - `config_name` string
  - `selected_provider` string
  - `selected_model` string
  - `enable_streaming` boolean — Deprecated compatibility field. It is used only when flags.enable_streaming is absent; otherwise flags.enable_streaming takes priority.
  - `flags` ChatFlags — Per-request ChatUI feature flags. A value here takes priority over its legacy top-level field, followed by the documented default.
    - `enable_inline_genui` boolean — Inject the inline HTML GenUI system prompt for this request.
    - `enable_default_system_prompt` boolean — Allow the ChatUI default system prompt when no persona overrides it.
    - `enable_streaming` boolean — Enable streaming model output for this request. This value takes priority over the legacy top-level enable_streaming field.
  - `_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

---

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