MemorySync
API Reference

Auth Endpoints

The /auth/* route group covers signup, login, refresh, logout, MFA, magic links, and SSO entry points. Most callers use the dashboard for these flows; the endpoints are documented here so SDKs and custom clients can implement the same primitives.
POST/auth/login

Authentication

This endpoint is anonymous — it is the auth boundary itself. Subsequent calls use the returned access_token.

Request body

FieldTypeRequiredDescription
emailstringrequiredUser email.
passwordstringrequiredOmit when using magic-link or MFA-only flows.
mfa_codestringoptionalRequired when MFA is enforced for the user.
request.json
{
"email": "alice@acme.io",
"password": "..."
}

Response

Returns 200 OK with the following body.

FieldTypeRequiredDescription
access_tokenstringoptionalShort-lived JWT.
refresh_tokenstringoptionalLong-lived refresh token (also set as HttpOnly cookie).
userobjectoptional{ id, email, mfa_enforced }.
200.json
{
"access_token": "eyJ...",
"refresh_token": "rt_01HX...",
"user": {
"id": 42,
"email": "alice@acme.io",
"mfa_enforced": true
}
}

Errors

StatusCodeDescription
400validation_errorBody or query failed schema validation. The error includes the offending field name.
401unauthenticatedMissing or invalid bearer token / API key.
403forbiddenAuthenticated principal lacks the required scope, role, or project access.
404not_foundTarget resource does not exist or is not visible to the calling tenant.
429rate_limitedPer-IP or per-route limit exceeded. Respect the Retry-After header.
500internal_errorUnhandled server error. Quote the request_id when contacting support.

Examples

cURL
curl -X POST https://api.memorysync.io/auth/login \
-H "Authorization: Bearer $MEMORYSYNC_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "alice@acme.io",
"password": "..."
}'
javascript
import { MemorySync } from 'memorysync'
const client = new MemorySync({ apiKey: process.env.MEMORYSYNC_KEY })
const result = await client.request({
method: 'POST',
path: '/auth/login',
body: {
"email": "alice@acme.io",
"password": "..."
},
})
console.log(result)
python
from memorysync import Client
client = Client(api_key=os.environ["MEMORYSYNC_KEY"])
result = client.request(
method="POST",
path="/auth/login",
json={
"email": "alice@acme.io",
"password": "..."
},
)
print(result)

Behavior & notes

Companion routes: POST /auth/signup, POST /auth/refresh, POST /auth/logout, POST /auth/mfa/verify, POST /auth/magic-link, GET /sso/initiate. Login is rate-limited to 10 requests / minute / IP. Failed logins are recorded in the audit log with the source IP and user-agent.