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
| Control | Required contract |
|---|---|
| Authentication | Signup, login, refresh, and logout use body credentials. Current user and logout-all require a bearer access token. |
| Permission | Credentials or the active bearer session must belong to the affected account. |
| Project selection | Account authentication is never project-scoped and does not send X-Project-ID. |
Sign Up
POST/auth/signup
201 Created
| Field | Type | Contract |
|---|---|---|
email | Required; verification is sent here. | |
password | string | Required; minimum 8 characters. |
organization_name | string | Required; 2–100 characters. |
full_name | string | Optional display name. |
import osfrom memorysync import ControlPlaneClientclient = 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.
| Concern | Contract |
|---|---|
| Scope | Public credential exchange; no bearer, API-key, end-user, or project header. |
| Errors | 409 for an existing email; 422 for invalid fields. |
Login
POST/auth/login
200 OK
| Field | Type | Contract |
|---|---|---|
email | Required account email. | |
password | string | Required account password. |
import osfrom memorysync import ControlPlaneClientclient = 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.
| Concern | Contract |
|---|---|
| Scope | Public credential exchange; no project header. |
| Errors | 401 for invalid credentials; 403 for blocked account or organization state. |
Refresh Token
POST/auth/refresh
200 OK
| Field | Type | Contract |
|---|---|---|
refresh_token | string | Required by SDK clients; the server also supports secure browser cookies. |
import osfrom memorysync import ControlPlaneClientclient = 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.
| Concern | Contract |
|---|---|
| Scope | Public body-credential exchange; no bearer or project header. |
| Errors | 401 for missing, expired, invalid, or replayed refresh tokens; 403 for blocked account or organization state. |
Logout
POST/auth/logout
204 No Content
| Field | Type | Contract |
|---|---|---|
refresh_token | string | Required by SDKs so the server can identify and revoke the session. |
import osfrom memorysync import ControlPlaneClientclient = 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.
| Concern | Contract |
|---|---|
| Scope | Public body-credential exchange; no project header. |
| Errors | Idempotent 204 after processing the supplied refresh token. |
Current User
GET/auth/me
200 OK
| Field | Type | Contract |
|---|---|---|
| Request body | none | Identity is read from the bearer token. |
import osfrom memorysync import ControlPlaneClientclient = 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_scopesandoauth_app_id. - A revoked session is rejected even when its access token has not expired.
| Concern | Contract |
|---|---|
| Scope | Current bearer identity; no project header. |
| Errors | 401 for missing, invalid, expired, or revoked bearer sessions. |
Logout All
POST/auth/logout-all
204 No Content
| Field | Type | Contract |
|---|---|---|
| Request body | none | The bearer identifies the account and current session. |
import osfrom memorysync import ControlPlaneClientclient = 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.
| Concern | Contract |
|---|---|
| Scope | All other sessions owned by the current bearer user; no project header. |
| Errors | 401 for missing, invalid, expired, or revoked bearer sessions. |
Shared handling
Related reference
Was this page helpful?