---
title: "Chat Message"
method: POST
path: "/api/chat/message"
tags: ["chat"]
---

# Chat Message

`POST /api/chat/message`

Unified chat endpoint - Supports both anonymous and verified users.

For VERIFIED users (identity_token provided):
- JWT is verified using product's verification_secret
- User data is upserted to product_users table
- Conversation is persisted using PostgresSaver
- Returns conversation_id for future reference

For ANONYMOUS users (no identity_token):
- Conversation persisted to database via shared anonymous product_user
- Chat memory uses MemorySaver (in-memory, session-only)
- Returns conversation_id for tracking

## Request body

- ChatMessageRequest
  - `product_id` string, required
  - `message` string, required
  - `conversation_id` string, nullable
  - `identity_token` string, nullable
  - `model` string, nullable
  - `user_timezone` string, nullable
  - `user_local_time` string, nullable
  - `page_path` string, nullable
  - `context` object, nullable
  - `agent_mode` string, nullable
  - `subdomain` string, nullable
  - `language` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/usecrow/apis/crow-backend-multi-tenant-saas.md) · [All operations](https://skmtc.dev/usecrow/apis/crow-backend-multi-tenant-saas/llms.txt) · [OpenAPI document](https://skmtc.dev/usecrow/apis/crow-backend-multi-tenant-saas/revisions/66e6366f8ef9?raw)
