API Reference
Add Conversation Turn
Send a conversation turn and let extraction decide what is worth remembering from it.
Endpoint and request fields
POST/v1/memory/add_turn
200 OK
| Field | Type | Contract |
|---|---|---|
tenant_id | string | Required tenant identifier. |
user_id | string | Required end-user identifier. |
messages | array | Required turn, as role and content objects. |
session_id | string | Optional conversation grouping. |
metadata | object | Optional metadata applied to what is extracted. |
Add a turn
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.add_turn(tenant_id="acme",user_id="usr_7f3a9c2e",messages=[{"role": "user", "content": "I always fly with the window seat."},{"role": "assistant", "content": "Noted."},],)
Result handling
Extraction decides what, if anything, is worth storing. A turn that carries no durable fact stores nothing and reports a skip — that is a normal outcome, not a failure.
Errors and next action
A 422 means a missing tenant_id, user_id or messages. For 429 or 5xx, keep the turn so it can be replayed.