diff --git a/letta/server/rest_api/routers/v1/users.py b/letta/server/rest_api/routers/v1/users.py index d0e0f787d7..9253d8d29c 100644 --- a/letta/server/rest_api/routers/v1/users.py +++ b/letta/server/rest_api/routers/v1/users.py @@ -3,7 +3,7 @@ from fastapi import APIRouter, Body, Depends, HTTPException, Query from letta.schemas.api_key import APIKey, APIKeyCreate -from letta.schemas.user import User, UserCreate +from letta.schemas.user import User, UserCreate, UserUpdate from letta.server.rest_api.utils import get_letta_server # from letta.server.schemas.users import ( @@ -56,6 +56,18 @@ def create_user( return user +@router.put("/", tags=["admin"], response_model=User, operation_id="update_user") +def update_user( + user: UserUpdate = Body(...), + server: "SyncServer" = Depends(get_letta_server), +): + """ + Update a user in the database + """ + user = server.user_manager.update_user(user) + return user + + @router.delete("/", tags=["admin"], response_model=User, operation_id="delete_user") def delete_user( user_id: str = Query(..., description="The user_id key to be deleted."),