Export Memory
Export memories available to the authenticated principal and optional project scope as one JSON bundle.
Endpoint and request fields
This operation has no request body. Client configuration or REST headers provide authentication and optional project scope.
Export the scoped bundle
import osfrom memorysync import MemorySyncClientclient = MemorySyncClient(api_key=os.environ["MEMORYSYNC_API_KEY"],base_url="https://api.memorysync.io",project_id=os.environ["MEMORYSYNC_PROJECT_ID"],end_user_id="usr_7f3a9c2e",)result = client.export_all()print(result.generated_at, len(result.memories))
Result paths
| Meaning | Python | Node.js | REST |
|---|---|---|---|
| Resolved user | result.user_id | result.userId | user_id |
| Exported records | result.memories | result.memories | memories |
| Generation time | result.generated_at | result.generatedAt | generated_at |
{"user_id":42,"memories":[{"id":101,"text":"The user prefers concise answers.","tags":["preference"]}],"generated_at":"2026-05-04T12:32:00Z"}
Errors and next action
Correct authentication or scope errors before trying again. If the request is rate limited or the service cannot complete it, keep the export action recoverable and use the returned error metadata. Send only the documented request shape.
Safety notes
Understand the export bundle
Principal-scoped JSON bundle
The response can be empty and is not paginated by query controls.
- Principal
- `user_id` / `userId`
Resolved authenticated principal represented by the export.
- Records
- `memories`
Array of exported memory dictionaries available in scope.
- Generated
- `generated_at` / `generatedAt`
Time the bundle was produced.
- Request body
- None
Authentication and optional project context come from client configuration or headers.
Handle exports as sensitive application data
- Authorize the export action in your application before calling MemorySync.
- Do not expose the API key or raw service response through a public URL.
- Stream or store the result only in destinations allowed by your data policy.
- Safely encode untrusted text and metadata before display.
- Record completion without logging the exported memory payload.