Live agent event stream
curl --request GET \
--url https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/streamimport requests
url = "https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream', 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.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"detail": "Invalid request body"
}{
"detail": "Invalid API key"
}{
"detail": "This organization no longer has access to Sixtyfour. Contact your representative at Sixtyfour."
}{
"detail": [
{
"loc": [
"body",
"target_company",
"domain"
],
"msg": "Field required",
"type": "missing",
"input": null,
"ctx": {}
}
]
}{
"detail": "Internal server error"
}{
"detail": "Could not verify the API key right now. Retry shortly."
}Atlas
Live agent event stream
Server-Sent Events: the agents’ and subagents’ turn summaries as they are written, in order.
New durable summaries are checked every two seconds while the stream is open.
Frames:
sessions— every agent session, sent first and again whenever one starts, finishes or changes.event— one turn summary; itsid:is the cursor to resume from.status— the investigation’s status when the stream opens and whenever it changes.end— the run reachedcompletedorfailed, every event has been sent, and thesessionsframe before it carries the run’s recorded cost (null only if settlement did not record it in time); the stream closes.access_lost— you may no longer see this investigation; the stream closes.
A stream closes after about five minutes so access is checked again; reconnect (SSE clients do this themselves) and it resumes from the last event id. Comment lines are heartbeats.
GET
/
v1
/
atlas
/
investigations
/
{investigation_id}
/
events
/
stream
Live agent event stream
curl --request GET \
--url https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/streamimport requests
url = "https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream', 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.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sixtyfour.ai/v1/atlas/investigations/{investigation_id}/events/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"detail": "Invalid request body"
}{
"detail": "Invalid API key"
}{
"detail": "This organization no longer has access to Sixtyfour. Contact your representative at Sixtyfour."
}{
"detail": [
{
"loc": [
"body",
"target_company",
"domain"
],
"msg": "Field required",
"type": "missing",
"input": null,
"ctx": {}
}
]
}{
"detail": "Internal server error"
}{
"detail": "Could not verify the API key right now. Retry shortly."
}Headers
Path Parameters
Query Parameters
Resume after this event cursor (an id: from this stream, or next_cursor from GET …/events). Omit to replay from the start. Reconnecting SSE clients send Last-Event-ID, which is used when this is absent.
Maximum string length:
2048Response
Server-Sent Events.
Was this page helpful?