Send Super Agent Message
curl --request POST \
--url https://api.attention.tech/v2/super-agent/messages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "session-uuid-456",
"content": "What were our Q1 revenue results?",
"timezone": "America/New_York"
}
'import requests
url = "https://api.attention.tech/v2/super-agent/messages"
payload = {
"session_id": "session-uuid-456",
"content": "What were our Q1 revenue results?",
"timezone": "America/New_York"
}
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({
session_id: 'session-uuid-456',
content: 'What were our Q1 revenue results?',
timezone: 'America/New_York'
})
};
fetch('https://api.attention.tech/v2/super-agent/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.attention.tech/v2/super-agent/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([
'session_id' => 'session-uuid-456',
'content' => 'What were our Q1 revenue results?',
'timezone' => 'America/New_York'
]),
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.attention.tech/v2/super-agent/messages"
payload := strings.NewReader("{\n \"session_id\": \"session-uuid-456\",\n \"content\": \"What were our Q1 revenue results?\",\n \"timezone\": \"America/New_York\"\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.attention.tech/v2/super-agent/messages")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": \"session-uuid-456\",\n \"content\": \"What were our Q1 revenue results?\",\n \"timezone\": \"America/New_York\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attention.tech/v2/super-agent/messages")
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 \"session_id\": \"session-uuid-456\",\n \"content\": \"What were our Q1 revenue results?\",\n \"timezone\": \"America/New_York\"\n}"
response = http.request(request)
puts response.read_body{
"session_id": "session-uuid-456",
"user_message": {
"id": "msg-uuid-1",
"session_id": "session-uuid-456",
"content": "What were our Q1 revenue results?",
"role": "user",
"timestamp": "2024-03-18T14:30:00Z",
"metadata": {}
},
"assistant_message": {
"id": "msg-uuid-2",
"session_id": "session-uuid-456",
"content": "Based on the Q1 data, revenue targets were met at 105%.",
"role": "assistant",
"timestamp": "2024-03-18T14:30:05Z",
"metadata": {}
}
}{
"session_id": "session-uuid-456",
"user_message": {
"id": "msg-uuid-1",
"session_id": "session-uuid-456",
"content": "Analyze our pipeline for Q2",
"role": "user",
"timestamp": "2024-03-18T14:30:00Z",
"metadata": {}
},
"status": "processing",
"message": "Your message is being processed. Poll the session for results."
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}Super Agent
Send Super Agent Message
Sends a message to the super agent. If session_id is not provided, creates a new session. Returns synchronously if completed within 15 seconds, otherwise returns 202 Accepted with session ID for polling. Optionally accepts a callback_url for webhook notification when the assistant response is ready.
POST
/
super-agent
/
messages
Send Super Agent Message
curl --request POST \
--url https://api.attention.tech/v2/super-agent/messages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "session-uuid-456",
"content": "What were our Q1 revenue results?",
"timezone": "America/New_York"
}
'import requests
url = "https://api.attention.tech/v2/super-agent/messages"
payload = {
"session_id": "session-uuid-456",
"content": "What were our Q1 revenue results?",
"timezone": "America/New_York"
}
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({
session_id: 'session-uuid-456',
content: 'What were our Q1 revenue results?',
timezone: 'America/New_York'
})
};
fetch('https://api.attention.tech/v2/super-agent/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.attention.tech/v2/super-agent/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([
'session_id' => 'session-uuid-456',
'content' => 'What were our Q1 revenue results?',
'timezone' => 'America/New_York'
]),
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.attention.tech/v2/super-agent/messages"
payload := strings.NewReader("{\n \"session_id\": \"session-uuid-456\",\n \"content\": \"What were our Q1 revenue results?\",\n \"timezone\": \"America/New_York\"\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.attention.tech/v2/super-agent/messages")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": \"session-uuid-456\",\n \"content\": \"What were our Q1 revenue results?\",\n \"timezone\": \"America/New_York\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attention.tech/v2/super-agent/messages")
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 \"session_id\": \"session-uuid-456\",\n \"content\": \"What were our Q1 revenue results?\",\n \"timezone\": \"America/New_York\"\n}"
response = http.request(request)
puts response.read_body{
"session_id": "session-uuid-456",
"user_message": {
"id": "msg-uuid-1",
"session_id": "session-uuid-456",
"content": "What were our Q1 revenue results?",
"role": "user",
"timestamp": "2024-03-18T14:30:00Z",
"metadata": {}
},
"assistant_message": {
"id": "msg-uuid-2",
"session_id": "session-uuid-456",
"content": "Based on the Q1 data, revenue targets were met at 105%.",
"role": "assistant",
"timestamp": "2024-03-18T14:30:05Z",
"metadata": {}
}
}{
"session_id": "session-uuid-456",
"user_message": {
"id": "msg-uuid-1",
"session_id": "session-uuid-456",
"content": "Analyze our pipeline for Q2",
"role": "user",
"timestamp": "2024-03-18T14:30:00Z",
"metadata": {}
},
"status": "processing",
"message": "Your message is being processed. Poll the session for results."
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}Authorizations
Query Parameters
Optional webhook URL to receive the assistant's response when processing completes
Body
application/jsonapplication/vnd.api+json
Response
Message processed successfully with assistant response
The session ID
Show child attributes
Show child attributes
Example:
{
"id": "msg-uuid-123",
"session_id": "session-uuid-456",
"content": "Based on the Q1 data, revenue targets were met at 105%.",
"role": "assistant",
"timestamp": "2024-03-18T14:30:00Z",
"metadata": {}
}
Show child attributes
Show child attributes
Example:
{
"id": "msg-uuid-123",
"session_id": "session-uuid-456",
"content": "Based on the Q1 data, revenue targets were met at 105%.",
"role": "assistant",
"timestamp": "2024-03-18T14:30:00Z",
"metadata": {}
}
Was this page helpful?
⌘I