curl --request POST \
--url https://api.useanima.sh/v1/messages/search/semantic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"agentId": "<string>",
"inboxId": "<string>",
"fromAddress": "<string>",
"toAddress": "<string>",
"limit": 10,
"threshold": 0.7
}
'import requests
url = "https://api.useanima.sh/v1/messages/search/semantic"
payload = {
"query": "<string>",
"agentId": "<string>",
"inboxId": "<string>",
"fromAddress": "<string>",
"toAddress": "<string>",
"limit": 10,
"threshold": 0.7
}
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({
query: '<string>',
agentId: '<string>',
inboxId: '<string>',
fromAddress: '<string>',
toAddress: '<string>',
limit: 10,
threshold: 0.7
})
};
fetch('https://api.useanima.sh/v1/messages/search/semantic', 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.useanima.sh/v1/messages/search/semantic",
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([
'query' => '<string>',
'agentId' => '<string>',
'inboxId' => '<string>',
'fromAddress' => '<string>',
'toAddress' => '<string>',
'limit' => 10,
'threshold' => 0.7
]),
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.useanima.sh/v1/messages/search/semantic"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"agentId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"fromAddress\": \"<string>\",\n \"toAddress\": \"<string>\",\n \"limit\": 10,\n \"threshold\": 0.7\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.useanima.sh/v1/messages/search/semantic")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"agentId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"fromAddress\": \"<string>\",\n \"toAddress\": \"<string>\",\n \"limit\": 10,\n \"threshold\": 0.7\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/messages/search/semantic")
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 \"query\": \"<string>\",\n \"agentId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"fromAddress\": \"<string>\",\n \"toAddress\": \"<string>\",\n \"limit\": 10,\n \"threshold\": 0.7\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"content": "<string>",
"similarity": 123,
"channel": "<string>",
"direction": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"agentId": "<string>",
"inboxId": "<string>"
}
]
}Post messagessearchsemantic
curl --request POST \
--url https://api.useanima.sh/v1/messages/search/semantic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"agentId": "<string>",
"inboxId": "<string>",
"fromAddress": "<string>",
"toAddress": "<string>",
"limit": 10,
"threshold": 0.7
}
'import requests
url = "https://api.useanima.sh/v1/messages/search/semantic"
payload = {
"query": "<string>",
"agentId": "<string>",
"inboxId": "<string>",
"fromAddress": "<string>",
"toAddress": "<string>",
"limit": 10,
"threshold": 0.7
}
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({
query: '<string>',
agentId: '<string>',
inboxId: '<string>',
fromAddress: '<string>',
toAddress: '<string>',
limit: 10,
threshold: 0.7
})
};
fetch('https://api.useanima.sh/v1/messages/search/semantic', 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.useanima.sh/v1/messages/search/semantic",
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([
'query' => '<string>',
'agentId' => '<string>',
'inboxId' => '<string>',
'fromAddress' => '<string>',
'toAddress' => '<string>',
'limit' => 10,
'threshold' => 0.7
]),
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.useanima.sh/v1/messages/search/semantic"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"agentId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"fromAddress\": \"<string>\",\n \"toAddress\": \"<string>\",\n \"limit\": 10,\n \"threshold\": 0.7\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.useanima.sh/v1/messages/search/semantic")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"agentId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"fromAddress\": \"<string>\",\n \"toAddress\": \"<string>\",\n \"limit\": 10,\n \"threshold\": 0.7\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/messages/search/semantic")
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 \"query\": \"<string>\",\n \"agentId\": \"<string>\",\n \"inboxId\": \"<string>\",\n \"fromAddress\": \"<string>\",\n \"toAddress\": \"<string>\",\n \"limit\": 10,\n \"threshold\": 0.7\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"content": "<string>",
"similarity": 123,
"channel": "<string>",
"direction": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"agentId": "<string>",
"inboxId": "<string>"
}
]
}Authorizations
JWT Bearer token obtained from authentication. Pass as: Authorization: Bearer
Body
Semantic search parameters
Natural language search query
1 - 1000Filter results to a specific agent
^[cC][^\s-]{8,}$Filter to one inbox — messages delivered to it (inbound) or sent from it (outbound). The precise way to read a single mailbox when an agent owns several.
^[cC][^\s-]{8,}$Filter by sender address, matched exactly (case-sensitive). On inbound mail this is the counterparty; on outbound it is the agent identity the mail was sent from.
Filter by recipient address, matched exactly (case-sensitive). Note that outbound messages store every recipient in one comma-joined value, so an exact filter matches a multi-recipient send only when given that same joined string — prefer inboxId to scope outbound mail to a mailbox.
Maximum number of results to return
1 <= x <= 50Minimum similarity score threshold (0-1)
0 <= x <= 1Response
OK
Semantic search results
List of messages ranked by semantic similarity
Show child attributes
Show child attributes
