# Memory files

> List the reference files behind a memory guide, read one as text, or download it.

Source: https://docs.generalinput.com/api/memory/files



<Access scope="memory:manage" />

The [memory guide](/api/memory/get) is rendered from a set of files: the `SKILL.md` guide itself, extracted text references, and the original uploads they came from. These routes list and read those files. `:ownerType` is `organization` or `membership`.

## List [#list]

<Endpoint method="GET" path="/v1/memory/:ownerType/files" />

```json
{
  "files": [
    {
      "path": "SKILL.md",
      "title": "Memory",
      "description": "The rendered guide.",
      "kind": "text",
      "mimeType": "text/markdown",
      "sizeBytes": null
    },
    {
      "path": "originals/file_01HX…/handbook.pdf",
      "title": "handbook.pdf",
      "description": "Uploaded original.",
      "kind": "original",
      "mimeType": "application/pdf",
      "sizeBytes": 184320
    }
  ]
}
```

`kind` is `text` for the guide and its extracted references, `original` for an uploaded file kept under `originals/<fileId>/<filename>`.

## Read one file [#read-one-file]

<Endpoint method="GET" path="/v1/memory/:ownerType/files/text?path=" />

Returns `{ "path": "…", "text": "…" }`. A binary file answers `400`; download it instead.

<Endpoint method="GET" path="/v1/memory/:ownerType/files/download?path=" />

Streams the raw bytes with the file's content type.

## Download everything [#download-everything]

<Endpoint method="GET" path="/v1/memory/:ownerType/files/bundle" />

Every memory file as one gzipped tar.

## Errors [#errors]

| Status | When                                                                   |
| ------ | ---------------------------------------------------------------------- |
| `400`  | Missing `path`, invalid `ownerType`, or reading a binary file as text. |
| `403`  | The member may not read this owner's memory.                           |
| `404`  | No file at `path`.                                                     |
