MemorySync
API Reference

Upload File

Send a document and store the memories extracted from its text. Reuses the same parsers the connectors use, so a format supported by a connector is supported here.

Endpoint and form fields

POST/memory/upload
201 Created or normal 200 Skipped

This is the one memory operation that sends multipart/form-data rather than JSON.

FieldTypeContract
filefileRequired. The parser is chosen from the filename extension, so a filename is required.
sourcestringOptional origin label. Defaults to upload.
metadatastringOptional JSON object, sent as a string in a form field.
end_user_idstringOptional; mirrors the X-End-User-ID header.

Accepted formats

PDF, DOCX, PPTX, XLSX, CSV, plain text, Markdown, HTML and source code, plus images, audio and video wherever a transcriber is configured. This is the identical parser set the sync pipeline runs, so a format is never accepted by a connector and refused here.

Upload a document

import os
from memorysync import MemorySyncClient
client = 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",
)
with open("handbook.pdf", "rb") as fh:
result = client.upload(
fh,
filename="handbook.pdf",
source="onboarding",
metadata={"team": "support"},
)

Do not set Content-Type yourself

do-not-do-this.sh
# Wrong — overrides the boundary and every field appears missing
curl --request POST https://api.memorysync.io/memory/upload \
--header "Content-Type: multipart/form-data" \
--form "file=@handbook.pdf"

Result paths

Upload status behavior
201
Created

The response is the first stored Memory. A document usually yields several; use Query to see the rest.

200
Skipped

Normal outcome. A blank scan, a sheet of empty cells, or content the extractor judges trivial all land here. Read reason; nothing was stored.

413
Too large

The file exceeded the upload ceiling. Enforced while reading the stream, not from the declared length.

200-skipped.json
{"status":"skipped","reason":"no_extractable_text","filename":"blank.pdf","file_type":"pdf","memory_ids":[]}

Billing

Billed as an add: one unit per memory created, exactly like the connector path. A document that produces fifteen memories costs fifteen. Over-quota uploads return the silent success envelope and store nothing.

Errors and next action

A 422 means the file could not be parsed as the type its extension claims. A 413 means the ceiling was exceeded. For 429 or 5xx, do not assume whether an interrupted upload stored anything — query before retrying.

Safety notes