# Send a chat message as a logged-in user **POST /message/logged-in** ## Servers - Local development server: http://localhost:3000/api/v1 (Local development server) - Production server: https://referspecs-backend.onrender.com/api/v1 (Production server) ## Authentication methods - Bearer auth ## Parameters ### Body: application/json (object) - **prompt** (string) The user's chat message/prompt. - **stream** (boolean) Whether to receive the response as a stream (Server-Sent Events). - **chatId** (string) The CUID of the chat session. ## Responses ### 200 Chat response received (non-streaming) #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) - **data** (object) ### 400 Bad Request (e.g., missing prompt or chatId) #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) ### 401 Unauthorized #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) ### 403 Forbidden (User does not have access to this chat) #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) ### 404 Not Found (Chat session not found) #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) ### 500 Internal Server Error #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) ### 200_stream Chat response streamed successfully (SSE) #### Body: text/event-stream (string) string [Powered by Bump.sh](https://bump.sh)