API Reference
Forget Memory
Soft-delete one or more memories. The handler flips
retention_status past active, removes the records from every recall path immediately, and queues hard deletion through the retention worker.DELETE/memory/forget
Authentication
Accepts a JWT bearer token (Authorization: Bearer eyJ…) or an API key (X-API-Key: ms_live_…). API-key callers should send X-Project-ID unless the key is project-locked. Cross-tenant operators must send X-Tenant-ID.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
memory_ids | integer[] | required | Ids to forget. Caller must own each id. |
reason | string | optional | Stored on the audit row. |
request.json
{"memory_ids": [184213,184214],"reason": "user request"}
Response
Returns 200 OK with the following body.
| Field | Type | Required | Description |
|---|---|---|---|
(array of integers) | integer[] | optional | Ids that were soft-deleted. Ids the caller did not own are silently skipped. |
200.json
[184213,184214]
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Body or query failed schema validation. The error includes the offending field name. |
| 401 | unauthenticated | Missing or invalid bearer token / API key. |
| 403 | forbidden | Authenticated principal lacks the required scope, role, or project access. |
| 404 | not_found | Target resource does not exist or is not visible to the calling tenant. |
| 429 | rate_limited | Per-IP or per-route limit exceeded. Respect the Retry-After header. |
| 500 | internal_error | Unhandled server error. Quote the request_id when contacting support. |
Examples
cURL
curl -X DELETE https://api.memorysync.io/memory/forget \-H "Authorization: Bearer $MEMORYSYNC_KEY" \-H "Content-Type: application/json" \-d '{"memory_ids": [184213,184214],"reason": "user request"}'
javascript
import { MemorySync } from 'memorysync'const client = new MemorySync({ apiKey: process.env.MEMORYSYNC_KEY })const result = await client.request({method: 'DELETE',path: '/memory/forget',body: {"memory_ids": [184213,184214],"reason": "user request"},})console.log(result)
python
from memorysync import Clientclient = Client(api_key=os.environ["MEMORYSYNC_KEY"])result = client.request(method="DELETE",path="/memory/forget",json={"memory_ids": [184213,184214],"reason": "user request"},)print(result)
Behavior & notes
Returns the list of ids that were transitioned. Hard deletion is performed asynchronously by the retention worker; recall is blocked immediately on the soft-delete write.