Skip to main content
POST
/
v0
/
api-user
/
memories
/
upsert
API User Memories: Upsert Memory
curl --request POST \
  --url https://api.example.com/v0/api-user/memories/upsert \
  --header 'Content-Type: application/json' \
  --data '
{
  "expert_id": 123,
  "end_user_id": "<string>",
  "layer": "<string>",
  "key": "<string>",
  "value": {}
}
'

Overview

Upsert a memory item for one of your end-users. The backend derives the storage namespace from your tenant + end_user_id + expert_id.

Authentication

Send your API key via BBOT-API-Key (or X-API-Key).

Body

expert_id
integer
required
Expert id
end_user_id
string
required
Your end-user identifier
layer
string
required
core | mid | long
key
string
required
Store key (e.g. “profile”, a thread_id, or a deterministic long-memory key)
value
object
required
JSON payload stored for this memory

Example Request

cURL
curl --location 'https://api.b-bot.space/api/v0/api-user/memories/upsert' \
  --header 'Content-Type: application/json' \
  --header 'BBOT-API-Key: <your-bbot-api-key>' \
  --data '{
    "expert_id": 42,
    "end_user_id": "user-123",
    "layer": "long",
    "key": "long_custom_001",
    "value": { "text": "User prefers email over phone.", "tags": ["preference"] }
  }'