User Management
The user management API lets you create and manage platform user records within your tenant. Users are identified by email address and carry enabled and licensed flags plus free-form metadata. All operations are scoped to the tenant of the authenticated request. Reads require users:read; creates and updates require users:write; deletes require users:delete.
The examples use $MEMORYLAYER_URL for your deployment’s API endpoint.
User Fields
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address (trimmed and normalized to lowercase; must not be empty) |
display_name | string | No | Display name |
first_name | string | No | First name |
last_name | string | No | Last name |
enabled | boolean | No | Whether the account is active (default: true) |
licensed | boolean | No | Per-user flag (default: false) — see The licensed flag |
metadata | object | No | Arbitrary key-value metadata |
Create a User
curl -X POST "$MEMORYLAYER_URL/v1/users" \ -H "Authorization: Bearer $ML_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "alice@example.com", "display_name": "Alice", "first_name": "Alice", "last_name": "Smith", "enabled": true }'Returns 201 Created with the full user object, including the generated id (prefixed usr_), tenant_id, created_at, and updated_at.
List Users
curl "$MEMORYLAYER_URL/v1/users" \ -H "Authorization: Bearer $ML_API_KEY"Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | boolean | — | Filter by enabled state |
licensed | boolean | — | Filter by the licensed flag |
search | string | — | Case-insensitive substring match over email and display name |
ids | string | — | Comma-separated user IDs to restrict the result to |
limit | integer | 50 | Results per page (max 200) |
offset | integer | 0 | Pagination offset |
Response:
{ "users": [ { "id": "usr_a1b2c3d4e5f6a7b8", "tenant_id": "tenant_abc", "email": "alice@example.com", "display_name": "Alice", "first_name": "Alice", "last_name": "Smith", "enabled": true, "licensed": false, "metadata": {}, "created_at": "2026-01-15T10:30:00Z", "updated_at": "2026-01-15T10:30:00Z" } ], "total_count": 1}Get a User
curl "$MEMORYLAYER_URL/v1/users/usr_a1b2c3d4e5f6a7b8" \ -H "Authorization: Bearer $ML_API_KEY"Returns 404 if the user does not exist within your tenant.
Update a User
Send only the fields you want to change (email, display_name, first_name, last_name, enabled, licensed, metadata). Omitted fields are left unchanged.
curl -X PUT "$MEMORYLAYER_URL/v1/users/usr_a1b2c3d4e5f6a7b8" \ -H "Authorization: Bearer $ML_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "display_name": "Alice S." }'Delete a User
curl -X DELETE "$MEMORYLAYER_URL/v1/users/usr_a1b2c3d4e5f6a7b8" \ -H "Authorization: Bearer $ML_API_KEY"Returns 204 No Content on success.
The licensed Flag
licensed is a stored boolean on each user record that you can set, update, and filter on (GET /v1/users?licensed=true). MemoryLayer Enterprise does not enforce it: it does not gate API access, count against any limit, or change behavior. A platform or operator can use it for its own access policy or user accounting, for example to mark which users are provisioned for a particular application.
Common Patterns
Disable a user without deleting — Set enabled to false to mark the account inactive while preserving the user record and audit history:
curl -X PUT "$MEMORYLAYER_URL/v1/users/usr_a1b2c3d4e5f6a7b8" \ -H "Authorization: Bearer $ML_API_KEY" \ -H "Content-Type: application/json" \ -d '{"enabled": false}'The enabled flag is stored on the user record; request authentication is performed by the Aether auth proxy, so revoke the user’s API keys to cut off access immediately.
Find users by name or email:
curl "$MEMORYLAYER_URL/v1/users?search=smith&enabled=true&limit=200" \ -H "Authorization: Bearer $ML_API_KEY"Bulk onboarding — Create users in a loop. Each user gets a unique usr_-prefixed ID assigned by the server.