---
title: "Create or update a contact memory entry"
url: https://docs.gleap.ai/en/reference/rest-api/create-entry
method: POST
path: "/sessions/{sessionId}/memory"
api: "API Reference"
tag: "ContactMemory"
operationId: "CreateEntry"
updatedAt: "2026-11-01T18:40:15.677Z"
language: en
---

# Create or update a contact memory entry

`POST https://api.gleap.io/v3/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.

## Authorization

- `Authorization` (header, required): `Bearer <token>`

## Path parameters

- `sessionId` (string, required)

## Headers

- `project` (string, required)

## Request body (`application/json`, required)

- `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.

## Example request

```bash
curl --request POST \
  --url 'https://api.gleap.io/v3/sessions/{sessionId}/memory' \
  --header 'Authorization: Bearer <token>' \
  --header 'project: <project>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<name>",
  "content": "<content>"
}'
```

## Responses

### 200 (`application/json`)

Ok

- `ok` (boolean, required)
- `reason` (enum<string>): Only set on internal (non-admin) calls; never present in an admin API 200 response. One of: `disabled`, `no_userId`, `invalid_input`, `session_not_found`.
- `consolidationEnqueued` (boolean)
- `entries` (number<double>)

```json
{
  "ok": true,
  "reason": "disabled",
  "consolidationEnqueued": true,
  "entries": 0
}
```
