MemorySync
SDKs · Direct HTTP

Direct HTTPS with cURL

Use cURL to inspect the public HTTPS contract, test credentials from a trusted terminal, or integrate from a language without an official SDK.

When direct HTTPS fits

Client choices

Use an official SDK

Preferred for Python and Node.js services.

  • Typed methods and errors.
  • Language-native naming.
  • Less request boilerplate.

Use direct HTTPS

Useful for protocol inspection or another backend language.

  • Explicit headers and JSON.
  • Manual status handling.
  • Exact wire field names.

Set local variables

terminal
export MEMORYSYNC_API_KEY="your-api-key"
export MEMORYSYNC_PROJECT_ID="your-project-id"
export MEMORYSYNC_END_USER_ID="usr_7f3a9c2e"

Add one memory

add-memory.sh
curl --request POST https://api.memorysync.io/memory/add \
--header "X-API-Key: $MEMORYSYNC_API_KEY" \
--header "X-Project-ID: $MEMORYSYNC_PROJECT_ID" \
--header "X-End-User-ID: $MEMORYSYNC_END_USER_ID" \
--header "Content-Type: application/json" \
--data '{
"text": "The user prefers concise answers.",
"source": "profile",
"tags": ["preference"]
}'

Query with the same scope

query-memory.sh
curl --request POST https://api.memorysync.io/memory/query \
--header "X-API-Key: $MEMORYSYNC_API_KEY" \
--header "X-Project-ID: $MEMORYSYNC_PROJECT_ID" \
--header "X-End-User-ID: $MEMORYSYNC_END_USER_ID" \
--header "Content-Type: application/json" \
--data '{"query":"How should I format the answer?","k":5}'

Inspect status and headers

inspect-response.sh
curl --include --request GET https://api.memorysync.io/memory/101 \
--header "X-API-Key: $MEMORYSYNC_API_KEY" \
--header "X-Project-ID: $MEMORYSYNC_PROJECT_ID" \
--header "X-End-User-ID: $MEMORYSYNC_END_USER_ID"

Read the HTTP status before consuming the body. Capture a returned request identifier for support only when one is present, and never log the credential headers.

Use the correct authentication family

Operation familyAuthenticationScope
Memory APIX-API-KeyProject and, for user-scoped operations, opaque end-user ID
Protected control planeAuthorization: Bearer ...Authenticated account or organization and optional project
LoginNo bearer tokenEmail/password credential exchange from a trusted context

Continue with exact contracts

Was this page helpful?