---
title: "Create or replace a memory file"
method: PUT
path: "/v1/memory-files"
tags: ["Memory files"]
---

# Create or replace a memory file

`PUT /v1/memory-files`

## Request

- Base URL: `https://brain.inite.ai`
- URL: `https://brain.inite.ai/v1/memory-files`
- Auth: HTTP bearer

Stores `content` verbatim at `path`. No normalisation of any kind: the memory tool’s `str_replace` is a string operation against exactly these bytes, so re-wrapping or trimming would corrupt the model’s own notes in a way that reads as hallucination. A second write to the same path replaces. `userId` scopes the file to one end user — two people sharing a workspace key get separate files at the same path, which is deliberate. Source: src/memory-files/memory-file.controller.ts.

Required scope: `brain:write`.

## Request body

- MemoryFileWriteRequest
  - `content` string, required
  - `path` string, required: Absolute path under /memories, e.g. /memories/user_prefs.md
  - `userId` string

## Response `200`

The stored file.

- MemoryFile
  - `content` string, required
  - `path` string, required
  - `updatedAt` string, required

## Other responses

- `400`: Validation failed.
- `401`: Missing or unknown bearer key.
- `403`: The key lacks the required scope.

---

[API](https://skmtc.dev/inite/apis/inite-brain-platform-api.md) · [All operations](https://skmtc.dev/inite/apis/inite-brain-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/inite/apis/inite-brain-platform-api/revisions/c7c3eb5e304b?raw)
