{"record":{"id":"18370689c9cd3252","repo":"appwrite/appwrite","slug":"missing-required-parameter-email-183706","errorCode":null,"errorMessage":"Missing required parameter: \"email\"","messagePattern":"Missing required parameter: \"email\"","errorType":"validation","errorClass":"AppwriteException","httpStatus":null,"severity":"error","filePath":"public/sdk-project/services/account.ts","lineNumber":54,"sourceCode":"         * the [/account/verfication](/docs/client/account#accountCreateVerification)\n         * route to start verifying the user email address. To allow the new user to\n         * login to their new account, you need to create a new [account\n         * session](/docs/client/account#accountCreateSession).\n         *\n         * @param {string} userId\n         * @param {string} email\n         * @param {string} password\n         * @param {string} name\n         * @throws {AppwriteException}\n         * @returns {Promise}\n         */\n        async create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.Account<Preferences>> {\n            if (typeof userId === 'undefined') {\n                throw new AppwriteException('Missing required parameter: \"userId\"');\n            }\n\n            if (typeof email === 'undefined') {\n                throw new AppwriteException('Missing required parameter: \"email\"');\n            }\n\n            if (typeof password === 'undefined') {\n                throw new AppwriteException('Missing required parameter: \"password\"');\n            }\n\n            let path = '/account';\n            let payload: Payload = {};\n\n            if (typeof userId !== 'undefined') {\n                payload['userId'] = userId;\n            }\n\n            if (typeof email !== 'undefined') {\n                payload['email'] = email;\n            }\n\n            if (typeof password !== 'undefined') {","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/appwrite/appwrite/blob/cd368e707d4b492bc5e8e9c0f8ecbc5b741c4bf4/public/sdk-project/services/account.ts#L36-L72","documentation":"Thrown by Account.create when userId passed but email is undefined. Email is checked second. Synchronous pre-network guard.","triggerScenarios":"Signup form submitted with an empty/missing email field whose value reads as undefined; reading `form.email` off a FormData without the key; passing an object instead of the string.","commonSituations":"Input named differently (`emailAddress` vs `email`); controlled input whose state was not bound; paste-and-clear leaving the field undefined rather than ''.","solutions":["Bind the email input to state and validate before submit: if (!email) setFieldError('email', 'required');","Use a name='email' form field and read `formData.get('email')`.","Add HTML5 required + type=email on the input as a first-line guard."],"exampleFix":"// before\nawait account.create(ID.unique(), form.emailAddress, password); // wrong field name\n\n// after\nconst email = form.email?.trim();\nif (!email) { throw new Error('Email is required'); }\nawait account.create(ID.unique(), email, password);","handlingStrategy":"validation","validationCode":"const email = form.email?.trim();\nif (!email || !/^[^@]+@[^@]+\\.[^@]+$/.test(email)) {\n  throw new Error('Valid email is required');\n}\nawait account.create(userId, email, password);","typeGuard":"const isEmail = (v: unknown): v is string =>\n  typeof v === 'string' && /^[^@]+@[^@]+\\.[^@]+$/.test(v);","tryCatchPattern":"try {\n  await account.create(userId, email, password);\n} catch (e) {\n  if (e instanceof AppwriteException && /Missing required parameter/.test(e.message)) {\n    setFormError(e.message);\n  } else { throw e; }\n}","preventionTips":["Bind the email input to form state with the expected field name.","Add HTML5 required + type=email as a baseline.","Disable submit until all required fields are valid."],"tags":["sdk","typescript","account","parameter-validation","client-side","registration"],"backgroundTag":null,"analyzedSha":"cd368e707d4b492bc5e8e9c0f8ecbc5b741c4bf4","analyzedAt":"2026-08-12T14:42:48.571Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}