mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-27 06:15:15 +00:00
Fixes namespace, auth and SDK-shape docs.
- **Namespace move example deleted instead.** It sent `moveTo` in a JSON body on `DELETE /ns/{namespace}`. The route only reads `moveTo` from the query string and ignores the body, so following the docs permanently deleted the namespace. It now uses `?moveTo=`, and the overview warns about this.
- **SDK call shape.** URL values are positional (`namespace` first), followed by one options object; the docs described one object with `body`. Python 5.0.0 is the v5 client, so "no v5 Python SDK" is gone.
- **Scoped keys** (`authentication.mdx`):
- The allowed-endpoints list now includes the `/ns/*` routes; all legacy routes are kept.
- `containerTags` (several namespaces) is documented.
- Namespace names don't allow dots.
- **Key permissions.** Read/write applies to the whole key; only restricted members have per-namespace permissions.
- **Smaller fixes:**
- The move response has no `success` field.
- `namespaceCount` only matches the namespace list for an unrestricted key.
- `setup --json` does nothing.
- The agent prompt's ban on `memories.*` now covers only the calls v5 removed.
Checked against the current API and the published SDKs (TS 5.0.1, Python 5.0.0). Legacy v3/v4 docs are unchanged apart from factual fixes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
48 lines
1.7 KiB
Text
48 lines
1.7 KiB
Text
---
|
|
title: "API reference"
|
|
sidebarTitle: "Overview"
|
|
description: "Documents, search, profiles, lists, memories, namespaces, and organization settings in the latest Supermemory API"
|
|
icon: "/icons/hugeicons/plug-socket.svg"
|
|
---
|
|
|
|
import MigrateCli from "/snippets/migrate-cli.mdx";
|
|
|
|
v5 makes namespace scope explicit in the URL and consolidates overlapping legacy operations.
|
|
|
|
```text
|
|
https://api.supermemory.ai
|
|
/ns/{namespace}/document
|
|
/ns/{namespace}/search
|
|
/ns/{namespace}/profile
|
|
/ns/{namespace}/list/{type}
|
|
/ns/{namespace}/memories
|
|
/namespaces
|
|
/organization
|
|
```
|
|
|
|
<MigrateCli legacy="v3 or v4" guideHref="/migration/api-v5" guideLabel="v5 migration guide" />
|
|
|
|
Use the [v5 reference](https://api.supermemory.ai/v5/reference) for the stable v5 API. [`/reference`](https://api.supermemory.ai/reference) always points to the latest public version.
|
|
|
|
## Install the TypeScript SDK
|
|
|
|
```bash
|
|
npm i supermemory
|
|
```
|
|
|
|
```ts
|
|
import { Supermemory } from "supermemory"
|
|
|
|
const supermemory = new Supermemory({ apiKey: process.env.SUPERMEMORY_API_KEY })
|
|
```
|
|
|
|
URL values are positional arguments (`namespace` first, then `id` where there is one), and everything else goes in one object: `supermemory.add("user_123", { content })`. Each reference page below shows the SDK call next to the equivalent `curl`. The Python SDK (`pip install supermemory`, 5.0.0 and later) follows the same shape with keyword arguments: `client.add("user_123", content="...")`.
|
|
|
|
<CardGroup cols={2}>
|
|
<Card title="Migrate to v5" icon="arrow-up-right" href="/migration/api-v5">
|
|
Translate every v3/v4 request and response deterministically.
|
|
</Card>
|
|
<Card title="Authentication" icon="key" href="/authentication">
|
|
Authenticate with the same bearer API keys used by legacy endpoints.
|
|
</Card>
|
|
</CardGroup>
|