curl --request POST \
--url https://api.example.com/v1/chat \
--header 'Content-Type: application/json' \
--data '
{
"sessionId": "<string>",
"message": "<string>"
}
'{
"conversationId": "<string>",
"message": "<string>"
}Send a chat message and receive a complete response
curl --request POST \
--url https://api.example.com/v1/chat \
--header 'Content-Type: application/json' \
--data '
{
"sessionId": "<string>",
"message": "<string>"
}
'{
"conversationId": "<string>",
"message": "<string>"
}POST /v1/chat
x-api-key: Your widget API keyx-widget-api-key: Your widget API key (alternative)^[A-Za-z0-9._:-]{1,128}$.Used to track conversation history across multiple requests. Use the same sessionId for continuation of a conversation.{
"sessionId": "user-123",
"message": "What are your business hours?"
}
{
"conversationId": "j97ch2kj8xm6rpct8te5w9b1fh6pc7k8",
"message": "Our business hours are Monday through Friday, 9 AM to 5 PM EST."
}
{
"error": "Invalid request payload"
}
{
"error": "Unauthorized"
}
{
"error": "Too many requests"
}
{
"error": "Internal server error"
}
curl -X POST https://your-api-domain.com/v1/chat \
-H "Content-Type: application/json" \
-H "x-api-key: your-api-key-here" \
-d '{
"sessionId": "user-123",
"message": "Hello, I need help with my account"
}'
const response = await fetch('https://your-api-domain.com/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'your-api-key-here'
},
body: JSON.stringify({
sessionId: 'user-123',
message: 'Hello, I need help with my account'
})
});
const data = await response.json();
console.log(data.message);
import requests
response = requests.post(
'https://your-api-domain.com/v1/chat',
headers={
'Content-Type': 'application/json',
'x-api-key': 'your-api-key-here'
},
json={
'sessionId': 'user-123',
'message': 'Hello, I need help with my account'
}
)
data = response.json()
print(data['message'])
/v1/chat/stream endpoint instead