Create Chat
curl --request POST \
--url https://api.yourhomie.ai/v1/chats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chatbotId": "<string>",
"userId": "<string>"
}
'import requests
url = "https://api.yourhomie.ai/v1/chats"
payload = {
"chatbotId": "<string>",
"userId": "<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({chatbotId: '<string>', userId: '<string>'})
};
fetch('https://api.yourhomie.ai/v1/chats', 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",
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([
'chatbotId' => '<string>',
'userId' => '<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"
payload := strings.NewReader("{\n \"chatbotId\": \"<string>\",\n \"userId\": \"<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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chatbotId\": \"<string>\",\n \"userId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yourhomie.ai/v1/chats")
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 \"chatbotId\": \"<string>\",\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"chatbotId": "<string>",
"userId": "<string>",
"organizationId": "<string>",
"createdAt": "<string>"
}Chats
Create Chat
Start a new conversation for a chatbot and receive a chat ID.
POST
/
v1
/
chats
Create Chat
curl --request POST \
--url https://api.yourhomie.ai/v1/chats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chatbotId": "<string>",
"userId": "<string>"
}
'import requests
url = "https://api.yourhomie.ai/v1/chats"
payload = {
"chatbotId": "<string>",
"userId": "<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({chatbotId: '<string>', userId: '<string>'})
};
fetch('https://api.yourhomie.ai/v1/chats', 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",
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([
'chatbotId' => '<string>',
'userId' => '<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"
payload := strings.NewReader("{\n \"chatbotId\": \"<string>\",\n \"userId\": \"<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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chatbotId\": \"<string>\",\n \"userId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yourhomie.ai/v1/chats")
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 \"chatbotId\": \"<string>\",\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"chatbotId": "<string>",
"userId": "<string>",
"organizationId": "<string>",
"createdAt": "<string>"
}Create a new chat for one of your chatbots. The returned
chatId is required for sending messages and reading the conversation.
Authentication
This request requires your API key in thex-api-key header.
Request
string
required
ID of the chatbot the chat belongs to.
string
Optional ID identifying the end user. Use it to associate a chat with a known user in your system.
Response
string
required
ID of the created chat. Use it as the
chatId in later requests.string
required
ID of the chatbot the chat belongs to.
string
required
ID of the associated end user.
string
required
ID of the organization that owns the chat.
string
required
ISO 8601 timestamp of when the chat was created.
Examples
curl -X POST https://api.yourhomie.ai/v1/chats \
-H "x-api-key: homie_sk_live_8f3a..." \
-H "Content-Type: application/json" \
-d '{
"chatbotId": "5e9c1a2b-3d4e-4f60-b2f2-9f4b1c2d3e4f"
}'
const res = await fetch("https://api.yourhomie.ai/v1/chats", {
method: "POST",
headers: {
"x-api-key": "homie_sk_live_8f3a...",
"Content-Type": "application/json",
},
body: JSON.stringify({
chatbotId: "5e9c1a2b-3d4e-4f60-b2f2-9f4b1c2d3e4f",
}),
});
const chat = await res.json();
Success response
{
"id": "ab12cd34-ef56-7890-ab12-cd34ef567890",
"chatbotId": "5e9c1a2b-3d4e-4f60-b2f2-9f4b1c2d3e4f",
"userId": "7c2f9d10-4a6b-4c8e-9f1a-2b3c4d5e6f70",
"organizationId": "11111111-2222-3333-4444-555555555555",
"createdAt": "2025-10-16T11:44:41.140Z"
}
Error response
{
"message": "Invalid API key"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.