---
title: "Create or update a contact memory entry"
method: POST
path: "/sessions/{sessionId}/memory"
tags: ["ContactMemory"]
---

# Create or update a contact memory entry

`POST /sessions/{sessionId}/memory`

Create or upsert a memory entry by name. Returns `{ ok: true, entries: <count after the write> }`;
invalid input returns 400 and an unknown session 404. Staff writes work even when the project's
contact-memory feature is disabled.

## Path parameters

- `sessionId` string, required

## Headers

- `project` string, required

## Request body

- ContactMemoryEntryBody
  - `name` string, required — Trimmed and truncated to 80 characters; the entry is keyed by this value.
  - `description` string — Optional. Omitting it clears the stored description on update (full replace). Truncated to 240 characters.
  - `content` string, required — Required. Truncated to 4000 characters.

## Response `200`

Ok

- ContactMemoryWriteResult
  - `ok` boolean, required
  - `reason` 'disabled' | 'no_userId' | 'invalid_input' | 'session_not_found' — Only set on internal (non-admin) calls; never present in an admin API 200 response.
  - `consolidationEnqueued` boolean
  - `entries` number, double

---

[API](https://skmtc.net/gleap/apis/gleap-server.md) · [All operations](https://skmtc.net/gleap/apis/gleap-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gleap/gleap-server/versions/2bfe054193b5/schema)
