Send Message
POST /api/v1/message
Sends a user message to a specific chatbot and streams back plain‑text response chunks (Content-Type: text/plain
).
Request Body
Section titled “Request Body”{ "chatbotId": "test101", "email": "user@example.com", "message": "Hello, can you help me?"}
Success Response (200)
Section titled “Success Response (200)”- Streamed text response body, chunked.
Error Responses
Section titled “Error Responses”- 400:
{ "message": "invalid request body" }
- 401:
{ "message": "api key expired|invalid|missing" }
- 404:
{ "message": "Chatbot not found|email missing|no context" }
- 500:
{ "message": "failed to stream response" }
Example (Node.js, fetch stream)
Section titled “Example (Node.js, fetch stream)”const resp = await fetch('https://message.geneline-x.net/api/v1/message', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': process.env.GENISTUDIO_API_KEY!, }, body: JSON.stringify({ chatbotId, email, message })});const reader = resp.body?.getReader();let text = '';while (true) { const { done, value } = await reader.read(); if (done) break; text += new TextDecoder().decode(value);}console.log(text);