Add Message to Chat
curl --request POST \
--url https://api.yourhomie.ai/v1/chats/{chatId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"currentUrl": "<string>"
}
'import requests
url = "https://api.yourhomie.ai/v1/chats/{chatId}/messages"
payload = {
"message": "<string>",
"currentUrl": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>', currentUrl: '<string>'})
};
fetch('https://api.yourhomie.ai/v1/chats/{chatId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.yourhomie.ai/v1/chats/{chatId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>',
'currentUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.yourhomie.ai/v1/chats/{chatId}/messages"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"currentUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.yourhomie.ai/v1/chats/{chatId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"currentUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yourhomie.ai/v1/chats/{chatId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"currentUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"chatId": "<string>",
"type": "<string>",
"content": "<string>",
"createdAt": "<string>",
"suggestions": [
"<string>"
],
"products": [
{
"gtin": "<string>",
"brand": "<string>",
"designation": "<string>",
"url": "<string>",
"image": "<string>",
"price": 123,
"currency": "<string>",
"priceInfo": "<string>",
"location": [
{
"key": "<string>",
"value": "<string>"
}
],
"availability": {
"status": "<string>",
"quantity": 123
},
"category": "<string>",
"query": "<string>",
"description": "<string>",
"recommendationText": "<string>",
"flags": [
{
"type": "<string>",
"title": "<string>",
"text": "<string>"
}
]
}
]
}Messages
Add Message
Send a user message to a chat and receive the assistant’s reply.
POST
/
v1
/
chats
/
{chatId}
/
messages
Add Message to Chat
curl --request POST \
--url https://api.yourhomie.ai/v1/chats/{chatId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"currentUrl": "<string>"
}
'import requests
url = "https://api.yourhomie.ai/v1/chats/{chatId}/messages"
payload = {
"message": "<string>",
"currentUrl": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>', currentUrl: '<string>'})
};
fetch('https://api.yourhomie.ai/v1/chats/{chatId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.yourhomie.ai/v1/chats/{chatId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>',
'currentUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.yourhomie.ai/v1/chats/{chatId}/messages"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"currentUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.yourhomie.ai/v1/chats/{chatId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"currentUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yourhomie.ai/v1/chats/{chatId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"currentUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"chatId": "<string>",
"type": "<string>",
"content": "<string>",
"createdAt": "<string>",
"suggestions": [
"<string>"
],
"products": [
{
"gtin": "<string>",
"brand": "<string>",
"designation": "<string>",
"url": "<string>",
"image": "<string>",
"price": 123,
"currency": "<string>",
"priceInfo": "<string>",
"location": [
{
"key": "<string>",
"value": "<string>"
}
],
"availability": {
"status": "<string>",
"quantity": 123
},
"category": "<string>",
"query": "<string>",
"description": "<string>",
"recommendationText": "<string>",
"flags": [
{
"type": "<string>",
"title": "<string>",
"text": "<string>"
}
]
}
]
}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 thex-api-key header.
Request
string
required
ID of the chat to add the message to.
string
Optional query parameter.
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.
Show MessageProductDto
Show MessageProductDto
string
required
Global Trade Item Number of the product.
string
required
Brand name.
string
required
Product name or designation.
string
required
URL of the product detail page.
string
required
URL of the product image.
number
required
Product price.
string
required
Currency code of the price, for example
EUR.string
Additional price information.
object[]
object
string
Product category.
string
Search query that surfaced the product.
string
Product description.
string
Text explaining why the product is recommended.
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
curl -X POST https://api.yourhomie.ai/v1/chats/ab12cd34-ef56-7890-ab12-cd34ef567890/messages \
-H "x-api-key: homie_sk_live_8f3a..." \
-H "Content-Type: application/json" \
-d '{
"message": "Do you have a waterproof jacket in blue?",
"currentUrl": "https://shop.example.com/jackets"
}'
const chatId = "ab12cd34-ef56-7890-ab12-cd34ef567890";
const res = await fetch(
`https://api.yourhomie.ai/v1/chats/${chatId}/messages`,
{
method: "POST",
headers: {
"x-api-key": "homie_sk_live_8f3a...",
"Content-Type": "application/json",
},
body: JSON.stringify({
message: "Do you have a waterproof jacket in blue?",
currentUrl: "https://shop.example.com/jackets",
}),
},
);
const message = await res.json();
Success response
{
"id": "9b8a7c6d-5e4f-4a3b-9c2d-1e0f2a3b4c5d",
"chatId": "ab12cd34-ef56-7890-ab12-cd34ef567890",
"type": "assistant",
"content": "Yes, here is a waterproof jacket available in blue.",
"suggestions": [
"What sizes are available?",
"Is it machine washable?"
],
"products": [
{
"gtin": "4006381333931",
"brand": "Acme",
"designation": "All-Weather Jacket",
"url": "https://shop.example.com/p/all-weather-jacket",
"image": "https://shop.example.com/img/all-weather-jacket.jpg",
"price": 129.99,
"currency": "EUR",
"availability": {
"status": "in_stock",
"quantity": 12
}
}
],
"createdAt": "2025-10-16T11:45:02.512Z"
}
Error response
{
"message": "Monthly message quota reached"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
⌘I