REST
REST from Postman
You can drive every SDK method from Postman without writing any code. Set up a workspace once with a handful of variables and a header preset, and every memory route is one click away. This page is the shortest path from a fresh workspace to a working request.
Workspace variables to define
| Name | Initial value | Used for |
|---|---|---|
| baseUrl | https://api.memorysync.io | Reference as {{baseUrl}} in every request URL. |
| apiKey | <paste your key> | Reference as {{apiKey}} in the X-API-Key header. Mark as a Secret. |
| endUserId | <your end user id> | Reference as {{endUserId}} in the X-End-User-ID header. Required when authenticating with an API key. |
| projectId | (optional) | Reference as {{projectId}} when scoping to one project. |
A header preset to reuse
Open Settings → Header presets and create one called memorysync:
TEXT
X-API-Key: {{apiKey}}X-End-User-ID: {{endUserId}}Content-Type: application/jsonAccept: application/jsonX-Project-ID: {{projectId}}
X-End-User-ID is not optional
Leave it out of the preset and every call returns HTTP 400 with
MISSING_END_USER_ID. {{endUserId}} must resolve to a non-empty value at request time.Skip the project header when not used
Postman sends headers as-is. If
{{projectId}} is empty, remove that row from your preset for the request — the API treats a missing header and an empty value differently.Your first request: GET /memory/export
- Create a new request:
GET{{baseUrl}}/memory/export. - Apply the memorysync header preset (so both
X-API-KeyandX-End-User-IDare attached). - Send. A success returns a JSON body with
user_id,memories, andgenerated_at. - If you get 400 MISSING_END_USER_ID, your
endUserIdvariable is unset or empty. - If you get 401/403, double-check your
apiKeyvariable.
POST /memory/add
JSON
{"text": "The launch is on Friday.","source": "slack","tags": ["plan", "launch"],"importance": 0.8}
POST /memory/query
JSON
{"query": "when is launch","k": 5,"filters": { "tags": ["plan"] }}
DELETE /memory/forget (with body)
Postman supports request bodies on DELETE. Set method to DELETE, URL to {{baseUrl}}/memory/forget, and add a JSON body:
JSON
{"memory_ids": [42, 43],"reason": "wrong"}
A tests-tab snippet that captures the request id
Paste this into the Tests tab of any request to surface the X-Request-ID in your console.
JAVASCRIPT
pm.test("X-Request-ID is present", () => {pm.response.to.have.header("X-Request-ID");});console.log("request id:", pm.response.headers.get("X-Request-ID"));console.log("status:", pm.response.code);
Running the whole flow with the collection runner
- Group your requests under a folder named for the route family (
memory/add,memory/query, ...). - Use the runner to execute add → query → forget end-to-end against staging before promoting to live.
- If a request returns 429, slow the runner down with the built-in delay; retrying immediately just trips the rate limiter again.