Reply to a conversation
curl --request POST \
--url https://app.livechatai.com/api/v2/conversations/{conversationId}/reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"message": "Thank you for your question. I'll help you with that right away.",
"userId": "user_1234567890",
"messageType": "TEXT",
"attachments": [
{
"url": "https://cdn.example.com/bot/chat/abc/messages/file.pdf",
"name": "report.pdf",
"mimeType": "application/pdf",
"size": 123
}
]
}
EOFimport requests
url = "https://app.livechatai.com/api/v2/conversations/{conversationId}/reply"
payload = {
"message": "Thank you for your question. I'll help you with that right away.",
"userId": "user_1234567890",
"messageType": "TEXT",
"attachments": [
{
"url": "https://cdn.example.com/bot/chat/abc/messages/file.pdf",
"name": "report.pdf",
"mimeType": "application/pdf",
"size": 123
}
]
}
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: 'Thank you for your question. I\'ll help you with that right away.',
userId: 'user_1234567890',
messageType: 'TEXT',
attachments: [
{
url: 'https://cdn.example.com/bot/chat/abc/messages/file.pdf',
name: 'report.pdf',
mimeType: 'application/pdf',
size: 123
}
]
})
};
fetch('https://app.livechatai.com/api/v2/conversations/{conversationId}/reply', 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://app.livechatai.com/api/v2/conversations/{conversationId}/reply",
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' => 'Thank you for your question. I\'ll help you with that right away.',
'userId' => 'user_1234567890',
'messageType' => 'TEXT',
'attachments' => [
[
'url' => 'https://cdn.example.com/bot/chat/abc/messages/file.pdf',
'name' => 'report.pdf',
'mimeType' => 'application/pdf',
'size' => 123
]
]
]),
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://app.livechatai.com/api/v2/conversations/{conversationId}/reply"
payload := strings.NewReader("{\n \"message\": \"Thank you for your question. I'll help you with that right away.\",\n \"userId\": \"user_1234567890\",\n \"messageType\": \"TEXT\",\n \"attachments\": [\n {\n \"url\": \"https://cdn.example.com/bot/chat/abc/messages/file.pdf\",\n \"name\": \"report.pdf\",\n \"mimeType\": \"application/pdf\",\n \"size\": 123\n }\n ]\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://app.livechatai.com/api/v2/conversations/{conversationId}/reply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Thank you for your question. I'll help you with that right away.\",\n \"userId\": \"user_1234567890\",\n \"messageType\": \"TEXT\",\n \"attachments\": [\n {\n \"url\": \"https://cdn.example.com/bot/chat/abc/messages/file.pdf\",\n \"name\": \"report.pdf\",\n \"mimeType\": \"application/pdf\",\n \"size\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.livechatai.com/api/v2/conversations/{conversationId}/reply")
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\": \"Thank you for your question. I'll help you with that right away.\",\n \"userId\": \"user_1234567890\",\n \"messageType\": \"TEXT\",\n \"attachments\": [\n {\n \"url\": \"https://cdn.example.com/bot/chat/abc/messages/file.pdf\",\n \"name\": \"report.pdf\",\n \"mimeType\": \"application/pdf\",\n \"size\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "User reply sent successfully",
"data": {
"messageId": "msg_1234567890",
"conversationId": "chat_1234567890",
"message": {
"id": "msg_1234567890",
"text": "Thank you for your question. I'll help you with that right away.",
"sender": "AGENT",
"type": "TEXT",
"attachments": [
{
"id": "<string>",
"url": "<string>",
"name": "<string>",
"mimeType": "<string>",
"size": 123
}
],
"createdAt": "2024-01-20T14:45:00Z",
"agent": {
"id": "agent_1234567890",
"name": "Jane Smith",
"email": "jane@company.com",
"avatar": "https://example.com/avatar.jpg"
}
}
}
}Conversations
Reply to a conversation
Send a reply message as an agent to a specific conversation. This endpoint allows agents to respond to customer messages and automatically updates conversation status.
POST
/
api
/
v2
/
conversations
/
{conversationId}
/
reply
Reply to a conversation
curl --request POST \
--url https://app.livechatai.com/api/v2/conversations/{conversationId}/reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"message": "Thank you for your question. I'll help you with that right away.",
"userId": "user_1234567890",
"messageType": "TEXT",
"attachments": [
{
"url": "https://cdn.example.com/bot/chat/abc/messages/file.pdf",
"name": "report.pdf",
"mimeType": "application/pdf",
"size": 123
}
]
}
EOFimport requests
url = "https://app.livechatai.com/api/v2/conversations/{conversationId}/reply"
payload = {
"message": "Thank you for your question. I'll help you with that right away.",
"userId": "user_1234567890",
"messageType": "TEXT",
"attachments": [
{
"url": "https://cdn.example.com/bot/chat/abc/messages/file.pdf",
"name": "report.pdf",
"mimeType": "application/pdf",
"size": 123
}
]
}
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: 'Thank you for your question. I\'ll help you with that right away.',
userId: 'user_1234567890',
messageType: 'TEXT',
attachments: [
{
url: 'https://cdn.example.com/bot/chat/abc/messages/file.pdf',
name: 'report.pdf',
mimeType: 'application/pdf',
size: 123
}
]
})
};
fetch('https://app.livechatai.com/api/v2/conversations/{conversationId}/reply', 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://app.livechatai.com/api/v2/conversations/{conversationId}/reply",
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' => 'Thank you for your question. I\'ll help you with that right away.',
'userId' => 'user_1234567890',
'messageType' => 'TEXT',
'attachments' => [
[
'url' => 'https://cdn.example.com/bot/chat/abc/messages/file.pdf',
'name' => 'report.pdf',
'mimeType' => 'application/pdf',
'size' => 123
]
]
]),
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://app.livechatai.com/api/v2/conversations/{conversationId}/reply"
payload := strings.NewReader("{\n \"message\": \"Thank you for your question. I'll help you with that right away.\",\n \"userId\": \"user_1234567890\",\n \"messageType\": \"TEXT\",\n \"attachments\": [\n {\n \"url\": \"https://cdn.example.com/bot/chat/abc/messages/file.pdf\",\n \"name\": \"report.pdf\",\n \"mimeType\": \"application/pdf\",\n \"size\": 123\n }\n ]\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://app.livechatai.com/api/v2/conversations/{conversationId}/reply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Thank you for your question. I'll help you with that right away.\",\n \"userId\": \"user_1234567890\",\n \"messageType\": \"TEXT\",\n \"attachments\": [\n {\n \"url\": \"https://cdn.example.com/bot/chat/abc/messages/file.pdf\",\n \"name\": \"report.pdf\",\n \"mimeType\": \"application/pdf\",\n \"size\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.livechatai.com/api/v2/conversations/{conversationId}/reply")
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\": \"Thank you for your question. I'll help you with that right away.\",\n \"userId\": \"user_1234567890\",\n \"messageType\": \"TEXT\",\n \"attachments\": [\n {\n \"url\": \"https://cdn.example.com/bot/chat/abc/messages/file.pdf\",\n \"name\": \"report.pdf\",\n \"mimeType\": \"application/pdf\",\n \"size\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "User reply sent successfully",
"data": {
"messageId": "msg_1234567890",
"conversationId": "chat_1234567890",
"message": {
"id": "msg_1234567890",
"text": "Thank you for your question. I'll help you with that right away.",
"sender": "AGENT",
"type": "TEXT",
"attachments": [
{
"id": "<string>",
"url": "<string>",
"name": "<string>",
"mimeType": "<string>",
"size": 123
}
],
"createdAt": "2024-01-20T14:45:00Z",
"agent": {
"id": "agent_1234567890",
"name": "Jane Smith",
"email": "jane@company.com",
"avatar": "https://example.com/avatar.jpg"
}
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the conversation to reply to
Example:
"chat_1234567890"
Body
application/json
Agent reply details
Reply message content to send
Example:
"Thank you for your question. I'll help you with that right away."
ID of the user sending the reply
Example:
"user_1234567890"
Type of message being sent. Resolved automatically when attachments are provided.
Available options:
TEXT, IMAGE, FILE Example:
"TEXT"
Optional file attachments. Upload each file to S3 first via the attachments presign endpoint, then reference the returned metadata here.
Show child attributes
Show child attributes
⌘I

