calcom/cal.diy · error · BadRequestException

Missing required booking field response: ${eventTypeBookingF

Error message

Missing required booking field response: ${eventTypeBookingField.name} - it is required by the event type booking fields, but missing in the bookingFieldsResponses. You can fetch the event type with ID ${eventType.id} to see the required fields.

What it means

Thrown during booking creation when any required event type booking field (other than the two phone-specific fields) has a null or undefined value in bookingFieldsResponses. The message names the missing field and references the event type ID so the caller can re-fetch the schema. Maps to HTTP 400 BadRequestException.

Source

Thrown at apps/api/v2/src/platform/bookings/2024-08-13/services/bookings.service.ts:251

    if (!eventTypeBookingFields.length) {
      return true;
    }

    for (const eventTypeBookingField of eventTypeBookingFields) {
      if (
        eventTypeBookingField.required &&
        (bookingFieldsResponses[eventTypeBookingField.name] === null ||
          bookingFieldsResponses[eventTypeBookingField.name] === undefined)
      ) {
        if (
          eventTypeBookingField.name === "attendeePhoneNumber" ||
          eventTypeBookingField.name === "smsReminderNumber"
        ) {
          throw new BadRequestException(
            `Missing attendee phone number - it is required by the event type. Pass it as "attendee.phoneNumber" string in the request.`
          );
        }
        throw new BadRequestException(
          `Missing required booking field response: ${eventTypeBookingField.name} - it is required by the event type booking fields, but missing in the bookingFieldsResponses. You can fetch the event type with ID ${eventType.id} to see the required fields.`
        );
      }

      const bookingFieldResponseValue = bookingFieldsResponses[eventTypeBookingField.name];
      if (bookingFieldResponseValue !== undefined) {
        const bookingFieldResponseValueType = typeof bookingFieldResponseValue;
        let expectedBookingFieldResponseValueType = "";
        let isValidType = false;
        const eventTypeBookingFieldType = eventTypeBookingField.type;

        switch (eventTypeBookingFieldType) {
          case "phone":
            expectedBookingFieldResponseValueType = "string";
            isValidType = bookingFieldResponseValueType === "string";
            break;
          case "address":
            expectedBookingFieldResponseValueType = "string";

View on GitHub (pinned to 176037d0af)

Solutions

  1. GET /v2/event-types/:id and review bookingFields — include a non-null value for every field where required is true.
  2. Ensure bookingFieldsResponses includes the field by its exact name (case-sensitive).
  3. If the field should not be required, update the event type configuration in Cal.com.

Example fix

// before — 'title' field is required but omitted
const body = { start: '2025-01-01T10:00:00Z', eventTypeId: 123, responses: {} };
// after
const body = { start: '2025-01-01T10:00:00Z', eventTypeId: 123, responses: { title: 'Consultation' } };
Defensive patterns

Strategy: validation

Validate before calling

const et = await client.get(`/v2/event-types/${eventTypeId}`);
const required = et.bookingFields.filter(f => f.required).map(f => f.name);
const missing = required.filter(n => body.responses[n] == null);
if (missing.length) throw new Error(`Missing: ${missing.join(', ')}`);

Type guard

function hasAllRequired(responses: Record<string, unknown>, required: string[]): boolean {
  return required.every(n => responses[n] !== null && responses[n] !== undefined);
}

Try / catch

try { await client.post('/v2/bookings', body); }
catch (e) {
  if (e.status === 400 && /Missing required booking field/.test(e.message)) { /* parse field name, collect, retry */ }
  else throw e;
}

Prevention

When it happens

Trigger: A POST /v2/bookings request omits a value for a field the event type marks required (e.g. name, email, a custom question). The loop checks eventTypeBookingField.required && (response === null || response === undefined).

Common situations: Custom booking questions added to an event type after the integration was built; standard fields like 'name' or 'email' omitted from the payload; sending an empty string instead of a value (empty string passes because the check is only null/undefined).

Related errors


AI-assisted analysis of calcom/cal.diy@176037d0af (2026-08-12). Data as JSON: /api/errors/d643c9c8a33fc4c6. Report an issue: GitHub.