Knowledge & Memory API
Memory API
The memory API enables agent code running in sandboxed environments to read, write, and delete values from named memory stores. Memory stores persist data across turns within a session, allowing agents to maintain context. Base path:/api/v1/memory
POST /api/v1/memory
Perform a memory operation (get, set, or delete) on a named memory store. Auth is required (sandbox JWT — issued automatically by the runtime for sandbox execution contexts) **Request body **| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Operation to perform: get, set, or delete |
memoryStoreName | string | Yes | Name of the memory store |
payload | object | No | Data payload (required for set action) |
| Status | Error | Cause |
|---|---|---|
400 | Missing action or memoryStoreName | Required fields not provided |
400 | Token missing sessionId | Sandbox JWT does not contain a session identifier |
400 | Unknown action | Action is not get, set, or delete |
401 | Invalid or expired token | Sandbox JWT verification failed |
404 | Session not found | No active memory bridge for the session |
503 | Sandbox auth not configured | Server sandbox JWT secret not configured |
Contacts
The contacts API manages end-user identities that can be linked across multiple sessions. Contacts provide a unified view of interactions with a specific person or entity. Base path:/api/contacts
POST /api/contacts
Create a new contact record. Auth is required Permission: Admin or write access **Request body **| Field | Type | Required | Description |
|---|---|---|---|
type | string | No | Contact type: employee, customer, or anonymous |
identity | string | No | Unique identity value (email, phone, external ID) |
identityType | string | No | Identity type: email, phone, or external |
displayName | string | No | Display name (max 200 characters) |
department | string | No | Department (for employee contacts) |
employeeId | string | No | Employee ID (max 100 characters) |
company | string | No | Company name (max 200 characters) |
accountRef | string | No | Account reference ID |
channel | string | No | Primary channel |
metadata | object | No | Custom metadata key-value pairs |
tags | array | No | Tags (max 50, each max 50 characters) |
GET /api/contacts
Query contacts with optional filters and pagination. Auth is required **Query parameters **| Parameter | Type | Description |
|---|---|---|
type | string | Filter by contact type (employee, customer, anonymous) |
channel | string | Filter by channel |
limit | integer | Items per page |
offset | integer | Items to skip |
GET /api/contacts/lookup
Find a contact by identity value (email, phone, or external ID). Auth is required **Query parameters **| Parameter | Type | Required | Description |
|---|---|---|---|
identity | string | Yes | Identity value to search for |
identityType | string | No | Identity type (email, phone, external) |
GET /api/contacts/:id
Get a contact by ID. Auth is required **Path parameters **| Parameter | Type | Description |
|---|---|---|
id | string | Contact ID |
PUT /api/contacts/:id
Update a contact’s information. Auth is required Permission: Admin or write access **Request body ** Same fields as POST /api/contacts. All fields are optional; only provided fields are updated.DELETE /api/contacts/:id
Soft-delete a contact. Sets adeletedAt timestamp rather than permanently removing the record.
Auth is required
Permission: Admin or write access
POST /api/contacts/:id/link-session
Link a contact to an existing session, associating the conversation with a known identity. Auth is required Permission: Admin or write access **Request body **| Field | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | Session ID to link |
Analytics API
Query and aggregate platform events across sessions and agents. All analytics endpoints are project-scoped and require authentication.Event analytics
Base path:/api/projects/:projectId/analytics
GET /api/projects/:projectId/analytics/metrics
Get aggregated event metrics grouped by specified dimensions. Auth is required Permission:session:read
**Query parameters
**
| Parameter | Type | Default | Description |
|---|---|---|---|
from | string | 24 hours ago | ISO 8601 start date |
to | string | Now | ISO 8601 end date |
groupBy | string | category | Comma-separated dimensions: category, event_type, agent_name, channel, hour, day |
metrics | string | count,error_rate | Comma-separated metrics: count, avg_duration, error_rate, p95_duration, sum_tokens, sum_cost |
category | string | — | Filter by event category |
| Category | Description |
|---|---|
session | Session lifecycle events |
message | Message send/receive events |
llm | LLM call events |
tool | Tool execution events |
agent | Agent-level events |
gather | Gather step events |
flow | Flow transition events |
channel | Channel events |
deployment | Deployment lifecycle events |
search | Search/knowledge events |
voice | Voice interaction events |
audit | Audit log events |
evaluation | Evaluation run events |
feedback | User feedback events |
system | System-level events |
GET /api/projects/:projectId/analytics/events
List raw events with filtering and pagination. Auth is required Permission:session:read
**Query parameters
**
| Parameter | Type | Default | Description |
|---|---|---|---|
from | string | 24 hours ago | ISO 8601 start date |
to | string | Now | ISO 8601 end date |
category | string | — | Filter by event category |
eventTypes | string | — | Comma-separated event type filter |
sessionId | string | — | Filter by session ID |
agentName | string | — | Filter by agent name |
hasError | string | — | Set to true to show only error events |
limit | integer | 100 | Items per page (max 10,000) |
offset | integer | 0 | Items to skip |
GET /api/projects/:projectId/analytics/agents/:name
Get performance metrics for a specific agent. Auth is required Permission:session:read
**Path parameters
**
| Parameter | Type | Description |
|---|---|---|
name | string | Agent name |
| Parameter | Type | Default | Description |
|---|---|---|---|
from | string | 24 hours ago | ISO 8601 start date |
to | string | Now | ISO 8601 end date |
GET /api/projects/:projectId/analytics/cost-breakdown
Get LLM cost breakdown by model and provider. Auth is required Permission:session:read
**Query parameters
**
| Parameter | Type | Default | Description |
|---|---|---|---|
from | string | 24 hours ago | ISO 8601 start date |
to | string | Now | ISO 8601 end date |
GET /api/projects/:projectId/analytics/session-metrics
Get session-level aggregated metrics. Auth is required Permission:session:read
POST /api/projects/:projectId/analytics/query
Execute an ad-hoc event query with custom filters. Auth is required Permission:session:read
**Request body
**
| Field | Type | Required | Description |
|---|---|---|---|
timeRange | object | Yes | { from: string, to: string } in ISO 8601 |
category | string | No | Event category filter |
eventTypes | array | No | Event type filter |
sessionId | string | No | Session ID filter |
agentName | string | No | Agent name filter |
hasError | boolean | No | Error filter |
limit | integer | No | Result limit (default: 100, max: 10,000) |
offset | integer | No | Result offset |
POST /api/projects/:projectId/analytics/aggregate
Execute an ad-hoc aggregation query. Auth is required Permission:session:read
**Request body
**
| Field | Type | Required | Description |
|---|---|---|---|
timeRange | object | Yes | { from: string, to: string } in ISO 8601 |
groupBy | array | Yes | Dimensions to group by |
metrics | array | Yes | Metrics to compute |
filters | object | No | Additional filters (category, event types) |
Voice analytics
Voice-specific analytics with hourly aggregations and summary KPIs. Base path:/api/projects/:projectId/voice-analytics
GET /api/projects/:projectId/voice-analytics/hourly
Get hourly aggregated voice metrics. Auth is required Permission:session:read
**Query parameters
**
| Parameter | Type | Default | Description |
|---|---|---|---|
hours | integer | 168 (7 days) | Number of hours to look back |
| Metric | Description |
|---|---|
session_count | Number of voice sessions in the hour |
error_count | Number of sessions with errors |
avg_call_duration_ms | Average call duration in milliseconds |
avg_inbound_mos | Average inbound Mean Opinion Score (1-5) |
avg_outbound_mos | Average outbound Mean Opinion Score (1-5) |
avg_e2e_latency_ms | Average end-to-end latency in milliseconds |
avg_barge_in_rate | Average rate of user interruptions |
avg_asr_score | Average speech recognition accuracy (0-1) |
total_turns | Total conversation turns |
GET /api/projects/:projectId/voice-analytics/summary
Get summary KPIs for dashboard display. Auth is required Permission:session:read
**Query parameters
**
| Parameter | Type | Default | Description |
|---|---|---|---|
hours | integer | 168 (7 days) | Number of hours to look back |
Session traces
Detailed execution traces for individual sessions are available through the sessions API.GET /api/projects/:projectId/sessions/:id/traces
See Conversation API — Session traces for full documentation.GET /api/projects/:projectId/sessions/:id/traces/:spanId/children
Get child events for a specific span within a session trace. Auth is required Permission:session:read
GET /api/projects/:projectId/sessions/:id/analysis
Get trace analysis and diagnostics for a session. Auth is required Permission:session:read
GET /api/projects/:projectId/sessions/generations
List LLM call events across all sessions in a project. Auth is required Permission:session:read
GET /api/projects/:projectId/sessions/export
Export session traces as CSV. Auth is required Permission:session:read
Project Export/Import API
The project export/import API enables programmatic migration of agent projects between environments. You can export a project’s agents, tools, and deployment configurations as a file map, then import them into another project or instance. Base path:/api/projects/:projectId/project-io
Export
GET /api/projects/:projectId/project-io/export/preview
Preview what will be exported without generating files. Returns metadata about agents, tools, and dependency validation. Auth is required Permission:project:export
**Response body
**
| Field | Type | Description |
|---|---|---|
project | object | Project metadata (name, slug) |
agents | array | Agents with DSL content availability |
tools | array | Tools with type information |
dependencies | object | Dependency graph edges and validation results |
GET /api/projects/:projectId/project-io/export
Export the full project as a file map with manifest and lockfile. Auth is required Permission:project:export
**Query parameters
**
| Parameter | Type | Default | Description |
|---|---|---|---|
format | string | folder | Export format: folder or zip |
include_deployments | string | false | Set to true to include deployment records |
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the export succeeded |
manifest | object | Project manifest with metadata and checksums |
lockfile | object | Lockfile with pinned dependency versions |
files | object | Map of file paths to content strings |
warnings | array | Export warnings (e.g., agents without DSL content) |
| Limit | Value |
|---|---|
| Maximum agents | 1,000 |
| Maximum tools | 500 |
| Maximum response size | 100 MB |
Import
POST /api/projects/:projectId/project-io/import/preview
Perform a dry-run import to preview what changes will be applied without modifying any data. Auth is required Permission:project:import
**Request body
**
| Field | Type | Required | Description |
|---|---|---|---|
files | object | Yes | Map of file paths to content strings |
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the preview succeeded |
preview | object | Preview of operations that will be performed |
error | object | Error details if preview failed |
POST /api/projects/:projectId/project-io/import
Apply an import, creating, updating, or deleting agents as needed. Auth is required Permission:project:import
**Request body
**
| Field | Type | Required | Description |
|---|---|---|---|
files | object | Yes | Map of file paths to content strings |
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the import succeeded |
applied | object | Summary of applied changes |
| Limit | Value |
|---|---|
| Maximum file size (per file) | 1 MB |
| Maximum total content size | 50 MB |
| Maximum file count | 500 |
| Maximum request body | 60 MB |
| Concurrent import lock TTL | 120 seconds |
- Path traversal prevention: Paths containing
.., leading/, null bytes, or backslashes are rejected. - File size limits: Individual files exceeding 1 MB are rejected.
- Total size limits: Combined content exceeding 50 MB is rejected.
- Concurrent import protection: A distributed lock prevents simultaneous imports to the same project.
| Status | Error | Cause |
|---|---|---|
400 | Request body must contain a “files” object | Missing or invalid files field |
400 | File content must be a string | Non-string value in files map |
400 | Invalid file path (path traversal detected) | Path traversal attempt |
400 | File too large (max 1MB) | Individual file exceeds size limit |
400 | Total content size exceeds 50MB | Combined content too large |
400 | Too many files | File count exceeds 500 |
413 | Request body too large | Request body exceeds 60 MB |
409 | Import already in progress | Another import is running for this project |
Workflow: export from one project, import to another
Next steps
- Conversation API — Session and trace details
- Management APIs — Manage imported agents
- SDKs — Parse and validate exported ABL files programmatically