API Reference
Get User Profile
Fetch a single user's full profile, including authentication providers, MFA state, and aggregate activity stats. Admin-scoped: dashboard users see their own profile via this route, operators see other users in their organisation.
GET/api/v1/users/{user_id}
Authentication
Accepts a JWT bearer token (Authorization: Bearer eyJ…) or an API key (X-API-Key: ms_live_…). API-key callers should send X-Project-ID unless the key is project-locked. Cross-tenant operators must send X-Tenant-ID.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
user_id | integer | required | The user id to fetch. |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
organization_id | integer | optional | Organisation context for cross-tenant queries. |
Response
Returns 200 OK with the following body.
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | optional | User id. |
email | string | optional | Primary email (anonymised after removal). |
status | string | optional | active | suspended | removed. |
mfa_enforced | boolean | optional | Whether MFA is required. |
auth_providers | array | optional | Linked SSO / OAuth identities. |
stats | object | optional | Aggregate counters (sessions, last login, memory count). |
200.json
{"id": 4271,"email": "alice@example.com","status": "active","mfa_enforced": true,"auth_providers": [{"provider": "okta","external_id": "00uABC..."}],"stats": {"sessions": 3,"last_login": "2026-05-03T17:00:00Z","memory_count": 1284}}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Body or query failed schema validation. The error includes the offending field name. |
| 401 | unauthenticated | Missing or invalid bearer token / API key. |
| 403 | forbidden | Authenticated principal lacks the required scope, role, or project access. |
| 404 | not_found | Target resource does not exist or is not visible to the calling tenant. |
| 429 | rate_limited | Per-IP or per-route limit exceeded. Respect the Retry-After header. |
| 500 | internal_error | Unhandled server error. Quote the request_id when contacting support. |
Examples
cURL
curl -X GET https://api.memorysync.io/api/v1/users/EXAMPLE_ID \-H "Authorization: Bearer $MEMORYSYNC_KEY"
javascript
import { MemorySync } from 'memorysync'const client = new MemorySync({ apiKey: process.env.MEMORYSYNC_KEY })const result = await client.request({method: 'GET',path: '/api/v1/users/EXAMPLE_ID',})console.log(result)
python
from memorysync import Clientclient = Client(api_key=os.environ["MEMORYSYNC_KEY"])result = client.request(method="GET",path="/api/v1/users/EXAMPLE_ID",)print(result)
Behavior & notes
Idempotent through Idempotency-Key on writes. Replays within 24h return the original response unchanged.