Skip to main content
POST
/
trace
/
add
JavaScript
import Hyperspell from '@hyperspell/hyperspell';

const client = new Hyperspell({
  apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});

const memoryStatus = await client.sessions.add({ history: 'history' });

console.log(memoryStatus.resource_id);
{
  "resource_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.hyperspell.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.

Body

application/json

Request to add an agent trace.

history
string
required

The trace history as a string. Can be a JSON array of Hyperdoc steps, a JSON array of Vercel AI SDK steps, or OpenClaw JSONL.

session_id
string

Resource identifier for the trace.

format
enum<string> | null

Trace format: 'vercel', 'hyperdoc', or 'openclaw'. Auto-detected if not set.

Available options:
vercel,
hyperdoc,
openclaw
title
string | null

Title of the trace

metadata
Metadata · object

Custom metadata for filtering. Keys must be alphanumeric with underscores, max 64 chars.

date
string<date-time>

Date of the trace

extract
enum<string>[]

What kind of memories to extract from the trace

Available options:
procedure,
memory,
mood

Response

Successful Response

source
enum<string>
required
Available options:
reddit,
notion,
slack,
google_calendar,
google_mail,
box,
dropbox,
github,
google_drive,
vault,
web_crawler,
trace,
microsoft_teams,
gmail_actions,
granola,
fathom,
linear,
hubspot,
salesforce,
coda
resource_id
string
required
status
enum<string>
required
Available options:
pending,
processing,
completed,
failed,
pending_review,
skipped