Authentication
beginnerRegister, verify email, login, refresh tokens, logout, password reset, and MFA endpoints.
Registration
/v1/auth/registerCreate a new user account. Returns tokens immediately; a verification email is sent in background.
emailstringrequiredValid email address (format: email). Must be unique.
passwordstringrequiredMinimum 12 characters.
full_namestring | nullDisplay name for the account.
namestring | nullAlias for full_name.
organization_namestring | nullIf provided, creates an organization during registration.
{
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"email": "[email protected]",
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"refresh_token": "eyJhbGciOiJSUzI1NiIs...",
"message": "Verification email sent"
}curl -X POST https://api.engramma-memory.com/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "SuperSecure123!",
"full_name": "Alice",
"organization_name": "Acme Corp"
}'Email verification
/v1/auth/verify-emailVerify a user's email address using the token sent during registration.
tokenstringrequiredThe verification token from the email.
{
"message": "Email verified successfully"
}Resend verification
/v1/auth/resend-verificationResend the verification email.
emailstringrequiredThe email address to resend verification to.
{
"message": "Verification email resent"
}Login
/v1/auth/loginAuthenticate and receive access + refresh tokens. If MFA is enabled, returns mfa_required: true instead of tokens.
emailstringrequiredRegistered email address.
passwordstringrequiredAccount password.
mfa_codestring | nullTOTP code (if MFA enabled and you want to complete login in one step).
recovery_codestring | nullRecovery code (alternative to mfa_code).
{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"refresh_token": "eyJhbGciOiJSUzI1NiIs...",
"token_type": "bearer",
"expires_in": 900,
"mfa_required": false
}Access tokens expire in 15 minutes (900s). Use the refresh endpoint to get new tokens. If mfa_required is true, use the MFA login endpoint to complete authentication.
curl -X POST https://api.engramma-memory.com/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "SuperSecure123!"}'Refresh token
/v1/auth/refreshExchange a refresh token for a new access + refresh token pair.
refresh_tokenstringrequiredThe current refresh token.
{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"refresh_token": "eyJhbGciOiJSUzI1NiIs...",
"token_type": "bearer",
"expires_in": 900,
"mfa_required": false
}Logout
/v1/auth/logoutInvalidate the current session.
{
"message": "Logged out successfully"
}Logout all sessions
/v1/auth/logout-allInvalidate all active sessions for the current user.
{
"message": "All sessions revoked"
}Forgot password
/v1/auth/forgot-passwordSend a password reset link to the user's email.
emailstringrequiredThe email address for the account.
{
"message": "If an account exists with this email, a reset link has been sent"
}Always returns 200 to prevent email enumeration.
Reset password
/v1/auth/reset-passwordSet a new password using the reset token from the email.
tokenstringrequiredThe reset token from the email link.
new_passwordstringrequiredNew password (minimum 12 characters).
{
"message": "Password reset successfully"
}MFA: Enable
/v1/auth/mfa/enableStart the MFA enrollment process.
{
"message": "MFA enrollment started"
}MFA: Setup
/v1/auth/mfa/setupGet the TOTP secret and otpauth URI for QR code display.
{
"secret": "JBSWY3DPEHPK3PXP",
"otpauth_uri": "otpauth://totp/Engramma:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Engramma",
"message": "Scan the QR code, then verify with a code to enable MFA"
}MFA: Verify
/v1/auth/mfa/verifyConfirm MFA setup by providing the first TOTP code. Returns recovery codes.
codestringrequiredA 6-digit TOTP code from the authenticator app.
{
"message": "MFA enabled successfully",
"recovery_codes": [
"a1b2c3d4e5f6",
"g7h8i9j0k1l2",
"m3n4o5p6q7r8",
"s9t0u1v2w3x4",
"y5z6a7b8c9d0"
]
}Store recovery codes securely. They cannot be retrieved after this response. Each code can only be used once.
MFA: Login
/v1/auth/mfa/loginComplete login when MFA is required. Called after login returns mfa_required: true.
codestringrequired6-digit TOTP code or a recovery code.
tokenstring | nullTemporary MFA token (if provided by the login response).
{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"refresh_token": "eyJhbGciOiJSUzI1NiIs...",
"token_type": "bearer",
"expires_in": 900
}MFA: Disable
/v1/auth/mfa/disableDisable MFA on the account. Requires a valid TOTP code.
codestringrequiredA valid 6-digit TOTP code to confirm identity.
{
"message": "MFA disabled successfully"
}JWKS (JSON Web Key Set)
/.well-known/jwks.jsonPublic keys for JWT signature verification. Use this to validate tokens client-side.
{
"keys": [
{
"kty": "RSA",
"kid": "...",
"use": "sig",
"alg": "RS256",
"n": "...",
"e": "AQAB"
}
]
}User profile
User profile management has moved to dedicated endpoints:
GET /v1/users/me— Get current user profilePATCH /v1/users/me— Update profileDELETE /v1/users/me— Delete accountPUT /v1/users/me/password— Change password
See Users for details.
Next steps
- Memory Core — Store and retrieve memories
- Security — Session management and audit logs
- Errors — Authentication error codes