From 515f87b6bdaad9acd87eca0cf8636efb2942c3b6 Mon Sep 17 00:00:00 2001 From: Utkarsh Date: Thu, 26 Mar 2026 20:05:23 +0530 Subject: [PATCH] docs: fix OSS REST API endpoint discrepancies (#4555) Co-authored-by: utkarsh240799 Co-authored-by: Claude Opus 4.6 (1M context) --- docs/open-source/features/rest-api.mdx | 34 +++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/docs/open-source/features/rest-api.mdx b/docs/open-source/features/rest-api.mdx index 2d6f38930..576b98c1b 100644 --- a/docs/open-source/features/rest-api.mdx +++ b/docs/open-source/features/rest-api.mdx @@ -13,6 +13,10 @@ The Mem0 REST API server exposes every OSS memory operation over HTTP. Run it al - You plan to explore or debug endpoints through the built-in OpenAPI page at `/docs`. + + **OSS vs Platform API paths:** The self-hosted OSS server does **not** use the `/v1/` prefix. For example, the endpoint is `POST /memories`, not `POST /v1/memories/`. The [API Reference](/api-reference) documents the hosted platform at `api.mem0.ai` which uses `/v1/` paths — those do not apply to the OSS server. + + Enable API key authentication (see below) and HTTPS before exposing the server to anything beyond your internal network. @@ -147,13 +151,18 @@ curl -X POST http://localhost:8000/memories \ ```bash -curl "http://localhost:8000/memories/search?user_id=alice&query=vegetable" +curl -X POST http://localhost:8000/search \ + -H "Content-Type: application/json" \ + -d '{ + "query": "vegetable", + "user_id": "alice" + }' ``` ### Explore with OpenAPI docs -1. Navigate to `http://localhost:8000/docs`. -2. Pick an endpoint (e.g., `POST /memories/search`). +1. Navigate to `http://localhost:8000/docs`. +2. Pick an endpoint (e.g., `POST /search`). 3. Fill in parameters and click **Execute** to try requests in-browser. @@ -162,6 +171,25 @@ curl "http://localhost:8000/memories/search?user_id=alice&query=vegetable" --- +## Endpoint reference + +The OSS REST server exposes the following endpoints. None use the `/v1/` prefix. + +| Method | Path | Description | +|--------|------|-------------| +| `POST` | `/configure` | Set memory configuration | +| `POST` | `/memories` | Create memories | +| `GET` | `/memories` | Get all memories (filter by `user_id`, `agent_id`, or `run_id`) | +| `GET` | `/memories/{memory_id}` | Get a specific memory | +| `PUT` | `/memories/{memory_id}` | Update a memory | +| `DELETE` | `/memories/{memory_id}` | Delete a specific memory | +| `DELETE` | `/memories` | Delete all memories for an identifier | +| `GET` | `/memories/{memory_id}/history` | Get memory history | +| `POST` | `/search` | Search memories | +| `POST` | `/reset` | Reset all memories | + +--- + ## Verify the feature is working - Hit the root route and `/docs` to confirm the server is reachable.