---
title: "Handle New Chat Message"
method: POST
path: "/chat/send-message"
---

# Handle New Chat Message

`POST /chat/send-message`

This endpoint is both used for all the following purposes:
- Sending a new message in the session
- Regenerating a message in the session (just send the same one again)
- Editing a message (similar to regenerating but sending a different message)

To avoid extra overhead/latency, this assumes (and checks) that previous messages on the path
have already been set as latest

## Request body

- CreateChatMessageRequest — Before creating messages, be sure to create a chat_session and get an id
  - `chat_session_id` integer, required
  - `parent_message_id` integer
  - `message` string, required
  - `prompt_id` integer
  - `search_doc_ids` integer[]
  - `retrieval_options` RetrievalDetails
    - `run_search` 'always' | 'never' | 'auto' — An enumeration.
    - `real_time` boolean
    - `filters` BaseFilters
      - `source_type` DocumentSource[]
      - `document_set` string[]
      - `time_cutoff` string, date-time
      - `tags` Tag[]
        - `tag_key` string, required
        - `tag_value` string, required
    - `enable_auto_detect_filters` boolean
    - `offset` integer
    - `limit` integer
  - `query_override` string
  - `no_ai_answer` boolean

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/engineertheory/apis/recap-backend.md) · [All operations](https://skmtc.net/engineertheory/apis/recap-backend/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/engineertheory/recap-backend/versions/ea9db8f9a24d/schema)
