Chat
Send a message
Sends a message to the AI agent and returns a streaming SSE response. The request body must not exceed 1 MB.
POST
/
chat
/
messages
Send a message
curl --request POST \
--url https://platform.agentictrust.com/api/v1/chat/messages \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"conversationId": "<string>",
"projectId": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>",
"id": "<string>",
"parts": [
{
"type": "<string>",
"text": "<string>"
}
]
}
],
"pageContext": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"referrer": "<string>",
"textContent": "<string>",
"headings": [
"<string>"
],
"buttons": [
"<string>"
],
"links": [
{
"href": "<string>",
"text": "<string>"
}
],
"formFields": [
{
"name": "<string>",
"type": "<string>",
"label": "<string>",
"placeholder": "<string>"
}
]
},
"userTokens": {}
}
'import requests
url = "https://platform.agentictrust.com/api/v1/chat/messages"
payload = {
"conversationId": "<string>",
"projectId": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>",
"id": "<string>",
"parts": [
{
"type": "<string>",
"text": "<string>"
}
]
}
],
"pageContext": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"referrer": "<string>",
"textContent": "<string>",
"headings": ["<string>"],
"buttons": ["<string>"],
"links": [
{
"href": "<string>",
"text": "<string>"
}
],
"formFields": [
{
"name": "<string>",
"type": "<string>",
"label": "<string>",
"placeholder": "<string>"
}
]
},
"userTokens": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversationId: '<string>',
projectId: '<string>',
messages: [
{
role: '<string>',
content: '<string>',
id: '<string>',
parts: [{type: '<string>', text: '<string>'}]
}
],
pageContext: {
url: '<string>',
title: '<string>',
description: '<string>',
referrer: '<string>',
textContent: '<string>',
headings: ['<string>'],
buttons: ['<string>'],
links: [{href: '<string>', text: '<string>'}],
formFields: [
{name: '<string>', type: '<string>', label: '<string>', placeholder: '<string>'}
]
},
userTokens: {}
})
};
fetch('https://platform.agentictrust.com/api/v1/chat/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://platform.agentictrust.com/api/v1/chat/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([
'conversationId' => '<string>',
'projectId' => '<string>',
'messages' => [
[
'role' => '<string>',
'content' => '<string>',
'id' => '<string>',
'parts' => [
[
'type' => '<string>',
'text' => '<string>'
]
]
]
],
'pageContext' => [
'url' => '<string>',
'title' => '<string>',
'description' => '<string>',
'referrer' => '<string>',
'textContent' => '<string>',
'headings' => [
'<string>'
],
'buttons' => [
'<string>'
],
'links' => [
[
'href' => '<string>',
'text' => '<string>'
]
],
'formFields' => [
[
'name' => '<string>',
'type' => '<string>',
'label' => '<string>',
'placeholder' => '<string>'
]
]
],
'userTokens' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://platform.agentictrust.com/api/v1/chat/messages"
payload := strings.NewReader("{\n \"conversationId\": \"<string>\",\n \"projectId\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"id\": \"<string>\",\n \"parts\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"pageContext\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"referrer\": \"<string>\",\n \"textContent\": \"<string>\",\n \"headings\": [\n \"<string>\"\n ],\n \"buttons\": [\n \"<string>\"\n ],\n \"links\": [\n {\n \"href\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"formFields\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ]\n },\n \"userTokens\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://platform.agentictrust.com/api/v1/chat/messages")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"conversationId\": \"<string>\",\n \"projectId\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"id\": \"<string>\",\n \"parts\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"pageContext\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"referrer\": \"<string>\",\n \"textContent\": \"<string>\",\n \"headings\": [\n \"<string>\"\n ],\n \"buttons\": [\n \"<string>\"\n ],\n \"links\": [\n {\n \"href\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"formFields\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ]\n },\n \"userTokens\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.agentictrust.com/api/v1/chat/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversationId\": \"<string>\",\n \"projectId\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"id\": \"<string>\",\n \"parts\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"pageContext\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"referrer\": \"<string>\",\n \"textContent\": \"<string>\",\n \"headings\": [\n \"<string>\"\n ],\n \"buttons\": [\n \"<string>\"\n ],\n \"links\": [\n {\n \"href\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"formFields\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ]\n },\n \"userTokens\": {}\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
API key in lum_pk_* format. Pass via x-api-key header or Authorization: Bearer <key>.
Body
application/json
Minimum array length:
1Show child attributes
Show child attributes
DOM context from the page where the widget is embedded.
Show child attributes
Show child attributes
Custom headers forwarded to action endpoints. Max 10 keys.
Show child attributes
Show child attributes
Response
SSE stream of AI responses.
The response is of type string.
Previous
Verify user identity (HMAC)Verifies an end user's identity using HMAC-SHA256. The HMAC is computed over the `userId` with the project's HMAC secret. On success, the end user is upserted.
Next
⌘I
Send a message
curl --request POST \
--url https://platform.agentictrust.com/api/v1/chat/messages \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"conversationId": "<string>",
"projectId": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>",
"id": "<string>",
"parts": [
{
"type": "<string>",
"text": "<string>"
}
]
}
],
"pageContext": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"referrer": "<string>",
"textContent": "<string>",
"headings": [
"<string>"
],
"buttons": [
"<string>"
],
"links": [
{
"href": "<string>",
"text": "<string>"
}
],
"formFields": [
{
"name": "<string>",
"type": "<string>",
"label": "<string>",
"placeholder": "<string>"
}
]
},
"userTokens": {}
}
'import requests
url = "https://platform.agentictrust.com/api/v1/chat/messages"
payload = {
"conversationId": "<string>",
"projectId": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>",
"id": "<string>",
"parts": [
{
"type": "<string>",
"text": "<string>"
}
]
}
],
"pageContext": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"referrer": "<string>",
"textContent": "<string>",
"headings": ["<string>"],
"buttons": ["<string>"],
"links": [
{
"href": "<string>",
"text": "<string>"
}
],
"formFields": [
{
"name": "<string>",
"type": "<string>",
"label": "<string>",
"placeholder": "<string>"
}
]
},
"userTokens": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversationId: '<string>',
projectId: '<string>',
messages: [
{
role: '<string>',
content: '<string>',
id: '<string>',
parts: [{type: '<string>', text: '<string>'}]
}
],
pageContext: {
url: '<string>',
title: '<string>',
description: '<string>',
referrer: '<string>',
textContent: '<string>',
headings: ['<string>'],
buttons: ['<string>'],
links: [{href: '<string>', text: '<string>'}],
formFields: [
{name: '<string>', type: '<string>', label: '<string>', placeholder: '<string>'}
]
},
userTokens: {}
})
};
fetch('https://platform.agentictrust.com/api/v1/chat/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://platform.agentictrust.com/api/v1/chat/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([
'conversationId' => '<string>',
'projectId' => '<string>',
'messages' => [
[
'role' => '<string>',
'content' => '<string>',
'id' => '<string>',
'parts' => [
[
'type' => '<string>',
'text' => '<string>'
]
]
]
],
'pageContext' => [
'url' => '<string>',
'title' => '<string>',
'description' => '<string>',
'referrer' => '<string>',
'textContent' => '<string>',
'headings' => [
'<string>'
],
'buttons' => [
'<string>'
],
'links' => [
[
'href' => '<string>',
'text' => '<string>'
]
],
'formFields' => [
[
'name' => '<string>',
'type' => '<string>',
'label' => '<string>',
'placeholder' => '<string>'
]
]
],
'userTokens' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://platform.agentictrust.com/api/v1/chat/messages"
payload := strings.NewReader("{\n \"conversationId\": \"<string>\",\n \"projectId\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"id\": \"<string>\",\n \"parts\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"pageContext\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"referrer\": \"<string>\",\n \"textContent\": \"<string>\",\n \"headings\": [\n \"<string>\"\n ],\n \"buttons\": [\n \"<string>\"\n ],\n \"links\": [\n {\n \"href\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"formFields\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ]\n },\n \"userTokens\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://platform.agentictrust.com/api/v1/chat/messages")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"conversationId\": \"<string>\",\n \"projectId\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"id\": \"<string>\",\n \"parts\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"pageContext\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"referrer\": \"<string>\",\n \"textContent\": \"<string>\",\n \"headings\": [\n \"<string>\"\n ],\n \"buttons\": [\n \"<string>\"\n ],\n \"links\": [\n {\n \"href\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"formFields\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ]\n },\n \"userTokens\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.agentictrust.com/api/v1/chat/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversationId\": \"<string>\",\n \"projectId\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"id\": \"<string>\",\n \"parts\": [\n {\n \"type\": \"<string>\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"pageContext\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"referrer\": \"<string>\",\n \"textContent\": \"<string>\",\n \"headings\": [\n \"<string>\"\n ],\n \"buttons\": [\n \"<string>\"\n ],\n \"links\": [\n {\n \"href\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"formFields\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ]\n },\n \"userTokens\": {}\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}