API Reference
REST API for HyperSpark Memory
The HyperSpark Memory API allows you to store, retrieve, and manage memories programmatically. Use it to give your AI applications persistent memory across sessions.
https://memory.hypersparkai.com//api/v1Authentication
All API requests require authentication using an API key. You can create API keys from yourdashboard. If your organization provided an API key, you can use it directly; no HyperSpark account required. Ask your org admin about which scopes are enabled.
Authentication Methods
You can authenticate using either method:
curl https://memory.hypersparkai.com//api/v1/memory/recall \
-H "Authorization: Bearer hsmem_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"query": "user preferences"}'API Key Format
API keys follow the format hsmem_ followed by 48 hexadecimal characters.
hsmem_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4API Key Scopes
API keys can have different permission scopes that control what operations they can perform:
| Scope | Permissions |
|---|---|
| read | Query and retrieve memories |
| write | Create and store memories |
| delete | Remove memories (forget operations) |
| admin | All permissions including org-wide operations |
Multi-Tenant Support
All endpoints support an optional tenantId parameter for multi-tenant applications. This allows you to isolate memories by customer or workspace.
// Include tenantId in your request body
{
"tenantId": "tenant_acme_corp",
"userId": "user_123",
"query": "project updates"
}Endpoints
Core Memory
/memory/ingestStore memories from conversations, documents, or manual input
/memory/recallSemantic search with three-factor scoring (recency, importance, relevance)
/memory/recentGet recent memories sorted by creation time
/memory/contextGet assembled context for AI system prompts
/memory/extractPreview extraction without storing (dry run)
Response Format
All API responses follow a consistent JSON format with a success indicator:
{
"success": true,
"data": {
// Response data varies by endpoint
}
}Usage Headers
Responses include headers to help you track usage:
| Header | Description |
|---|---|
| X-Memory-Limit | Total memory storage limit |
| X-Memory-Used | Current memory usage count |
| X-Query-Limit | Monthly query limit |
| X-Query-Used | Queries used this month |
Error Codes
| Status | Code | Description |
|---|---|---|
| 400 | Bad Request | Invalid request body or parameters |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | API key lacks required scope |
| 429 | Too Many Requests | Rate limit or usage limit exceeded |
| 500 | Internal Error | Server-side error (please report) |