API Reference
Store Memory
POST /v1/memories
Store a memory for a user.
Headers
Authorization: Bearer db_your_api_key
Content-Type: application/json
Request body
| Field | Type | Required | Description | |-------|------|----------|-------------| | userId | string | Yes | Your user's ID | | text | string | Yes | Text to remember | | appId | string | No | App identifier | | metadata | object | No | Custom metadata |
Example
const result = await memory.store({
userId: 'user_123',
text: 'User is building a SaaS in Next.js',
appId: 'my-chatbot',
metadata: { source: 'onboarding' }
})result = memory.store(
user_id="user_123",
text="User is building a SaaS in Next.js",
app_id="my-chatbot",
metadata={"source": "onboarding"}
)curl -X POST https://api.databaset.com/v1/memories \
-H "Authorization: Bearer db_..." \
-H "Content-Type: application/json" \
-d '{
"userId": "user_123",
"text": "User is building a SaaS in Next.js",
"appId": "my-chatbot"
}'Response
{
"id": "mem_a1b2c3d4",
"userId": "user_123",
"appId": "my-chatbot",
"createdAt": "2026-01-15T10:30:00Z"
}Errors
| Status | Code | Description | |--------|------|-------------| | 401 | auth_error | Invalid or missing API key | | 422 | validation_error | Missing required fields | | 429 | rate_limit | Too many requests | | 500 | server_error | Internal server error |