Add an agent trace
curl --request POST \
--url https://api.hyperspell.com/trace/add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"history": "<string>",
"session_id": "<string>",
"title": "<string>",
"metadata": {},
"date": "2023-11-07T05:31:56Z",
"extract": [
"procedure"
]
}
'import requests
url = "https://api.hyperspell.com/trace/add"
payload = {
"history": "<string>",
"session_id": "<string>",
"title": "<string>",
"metadata": {},
"date": "2023-11-07T05:31:56Z",
"extract": ["procedure"]
}
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({
history: '<string>',
session_id: '<string>',
title: '<string>',
metadata: {},
date: '2023-11-07T05:31:56Z',
extract: ['procedure']
})
};
fetch('https://api.hyperspell.com/trace/add', 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.hyperspell.com/trace/add",
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([
'history' => '<string>',
'session_id' => '<string>',
'title' => '<string>',
'metadata' => [
],
'date' => '2023-11-07T05:31:56Z',
'extract' => [
'procedure'
]
]),
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.hyperspell.com/trace/add"
payload := strings.NewReader("{\n \"history\": \"<string>\",\n \"session_id\": \"<string>\",\n \"title\": \"<string>\",\n \"metadata\": {},\n \"date\": \"2023-11-07T05:31:56Z\",\n \"extract\": [\n \"procedure\"\n ]\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.hyperspell.com/trace/add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"history\": \"<string>\",\n \"session_id\": \"<string>\",\n \"title\": \"<string>\",\n \"metadata\": {},\n \"date\": \"2023-11-07T05:31:56Z\",\n \"extract\": [\n \"procedure\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/trace/add")
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 \"history\": \"<string>\",\n \"session_id\": \"<string>\",\n \"title\": \"<string>\",\n \"metadata\": {},\n \"date\": \"2023-11-07T05:31:56Z\",\n \"extract\": [\n \"procedure\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"source": "reddit",
"resource_id": "<string>",
"status": "pending",
"revision": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Traces
Add an agent trace
Add an agent trace/transcript to the index.
Accepts traces as a string in Hyperdoc format (native), Vercel AI SDK format, or OpenClaw JSONL format. The format is auto-detected if not specified.
Hyperdoc format (JSON array, snake_case with type discriminators):
{"history": "[{\"type\": \"trace_message\", \"role\": \"user\", \"text\": \"Hello\"}]"}
Vercel AI SDK format (JSON array, camelCase):
{"history": "[{\"role\": \"user\", \"content\": \"Hello\"}]"}
OpenClaw JSONL format (newline-delimited JSON):
{"history": "{\"type\":\"session\",\"id\":\"abc\"}\n{\"type\":\"message\",\"message\":{\"role\":\"user\",...}}"}
POST
/
trace
/
add
Add an agent trace
curl --request POST \
--url https://api.hyperspell.com/trace/add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"history": "<string>",
"session_id": "<string>",
"title": "<string>",
"metadata": {},
"date": "2023-11-07T05:31:56Z",
"extract": [
"procedure"
]
}
'import requests
url = "https://api.hyperspell.com/trace/add"
payload = {
"history": "<string>",
"session_id": "<string>",
"title": "<string>",
"metadata": {},
"date": "2023-11-07T05:31:56Z",
"extract": ["procedure"]
}
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({
history: '<string>',
session_id: '<string>',
title: '<string>',
metadata: {},
date: '2023-11-07T05:31:56Z',
extract: ['procedure']
})
};
fetch('https://api.hyperspell.com/trace/add', 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.hyperspell.com/trace/add",
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([
'history' => '<string>',
'session_id' => '<string>',
'title' => '<string>',
'metadata' => [
],
'date' => '2023-11-07T05:31:56Z',
'extract' => [
'procedure'
]
]),
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.hyperspell.com/trace/add"
payload := strings.NewReader("{\n \"history\": \"<string>\",\n \"session_id\": \"<string>\",\n \"title\": \"<string>\",\n \"metadata\": {},\n \"date\": \"2023-11-07T05:31:56Z\",\n \"extract\": [\n \"procedure\"\n ]\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.hyperspell.com/trace/add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"history\": \"<string>\",\n \"session_id\": \"<string>\",\n \"title\": \"<string>\",\n \"metadata\": {},\n \"date\": \"2023-11-07T05:31:56Z\",\n \"extract\": [\n \"procedure\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/trace/add")
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 \"history\": \"<string>\",\n \"session_id\": \"<string>\",\n \"title\": \"<string>\",\n \"metadata\": {},\n \"date\": \"2023-11-07T05:31:56Z\",\n \"extract\": [\n \"procedure\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"source": "reddit",
"resource_id": "<string>",
"status": "pending",
"revision": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
Body
application/json
Request to add an agent trace.
Response
Successful Response
Available options:
reddit, notion, slack, google_calendar, google_mail, imap, google_meet, box, dropbox, github, gitlab, google_drive, vault, web_crawler, trace, microsoft_outlook, onedrive, microsoft_teams, granola, fathom, fireflies, figma, linear, hubspot, salesforce, coda, confluence, jira, metabase, gong, clickup, lightfield, pylon, fellow, odoo, attio, external_mcp, page Was this page helpful?