{"record":{"id":"1d90837ce67705d2","repo":"calcom/cal.diy","slug":"one-or-more-invalid-options-for-booking-field-e","errorCode":null,"errorMessage":"One or more invalid options for booking field '${eventTypeBookingField.name}'. Allowed options are: ${allowedOptionValues.join(\", \")}.","messagePattern":"One or more invalid options for booking field '(.+?)'\\. Allowed options are: (.+?)\\.","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"apps/api/v2/src/platform/bookings/2024-08-13/services/bookings.service.ts","lineNumber":315,"sourceCode":"              const submittedValue = bookingFieldResponseValue as string | number;\n              const allowedOptionValues = eventTypeBookingField.options.map((opt) => opt.value);\n              if (!this.isValidSingleOptionValue(submittedValue, allowedOptionValues)) {\n                throw new BadRequestException(\n                  `Invalid option '${submittedValue}' for booking field '${\n                    eventTypeBookingField.name\n                  }'. Allowed options are: ${allowedOptionValues.join(\", \")}.`\n                );\n              }\n            }\n            break;\n          case \"multiselect\":\n            expectedBookingFieldResponseValueType = \"array\";\n            isValidType = Array.isArray(bookingFieldResponseValue);\n            if (isValidType && Array.isArray(eventTypeBookingField.options)) {\n              const submittedValues = bookingFieldResponseValue as (string | number)[];\n              const allowedOptionValues = eventTypeBookingField.options.map((opt) => opt.value);\n              if (!this.areValidMultipleOptionValues(submittedValues, allowedOptionValues)) {\n                throw new BadRequestException(\n                  `One or more invalid options for booking field '${\n                    eventTypeBookingField.name\n                  }'. Allowed options are: ${allowedOptionValues.join(\", \")}.`\n                );\n              }\n            }\n            break;\n          case \"checkbox\":\n            expectedBookingFieldResponseValueType = \"array\";\n            isValidType = Array.isArray(bookingFieldResponseValue);\n            if (isValidType && Array.isArray(eventTypeBookingField.options)) {\n              const submittedValues = bookingFieldResponseValue as (string | number)[];\n              const allowedOptionValues = eventTypeBookingField.options.map((opt) => opt.value);\n              if (!this.areValidMultipleOptionValues(submittedValues, allowedOptionValues)) {\n                throw new BadRequestException(\n                  `One or more invalid options for booking field '${\n                    eventTypeBookingField.name\n                  }'. Allowed options are: ${allowedOptionValues.join(\", \")}.`","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/platform/bookings/2024-08-13/services/bookings.service.ts#L297-L333","documentation":"Thrown during booking field validation for a 'multiselect' type field. When the submitted value is an array and the field defines options, areValidMultipleOptionValues checks every submitted element against allowed values; if any element is invalid, BadRequestException (HTTP 400) is raised. The message is identical in shape to the select/checkbox variants.","triggerScenarios":"A booking request submits an array for a multiselect field where one or more elements do not match any configured option value.","commonSituations":"One stale value in a previously-valid array after options were edited; mixing labels and values; duplicate or whitespace-laden entries.","solutions":["Filter the submitted array to only values present in the field's options[].value.","Re-fetch the event type to get the current option set before submitting.","Trim/normalize submitted values to match stored option values exactly."],"exampleFix":"// before\nconst responses = { topics: ['billing', 'old-option'] };\n// after — only valid options\nconst allowed = ['billing','tech','sales'];\nconst responses = { topics: ['billing','tech'] };","handlingStrategy":"validation","validationCode":"const allowed = field.options.map(o => o.value);\nconst submitted: unknown[] = body.responses.topics;\nif (!submitted.every(v => allowed.includes(v))) throw new Error('Invalid multiselect values');","typeGuard":"function areValidMulti(values: unknown[], allowed: (string|number)[]): boolean {\n  return Array.isArray(values) && values.every(v => allowed.includes(v as string|number));\n}","tryCatchPattern":"try { await client.post('/v2/bookings', body); }\ncatch (e) {\n  if (e.status === 400 && /invalid options/i.test(e.message)) { /* filter array, retry */ }\n  else throw e;\n}","preventionTips":["Filter submitted arrays through the allowed option set","Cache option lists and invalidate on event type update","Normalize string/number types to match stored options"],"tags":["api-v2","bookings","validation","multiselect","options"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}