Debugging / Access failures
Authentication Issues
Authentication problems are usually a missing header rather than a bad key. Work through the three that account for most failures.
Diagnosis
Match the symptom to the cause
Cause
The call authenticated fine, but it did not say which of your end users it is for.
Fix
Send X-End-User-ID (or the end_user_id body field). Memory is always scoped to a tenant, project, and user, so this cannot be inferred from the key.
Reference
Headers an API-key call needs
- X-API-Key
- Required. Identifies your organization.
- X-End-User-ID
- Required for API-key and OAuth client-credential callers. Identifies which of your end users the call is for.
- X-Project-ID
- Optional, but send it deliberately when you use projects — it decides which scope is read and written.
- Content-Type
- application/json on any request with a body.
curl --include --request POST https://api.memorysync.io/memory/add \
--header "X-API-Key: $MEMORYSYNC_API_KEY" \
--header "X-End-User-ID: user_42" \
--header "Content-Type: application/json" \
--data '{"text":"auth smoke test"}'
# omit X-End-User-ID and you get 400 MISSING_END_USER_ID, not 401Was this page helpful?