MemorySync
API Reference · Control-plane API

Account Authentication

Create, rotate, inspect, and revoke dashboard account sessions with published control-plane SDK methods. Passwords and refresh tokens stay in request bodies and become environment variables in generated examples.

Shared access contract

ControlRequired contract
AuthenticationSignup, login, refresh, and logout use body credentials. Current user and logout-all require a bearer access token.
PermissionCredentials or the active bearer session must belong to the affected account.
Project selectionAccount authentication is never project-scoped and does not send X-Project-ID.

Sign Up

POST/auth/signup
201 Created
FieldTypeContract
emailemailRequired; verification is sent here.
passwordstringRequired; minimum 8 characters.
organization_namestringRequired; 2–100 characters.
full_namestringOptional display name.
import os
from memorysync import ControlPlaneClient
client = ControlPlaneClient(base_url="https://api.memorysync.io")
result = client.signup(
"developer@example.com",
os.environ["MEMORYSYNC_PASSWORD"],
"Example Org",
full_name="Dev User",
)
response.json
{"message":"Registration successful. Please check your email to verify your account.","email":"developer@example.com","requires_verification":true}
  • Signup stages verification; it does not immediately create an active account or session.
  • The user must verify email ownership before login.
ConcernContract
ScopePublic credential exchange; no bearer, API-key, end-user, or project header.
Errors409 for an existing email; 422 for invalid fields.

Login

POST/auth/login
200 OK
FieldTypeContract
emailemailRequired account email.
passwordstringRequired account password.
import os
from memorysync import ControlPlaneClient
client = ControlPlaneClient(base_url="https://api.memorysync.io")
result = client.login(
"developer@example.com",
os.environ["MEMORYSYNC_PASSWORD"],
)
response.json
{"tokens":{"access_token":"<redacted>","refresh_token":"<redacted>","token_type":"bearer"},"session":{"user_id":42,"organization_id":7,"role":"developer"},"mfa_required":false,"mfa_setup_required":false}
  • Treat both returned tokens as secrets.
  • Branch on MFA fields before granting application access.
ConcernContract
ScopePublic credential exchange; no project header.
Errors401 for invalid credentials; 403 for blocked account or organization state.

Refresh Token

POST/auth/refresh
200 OK
FieldTypeContract
refresh_tokenstringRequired by SDK clients; the server also supports secure browser cookies.
import os
from memorysync import ControlPlaneClient
client = ControlPlaneClient(base_url="https://api.memorysync.io")
tokens = client.refresh(
os.environ["MEMORYSYNC_REFRESH_TOKEN"],
)
response.json
{"access_token":"<redacted>","refresh_token":"<redacted>","token_type":"bearer"}
  • A successful refresh rotates the refresh token.
  • Atomically replace the old token pair.
ConcernContract
ScopePublic body-credential exchange; no bearer or project header.
Errors401 for missing, expired, invalid, or replayed refresh tokens; 403 for blocked account or organization state.

Logout

POST/auth/logout
204 No Content
FieldTypeContract
refresh_tokenstringRequired by SDKs so the server can identify and revoke the session.
import os
from memorysync import ControlPlaneClient
client = ControlPlaneClient(base_url="https://api.memorysync.io")
client.logout(
os.environ["MEMORYSYNC_REFRESH_TOKEN"],
)

Response body: none.

  • Clear the local token pair after 204.
  • Without a refresh token the server can return 204 without revoking a session, so both SDKs require one.
ConcernContract
ScopePublic body-credential exchange; no project header.
ErrorsIdempotent 204 after processing the supplied refresh token.

Current User

GET/auth/me
200 OK
FieldTypeContract
Request bodynoneIdentity is read from the bearer token.
import os
from memorysync import ControlPlaneClient
client = ControlPlaneClient(
base_url="https://api.memorysync.io",
access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],
)
identity = client.me()
response.json
{"user_id":"usr_42","role":"developer","org":7,"sid":302}
  • OAuth identities can also include oauth_scopes and oauth_app_id.
  • A revoked session is rejected even when its access token has not expired.
ConcernContract
ScopeCurrent bearer identity; no project header.
Errors401 for missing, invalid, expired, or revoked bearer sessions.

Logout All

POST/auth/logout-all
204 No Content
FieldTypeContract
Request bodynoneThe bearer identifies the account and current session.
import os
from memorysync import ControlPlaneClient
client = ControlPlaneClient(
base_url="https://api.memorysync.io",
access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],
)
client.logout_all()

Response body: none.

  • Every other active session is revoked.
  • The current bearer session remains alive.
ConcernContract
ScopeAll other sessions owned by the current bearer user; no project header.
Errors401 for missing, invalid, expired, or revoked bearer sessions.

Shared handling

Was this page helpful?