Skip to content

User Management

The user management API lets you create and manage platform users within your tenant. Users are identified by email address and can be enabled, disabled, or assigned license seats.

User Fields

FieldTypeRequiredDescription
emailstringYesEmail address (normalized to lowercase)
display_namestringNoDisplay name
first_namestringNoFirst name
last_namestringNoLast name
enabledbooleanNoWhether the account is active (default: true)
licensedbooleanNoWhether the user holds a license seat (default: false)
metadataobjectNoArbitrary key-value metadata

Create a User

Terminal window
curl -X POST https://api.memorylayer.ai/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,
"licensed": true
}'

Returns 201 Created with the full user object including the generated id, tenant_id, created_at, and updated_at timestamps.

List Users

Terminal window
curl https://api.memorylayer.ai/v1/users \
-H "Authorization: Bearer $ML_API_KEY"

Query parameters:

ParameterTypeDefaultDescription
enabledboolean—Filter by enabled state
limitinteger50Results per page (max 200)
offsetinteger0Pagination offset

Response:

{
"users": [
{
"id": "usr_a1b2c3d4e5f6g7h8",
"tenant_id": "tenant_abc",
"email": "alice@example.com",
"display_name": "Alice",
"enabled": true,
"licensed": true,
"metadata": {},
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-01-15T10:30:00Z"
}
],
"total_count": 1
}

Get a User

Terminal window
curl https://api.memorylayer.ai/v1/users/usr_a1b2c3d4e5f6g7h8 \
-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. Omitted fields are left unchanged.

Terminal window
curl -X PUT https://api.memorylayer.ai/v1/users/usr_a1b2c3d4e5f6g7h8 \
-H "Authorization: Bearer $ML_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"display_name": "Alice S.",
"licensed": false
}'

Delete a User

Terminal window
curl -X DELETE https://api.memorylayer.ai/v1/users/usr_a1b2c3d4e5f6g7h8 \
-H "Authorization: Bearer $ML_API_KEY"

Returns 204 No Content on success.

Common Patterns

Disable a user without deleting — Set enabled to false to revoke access while preserving the user record and audit history:

Terminal window
curl -X PUT https://api.memorylayer.ai/v1/users/usr_a1b2c3d4e5f6g7h8 \
-H "Authorization: Bearer $ML_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'

List only licensed users — Combine filters to find users consuming license seats:

Terminal window
curl "https://api.memorylayer.ai/v1/users?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 automatically assigned by the server.