Send Chat Message
curl --request POST \
--url https://api.getoutbox.ai/agent/chat/{agent_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"thread_id": "<string>",
"contact_id": "<string>",
"phone_number": "<string>",
"full_name": "<string>",
"platform": "<string>",
"external_customer_id": "<string>",
"stream": false,
"testing": false,
"visitor_session_id": "<string>"
}
'import requests
url = "https://api.getoutbox.ai/agent/chat/{agent_id}"
payload = {
"message": "<string>",
"thread_id": "<string>",
"contact_id": "<string>",
"phone_number": "<string>",
"full_name": "<string>",
"platform": "<string>",
"external_customer_id": "<string>",
"stream": False,
"testing": False,
"visitor_session_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: '<string>',
thread_id: '<string>',
contact_id: '<string>',
phone_number: '<string>',
full_name: '<string>',
platform: '<string>',
external_customer_id: '<string>',
stream: false,
testing: false,
visitor_session_id: '<string>'
})
};
fetch('https://api.getoutbox.ai/agent/chat/{agent_id}', 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.getoutbox.ai/agent/chat/{agent_id}",
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>',
'thread_id' => '<string>',
'contact_id' => '<string>',
'phone_number' => '<string>',
'full_name' => '<string>',
'platform' => '<string>',
'external_customer_id' => '<string>',
'stream' => false,
'testing' => false,
'visitor_session_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.getoutbox.ai/agent/chat/{agent_id}"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"full_name\": \"<string>\",\n \"platform\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"stream\": false,\n \"testing\": false,\n \"visitor_session_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.getoutbox.ai/agent/chat/{agent_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"full_name\": \"<string>\",\n \"platform\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"stream\": false,\n \"testing\": false,\n \"visitor_session_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoutbox.ai/agent/chat/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"full_name\": \"<string>\",\n \"platform\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"stream\": false,\n \"testing\": false,\n \"visitor_session_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"response": "<string>",
"thread_id": "<string>",
"thread_message_id": "<string>"
}Chat & Call Endpoints
Send Chat Message
Send a message to a chatbot agent and receive a response (for chatbot agents only)
POST
/
agent
/
chat
/
{agent_id}
Send Chat Message
curl --request POST \
--url https://api.getoutbox.ai/agent/chat/{agent_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"thread_id": "<string>",
"contact_id": "<string>",
"phone_number": "<string>",
"full_name": "<string>",
"platform": "<string>",
"external_customer_id": "<string>",
"stream": false,
"testing": false,
"visitor_session_id": "<string>"
}
'import requests
url = "https://api.getoutbox.ai/agent/chat/{agent_id}"
payload = {
"message": "<string>",
"thread_id": "<string>",
"contact_id": "<string>",
"phone_number": "<string>",
"full_name": "<string>",
"platform": "<string>",
"external_customer_id": "<string>",
"stream": False,
"testing": False,
"visitor_session_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: '<string>',
thread_id: '<string>',
contact_id: '<string>',
phone_number: '<string>',
full_name: '<string>',
platform: '<string>',
external_customer_id: '<string>',
stream: false,
testing: false,
visitor_session_id: '<string>'
})
};
fetch('https://api.getoutbox.ai/agent/chat/{agent_id}', 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.getoutbox.ai/agent/chat/{agent_id}",
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>',
'thread_id' => '<string>',
'contact_id' => '<string>',
'phone_number' => '<string>',
'full_name' => '<string>',
'platform' => '<string>',
'external_customer_id' => '<string>',
'stream' => false,
'testing' => false,
'visitor_session_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.getoutbox.ai/agent/chat/{agent_id}"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"full_name\": \"<string>\",\n \"platform\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"stream\": false,\n \"testing\": false,\n \"visitor_session_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.getoutbox.ai/agent/chat/{agent_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"full_name\": \"<string>\",\n \"platform\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"stream\": false,\n \"testing\": false,\n \"visitor_session_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoutbox.ai/agent/chat/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"full_name\": \"<string>\",\n \"platform\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"stream\": false,\n \"testing\": false,\n \"visitor_session_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"response": "<string>",
"thread_id": "<string>",
"thread_message_id": "<string>"
}Body
application/json
Chat message details

