Skip to main content
POST
/
api
/
Memory
/
write
Store a new memory (background processing)
curl --request POST \
  --url https://app.recallio.ai/api/Memory/write \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "userId": "user_123",
  "content": "[{ \"role\": \"user\", \"content\": \"I prefer dark mode\" }, { \"role\": \"assistant\", \"content\": \"I will set the dark mode\" }]",
  "consentFlag": true,
  "projectId": "project_abc",
  "tags": [
    "preferences",
    "ui",
    "notifications"
  ],
  "metadata": {
    "timestamp": "2025-08-02T14:30:00Z",
    "category": "user-preferences",
    "source": "settings-page"
  }
}
'
{
  "error": "\"Invalid scope type. Must be 'user', 'project', or 'team'.\""
}

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"

Body

userId
string
required

Unique identifier for the user storing the memory

Minimum string length: 1
Example:

"user_123"

content
string
required

The actual content/text to be stored. This can be either a string or a JSON object. The JSON object format is: [{ "role": "user", "content": "string" }, { "role": "assistant", "content": "string" }]

Required string length: 1 - 30000
Example:

"[{ \"role\": \"user\", \"content\": \"I prefer dark mode\" }, { \"role\": \"assistant\", \"content\": \"I will set the dark mode\" }]"

User consent flag - must be true to store the memory (required for compliance)

Example:

true

projectId
string | null

Project identifier to associate the memory with (optional)

Example:

"project_abc"

tags
string[] | null

Optional tags to categorize and filter memories

Example:
["preferences", "ui", "notifications"]
metadata
any | null

Optional JSON Metadata to categorize and filter memories

Example:
{
"timestamp": "2025-08-02T14:30:00Z",
"category": "user-preferences",
"source": "settings-page"
}

Response

Accepted