supermemory/apps/docs/v5/api-reference/content-management.mdx
sreedharsreeram f3001517d1 docs: explain optional content in v5 document lists (#1830)
## Why

The document operations guide did not describe how to retrieve extracted text from a v5 document list, and the migration guide incorrectly said the list `include` object was for memories only.

## What changed

- Document `include.content`, its `false` default, and a cURL request for uploaded files in the same section pattern as the surrounding guide.
- Explain that list content is the last published extracted text, including the behavior before first publication and during failed replacement.
- Correct the v5 migration and reference overview copy.

```mermaid
flowchart LR
  A[Document operations guide] --> B[include.content request]
  B --> C[Published extracted text in list response]
```

## Validation

- Compared the guide and migration snippet with adjacent v5 docs for format and terminology.
- `git diff --check` — passed.
- `python3 -m json.tool apps/docs/docs.json` — passed.

Related API PR: https://github.com/supermemoryai/mono/pull/3606

The written docs should publish with or after the API change. The generated v5 reference reads the deployed OpenAPI source, so it updates when that source is available and the docs site refreshes.
2026-10-21 18:19:21 +00:00

46 lines
2.1 KiB
Text

---
title: "Content management"
sidebarTitle: "Overview"
description: "Retrieve, list, and remove documents, chunks, and memories"
icon: "/icons/hugeicons/book-open-01.svg"
---
Inspect the context stored in a namespace and remove information that should no longer be used. Retrieve a document with its derived context, page through any resource type, or forget documents and memories precisely.
| Operation | Purpose |
| --- | --- |
| `GET /ns/{namespace}/document/{id}` | Retrieve source content with its chunks or memories |
| `GET /ns/{namespace}/memories/{id}` | Retrieve one memory with its history, connected memories, or source document |
| `POST /ns/{namespace}/list/{type}` | Page through documents, chunks, or memories |
| `DELETE /ns/{namespace}/document` | Remove one or many documents |
| `DELETE /ns/{namespace}/memories` | Forget reviewed memories by exact ID |
| `DELETE /ns/{namespace}/memories/semantic` | Find and forget memories by meaning |
<CodeGroup>
```ts TypeScript
const doc = await supermemory.documents.get("user_1", "conv_1", {
include: ["chunks", "memories"],
})
const { documents, pagination } = await supermemory.list("user_1", "documents", {
page: 1,
limit: 50,
sort: "createdAt",
order: "desc",
})
```
```bash curl
curl "https://api.supermemory.ai/ns/user_1/document/conv_1?include=chunks&include=memories" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY"
curl -X POST "https://api.supermemory.ai/ns/user_1/list/documents?page=1&limit=50&sort=createdAt&order=desc" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
```
</CodeGroup>
Document lists omit `content` by default. Send `{"include":{"content":true}}` to return published extracted text, including text from uploaded files. See [Document operations](/ingestion/document-operations) for response and processing details.
Semantic forgetting supports `dryRun: true`, so you can review matches before deleting them. See [document read migration](/migration/api-v5-document-reads) and [memory forgetting migration](/migration/api-v5-memory-forgetting).