{"record":{"id":"b3cb3f390bfcfc7e","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-project-id-but-re-b3cb3f","errorCode":null,"errorMessage":"Expected a non-empty value for `project_id` but received {project_id!r}","messagePattern":"Expected a non-empty value for `project_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/admin/organization/projects/users/users.py","lineNumber":91,"sourceCode":"        be added to a project.\n\n        Args:\n          role: `owner` or `member`\n\n          email: Email of the user to add.\n\n          user_id: The ID of the user.\n\n          extra_headers: Send extra headers\n\n          extra_query: Add additional query parameters to the request\n\n          extra_body: Add additional JSON properties to the request\n\n          timeout: Override the client-level default timeout for this request, in seconds\n        \"\"\"\n        if not project_id:\n            raise ValueError(f\"Expected a non-empty value for `project_id` but received {project_id!r}\")\n        return self._post(\n            path_template(\"/organization/projects/{project_id}/users\", project_id=project_id),\n            body=maybe_transform(\n                {\n                    \"role\": role,\n                    \"email\": email,\n                    \"user_id\": user_id,\n                },\n                user_create_params.UserCreateParams,\n            ),\n            options=make_request_options(\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n                security={\"admin_api_key_auth\": True},\n            ),\n            cast_to=ProjectUser,","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/admin/organization/projects/users/users.py#L73-L109","documentation":"Raised when `projects.users.create` is called with an empty `project_id`. The SDK validates path parameters client-side before POSTing to `/organization/projects/{project_id}/users`, so an empty project ID fails before any network activity.","triggerScenarios":"Calling `client.admin.organization.projects.users.create(project_id=\"\" or None, role=..., email=...)` (sync or async).","commonSituations":"The OPENAI_PROJECT_ID-style env var is unset, the project ID is loaded asynchronously and not awaited, or the project name is passed instead of the 'proj_...' ID.","solutions":["Set project_id to the real 'proj_...' identifier from the Admin API or dashboard","Check that the variable holding the project ID is assigned before the call (await it if it comes from a coroutine)","Fail fast at startup on missing required configuration"],"exampleFix":"# before\nclient.admin.organization.projects.users.create(project_id=\"\", role=\"member\", email=email)\n# after\nproject_id = os.environ[\"OPENAI_PROJECT_ID\"]\nclient.admin.organization.projects.users.create(project_id=project_id, role=\"member\", email=email)","handlingStrategy":"validation","validationCode":"import os\nproject_id = os.environ[\"OPENAI_PROJECT_ID\"]\nclient.admin.organization.projects.users.create(project_id=project_id, role=\"member\", email=email)","typeGuard":"def is_valid_project_id(v: object) -> bool:\n    return isinstance(v, str) and v.startswith(\"proj_\")","tryCatchPattern":null,"preventionTips":["Validate configuration at startup with clear error messages","Distinguish project IDs from project names in config"],"tags":["python","openai","admin-api","validation","path-parameter"],"backgroundTag":"missing-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}