Send a message
curl --request POST \
--url https://api-v3.aui.io/apollo-api/messaging/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"user_id": "<string>",
"thread_id": "<string>",
"image_url": "<string>",
"agent_variables": {
"static": {},
"dynamic": {}
}
}
'import requests
url = "https://api-v3.aui.io/apollo-api/messaging/v1/messages"
payload = {
"text": "<string>",
"user_id": "<string>",
"thread_id": "<string>",
"image_url": "<string>",
"agent_variables": {
"static": {},
"dynamic": {}
}
}
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({
text: '<string>',
user_id: '<string>',
thread_id: '<string>',
image_url: '<string>',
agent_variables: {static: {}, dynamic: {}}
})
};
fetch('https://api-v3.aui.io/apollo-api/messaging/v1/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-v3.aui.io/apollo-api/messaging/v1/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([
'text' => '<string>',
'user_id' => '<string>',
'thread_id' => '<string>',
'image_url' => '<string>',
'agent_variables' => [
'static' => [
],
'dynamic' => [
]
]
]),
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-v3.aui.io/apollo-api/messaging/v1/messages"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"user_id\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"agent_variables\": {\n \"static\": {},\n \"dynamic\": {}\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://api-v3.aui.io/apollo-api/messaging/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"user_id\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"agent_variables\": {\n \"static\": {},\n \"dynamic\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v3.aui.io/apollo-api/messaging/v1/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 \"text\": \"<string>\",\n \"user_id\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"agent_variables\": {\n \"static\": {},\n \"dynamic\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"thread_id": "<string>",
"message": {
"id": "<string>",
"created_at": "<string>",
"text": "<string>",
"sender": {
"id": "<string>",
"type": "<string>"
},
"receiver": {
"id": "<string>",
"type": "<string>"
},
"cards": [
{
"name": "<string>",
"category": "<string>",
"rendered_jsx": "<string>",
"is_recommended": true,
"index": 123
}
],
"welcome_message": "<string>",
"followup_suggestions": [
"<string>"
],
"url": "<string>",
"input_tokens": 0,
"output_tokens": 0
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}Send a message
Send a message; auto-create the thread when thread_id is omitted. For a live
token stream use POST /messages/stream (SSE). The resolved thread id is
returned in the body.
POST
/
messaging
/
v1
/
messages
Send a message
curl --request POST \
--url https://api-v3.aui.io/apollo-api/messaging/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"user_id": "<string>",
"thread_id": "<string>",
"image_url": "<string>",
"agent_variables": {
"static": {},
"dynamic": {}
}
}
'import requests
url = "https://api-v3.aui.io/apollo-api/messaging/v1/messages"
payload = {
"text": "<string>",
"user_id": "<string>",
"thread_id": "<string>",
"image_url": "<string>",
"agent_variables": {
"static": {},
"dynamic": {}
}
}
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({
text: '<string>',
user_id: '<string>',
thread_id: '<string>',
image_url: '<string>',
agent_variables: {static: {}, dynamic: {}}
})
};
fetch('https://api-v3.aui.io/apollo-api/messaging/v1/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-v3.aui.io/apollo-api/messaging/v1/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([
'text' => '<string>',
'user_id' => '<string>',
'thread_id' => '<string>',
'image_url' => '<string>',
'agent_variables' => [
'static' => [
],
'dynamic' => [
]
]
]),
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-v3.aui.io/apollo-api/messaging/v1/messages"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"user_id\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"agent_variables\": {\n \"static\": {},\n \"dynamic\": {}\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://api-v3.aui.io/apollo-api/messaging/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"user_id\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"agent_variables\": {\n \"static\": {},\n \"dynamic\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v3.aui.io/apollo-api/messaging/v1/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 \"text\": \"<string>\",\n \"user_id\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"agent_variables\": {\n \"static\": {},\n \"dynamic\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"thread_id": "<string>",
"message": {
"id": "<string>",
"created_at": "<string>",
"text": "<string>",
"sender": {
"id": "<string>",
"type": "<string>"
},
"receiver": {
"id": "<string>",
"type": "<string>"
},
"cards": [
{
"name": "<string>",
"category": "<string>",
"rendered_jsx": "<string>",
"is_recommended": true,
"index": 123
}
],
"welcome_message": "<string>",
"followup_suggestions": [
"<string>"
],
"url": "<string>",
"input_tokens": 0,
"output_tokens": 0
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}Authorizations
Access token from POST /management/v1/auth/token (publishable-key exchange) or a login session. Publishable-key tokens are agent-scoped and serve the messaging surface; login tokens also serve management.
Body
application/json
Send a message to your agent — the agent is identified by your access
token. thread_id is optional: present -> append to that thread; absent
-> a new thread is created automatically and its id returned.
Response
Successful Response
⌘I