MemorySync
API Reference

OAuth Memory API

The memory operations available to third-party OAuth applications. Authentication is an OAuth 2.0 bearer access token issued by the MemorySync authorization flow — not an API key — and every operation is bound to the user who granted consent.

Authentication and scopes

Register an OAuth application in the dashboard (Settings → OAuth Apps), send the user through the consent flow, and exchange the authorization code for tokens. Discovery documents are published at /.well-known/oauth-authorization-server. These endpoints require a user-scoped token from the authorization_code grant; a client_credentials token is rejected with 400 because there is no user to act for.

ScopeGrants
memory:readQuery and list the granting user's memories.
memory:writeStore new memories for the granting user.
memory:deleteDelete the granting user's memories.

Store a memory

POST/v1/oauth/memories
201 Created

Runs the same extraction pipeline as every other write surface — there is no raw-storage branch, and pure chatter returns 201 with status: "skipped".

FieldTypeContract
textstringRequired raw content, minimum 10 characters.
sourcestringOptional origin label. Defaults to oauth.
metadataobjectOptional metadata persisted with stored candidates.
tagsstring[]Optional semantic tags.
importancenumberOptional importance hint, 0.0–1.0.
deduplicatebooleanDefaults to true.
response.json
{"memory_id":"m_402","status":"created","memory_ids":["m_402"],"candidates_extracted":1,"candidates_stored":1,"candidates_updated":0,"candidates_deduped":0,"candidates_rejected":0}
store.sh
curl --request POST https://api.memorysync.io/v1/oauth/memories \
--header "Authorization: Bearer $OAUTH_ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"text":"Prefers release notes as bullet points.","tags":["preference"]}'

Query memories

POST/v1/oauth/memories/query
200 OK
FieldTypeContract
querystringRequired natural-language query.
kintegerOptional result ceiling, 1–50. Defaults to 5.
filtersobjectOptional filter object.
response.json
{"memories":[{"memory_id":"m_402","text":"Prefers release notes as bullet points.","source":"oauth","summary":null,"metadata":null,"importance":0.5,"score":0.9,"created_at":"2026-08-22T10:00:04Z"}],"count":1}
query.sh
curl --request POST https://api.memorysync.io/v1/oauth/memories/query \
--header "Authorization: Bearer $OAUTH_ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"query":"formatting preferences","k":5}'

List memories

GET/v1/oauth/memories
200 OK
ParameterTypeContract
limitinteger queryOptional page size. Defaults to 50.
offsetinteger queryOptional page offset. Defaults to 0.

Returns the granting user's memories newest-first. total is the number of records in this page.

list.sh
curl "https://api.memorysync.io/v1/oauth/memories?limit=50&offset=0" \
--header "Authorization: Bearer $OAUTH_ACCESS_TOKEN"

Delete memories

DELETE/v1/oauth/memories
200 OK
FieldTypeContract
memory_idsstring[]Required IDs to delete, in the m_… form returned by other operations.

Only memories owned by the granting user are deleted; unknown or unowned IDs are skipped rather than reported, so compare deleted_ids with what you sent.

response.json
{"deleted_ids":["m_402"]}
delete.sh
curl --request DELETE https://api.memorysync.io/v1/oauth/memories \
--header "Authorization: Bearer $OAUTH_ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"memory_ids":["m_402"]}'

Quota behaviour

Errors and next action

A 401 means a missing, expired, or revoked token — run the refresh flow. A 403 means the token lacks the required scope; request the scope during consent instead of retrying. A 400 with "requires a user-scoped token" means the token came from client_credentials; use the authorization_code grant.

Safety notes

Was this page helpful?