{"record":{"id":"8715b82a3b7b4828","repo":"BerriAI/litellm","slug":"only-proxy-admins-can-add-a-user-id-that-does-not","errorCode":null,"errorMessage":"Only proxy admins can add a user_id that does not exist yet: {}{}. Add the member by user_email to invite a new user, or ask a proxy admin to create the user first.","messagePattern":"Only proxy admins can add a user_id that does not exist yet: (.+?)(.+?)\\. Add the member by user_email to invite a new user, or ask a proxy admin to create the user first\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":2836,"sourceCode":"\n    Team and org admins keep the ability to add users that already exist and to\n    invite new ones by user_email, where the user_id is allocated server-side.\n    \"\"\"\n    if user_api_key_dict.user_role in (\n        LitellmUserRoles.PROXY_ADMIN,\n        LitellmUserRoles.PROXY_ADMIN.value,\n    ):\n        return\n\n    unknown_user_ids: Final = tuple(\n        member.user_id for member in members if member.user_id is not None and member.user_id not in existing_user_ids\n    )\n    if not unknown_user_ids:\n        return\n\n    listed: Final = \", \".join(unknown_user_ids[:_MAX_REPORTED_UNKNOWN_USER_IDS])\n    remaining: Final = len(unknown_user_ids) - _MAX_REPORTED_UNKNOWN_USER_IDS\n    raise HTTPException(\n        status_code=403,\n        detail={  # mutable-ok: HTTPException detail must be a plain mapping to keep this route's {\"error\": ...} response shape\n            \"error\": (\n                \"Only proxy admins can add a user_id that does not exist yet: {}{}. \"\n                \"Add the member by user_email to invite a new user, or ask a proxy admin \"\n                \"to create the user first.\".format(listed, f\" and {remaining} more\" if remaining > 0 else \"\")\n            )\n        },\n    )\n\n\ndef _members_audit_value(members: Sequence[Member]) -> str:\n    \"\"\"Serialize a team's member list for an audit-log value.\n\n    The audit-log columns hold a JSON object, so the member list is nested\n    under a key rather than serialized as a top-level array.\n    \"\"\"\n    return safe_dumps(","sourceCodeStart":2818,"sourceCodeEnd":2854,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L2818-L2854","documentation":"Error \"Only proxy admins can add a user_id that does not exist yet: {}{}. Add the member by user_email to invite a new user, or ask a proxy admin to create the user first.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:2836 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the member by user_email to invite a new user, or ask a proxy admin to create the user first."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}