Skip to main content
POST
Add Message to Chat
Add a user message to a chat. The assistant processes the message and returns a reply, which may include follow-up suggestions and product recommendations.

Authentication

This request requires your API key in the x-api-key header.

Request

string
required
ID of the chat to add the message to.
string
Identifier of the store selected in your app. For BAUHAUS, use the numeric Fachcentrum number, for example 856. Send the current selection with every message.
string
required
The user’s message text.
string
required
The URL of the page the user is currently viewing. Used to give the assistant page context.

Response

string
required
ID of the created message.
string
required
ID of the chat the message belongs to.
string
required
The message type, for example whether it originated from the user or the assistant.
string
required
The message text content.
string[]
Optional list of suggested follow-up questions.
object[]
Optional list of recommended products.
string
required
ISO 8601 timestamp of when the message was created.
To receive the assistant’s streamed response and tool activity in real time, open the Message Events stream for the same chatId.

Examples

Success response

Error response

BAUHAUS shelf locations

For BAUHAUS web assistants, store identifies the Fachcentrum selected in your app. Send its current store number with every message. Naming another Fachcentrum in the message does not change the app’s selection. For a shelf question, the assistant can look up known BAUHAUS article numbers in the selected Fachcentrum. When store search is enabled, it can also resolve a different Fachcentrum named in the conversation and retrieve its shelf data separately. If the Fachcentrum cannot be resolved, the assistant asks for clarification or for the customer to select it in the app; it must not substitute the selected Fachcentrum’s shelves. Stock and shelf data are independent. A successful BAUHAUS response may supply no shelf for an otherwise available product. The assistant distinguishes this from a failed lookup and does not infer availability from a shelf location.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

chatId
string
required

Query Parameters

store
string

Body

application/json
message
string
required
currentUrl
string
required

Response

201 - application/json
id
string
required
chatId
string
required
type
string
required
content
string
required
createdAt
string
required
suggestions
string[]
products
object[]