curl --request POST \
--url http://localhost:3000/api/messaging/submit \
--header 'Content-Type: application/json' \
--data '
{
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"server_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"author_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "<string>",
"source_type": "<string>",
"raw_message": {},
"in_reply_to_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {}
}
'import requests
url = "http://localhost:3000/api/messaging/submit"
payload = {
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"server_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"author_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "<string>",
"source_type": "<string>",
"raw_message": {},
"in_reply_to_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
channel_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
server_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
author_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
content: '<string>',
source_type: '<string>',
raw_message: {},
in_reply_to_message_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {}
})
};
fetch('http://localhost:3000/api/messaging/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/messaging/submit",
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([
'channel_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'server_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'author_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'content' => '<string>',
'source_type' => '<string>',
'raw_message' => [
],
'in_reply_to_message_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3000/api/messaging/submit"
payload := strings.NewReader("{\n \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"server_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"author_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"content\": \"<string>\",\n \"source_type\": \"<string>\",\n \"raw_message\": {},\n \"in_reply_to_message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:3000/api/messaging/submit")
.header("Content-Type", "application/json")
.body("{\n \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"server_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"author_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"content\": \"<string>\",\n \"source_type\": \"<string>\",\n \"raw_message\": {},\n \"in_reply_to_message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/messaging/submit")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"server_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"author_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"content\": \"<string>\",\n \"source_type\": \"<string>\",\n \"raw_message\": {},\n \"in_reply_to_message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"roomId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": 123,
"metadata": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>"
}
}Submit a message to the central messaging system
Submit a message to the central messaging bus for agent processing. This is the primary endpoint for sending messages to agents, replacing the deprecated agent-specific message endpoints.
The message is submitted to a central channel and the appropriate agent(s) will process it based on the channel and room configuration. This architecture allows for multi-agent conversations and better message routing.
Important: Do not use /api/agents/{agentId}/message - that endpoint no longer exists.
All messages should go through this central messaging system.
curl --request POST \
--url http://localhost:3000/api/messaging/submit \
--header 'Content-Type: application/json' \
--data '
{
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"server_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"author_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "<string>",
"source_type": "<string>",
"raw_message": {},
"in_reply_to_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {}
}
'import requests
url = "http://localhost:3000/api/messaging/submit"
payload = {
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"server_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"author_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "<string>",
"source_type": "<string>",
"raw_message": {},
"in_reply_to_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
channel_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
server_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
author_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
content: '<string>',
source_type: '<string>',
raw_message: {},
in_reply_to_message_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {}
})
};
fetch('http://localhost:3000/api/messaging/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/messaging/submit",
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([
'channel_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'server_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'author_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'content' => '<string>',
'source_type' => '<string>',
'raw_message' => [
],
'in_reply_to_message_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3000/api/messaging/submit"
payload := strings.NewReader("{\n \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"server_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"author_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"content\": \"<string>\",\n \"source_type\": \"<string>\",\n \"raw_message\": {},\n \"in_reply_to_message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:3000/api/messaging/submit")
.header("Content-Type", "application/json")
.body("{\n \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"server_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"author_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"content\": \"<string>\",\n \"source_type\": \"<string>\",\n \"raw_message\": {},\n \"in_reply_to_message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/messaging/submit")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"server_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"author_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"content\": \"<string>\",\n \"source_type\": \"<string>\",\n \"raw_message\": {},\n \"in_reply_to_message_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"roomId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": 123,
"metadata": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>"
}
}Body
Central channel ID where the message is posted
Server ID (use '00000000-0000-0000-0000-000000000000' for default)
ID of the message author (user or agent)
The message content text
Source type (e.g., 'agent_response', 'user_message')
Raw message object containing additional data
Optional ID of the message being replied to
Additional metadata including agent_name if from agent
Was this page helpful?

