diff --git a/agenta-backend/agenta_backend/services/app_manager.py b/agenta-backend/agenta_backend/services/app_manager.py index 0a39de23e7..84036b7697 100644 --- a/agenta-backend/agenta_backend/services/app_manager.py +++ b/agenta-backend/agenta_backend/services/app_manager.py @@ -44,6 +44,7 @@ from agenta_backend.services import deployment_manager if isCloudEE(): + from agenta_backend.commons.services import db_manager_ee from agenta_backend.commons.services import ( api_key_service, ) # noqa pylint: disable-all @@ -106,9 +107,10 @@ async def start_variant( ) if isCloudEE(): user = await db_manager.get_user(user_uid=user_uid) + project = await db_manager_ee.get_project_by_id(project_id=project_id) api_key = await api_key_service.create_api_key( str(user.id), - project_id=project_id, + workspace_id=str(project.workspace_id), expiration_date=None, hidden=True, )