{"record":{"id":"0641c335a955f0e4","repo":"calcom/cal.diy","slug":"booking-with-uid-bookinguid-not-found","errorCode":null,"errorMessage":"Booking with uid ${bookingUid} not found","messagePattern":"Booking with uid (.+?) not found","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"apps/api/v2/src/platform/bookings/2024-08-13/services/booking-attendees.service.ts","lineNumber":78,"sourceCode":"        },\n        { strategy: \"excludeAll\" }\n      );\n    } catch (e) {\n      if (e instanceof ErrorWithCode && e.code === ErrorCode.NotFound) {\n        throw new NotFoundException(e.message);\n      }\n      throw e;\n    }\n  }\n\n  async addAttendee(\n    bookingUid: string,\n    input: AddAttendeeInput_2024_08_13,\n    user: ApiAuthGuardUser\n  ): Promise<BookingAttendeeOutput_2024_08_13> {\n    const booking = await this.bookingsRepository.getByUidWithEventType(bookingUid);\n    if (!booking) {\n      throw new NotFoundException(`Booking with uid ${bookingUid} not found`);\n    }\n\n    const platformClientParams = booking.eventTypeId\n      ? await this.platformBookingsService.getOAuthClientParams(booking.eventTypeId)\n      : undefined;\n\n    const emailsEnabled = platformClientParams ? platformClientParams.arePlatformEmailsEnabled : true;\n\n    const createdAttendee = await this.bookingAttendeesService.addAttendee({\n      bookingId: booking.id,\n      attendee: {\n        email: input.email,\n        name: input.name,\n        timeZone: input.timeZone,\n        phoneNumber: input.phoneNumber,\n        language: input.language,\n      },\n      user: {","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/platform/bookings/2024-08-13/services/booking-attendees.service.ts#L60-L96","documentation":"A 404 NotFoundException thrown by BookingAttendeesService_2024_08_13.addAttendee when bookingsRepository.getByUidWithEventType(bookingUid) returns null. This means no booking record exists with the given UID. The addAttendee endpoint requires a valid existing booking to attach an attendee to.","triggerScenarios":"POST /v2/bookings/{bookingUid}/attendees where bookingUid doesn't match any booking in the database. Common causes: the UID was mistyped, the booking was deleted, the booking UID format is wrong (e.g., sending a numeric ID instead of a UUID-format UID).","commonSituations":"Client sends a booking ID (numeric) instead of a booking UID (UUID string). The booking was soft-deleted or hard-deleted. The bookingUid was copied incorrectly from a previous API response. Cross-environment confusion (using a staging UID against production). The booking is in a different database shard or organization.","solutions":["Verify the bookingUid exists by calling GET /v2/bookings/{bookingUid} — if it also returns 404, the UID is wrong.","Ensure you're sending the booking UID (a UUID-like string like 'abc-123-def-456'), not the numeric booking ID.","Check that you're hitting the correct environment (staging vs production) with the correct UID.","If the booking was deleted, you cannot add attendees to it — create a new booking instead."],"exampleFix":"// before — sending numeric booking ID\nPOST /v2/bookings/12345/attendees\n\n// after — sending the booking UID string\nPOST /v2/bookings/L5JQpQf2W7mR3xKbN8vY/attendees","handlingStrategy":"validation","validationCode":"// Verify the booking exists before adding an attendee\nasync function bookingExists(token, bookingUid) {\n  const res = await fetch(`/v2/bookings/${bookingUid}`, {\n    headers: { Authorization: `Bearer ${token}` }\n  });\n  return res.ok;\n}\n\nif (!(await bookingExists(token, bookingUid))) {\n  throw new Error(`Booking ${bookingUid} not found — cannot add attendee`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await api.addAttendee(bookingUid, attendeeData);\n} catch (err) {\n  if (err.statusCode === 404 && err.message.includes('not found')) {\n    // Booking doesn't exist — surface to user or create the booking first\n    console.error('Booking not found:', bookingUid);\n  } else { throw err; }\n}","preventionTips":["Verify the booking UID exists via GET /v2/bookings/:bookingUid before adding attendees.","Use booking UIDs (UUID strings), not numeric booking IDs.","Store booking UIDs from the create-booking response and reuse them.","Handle 404 gracefully by prompting the user to check the booking reference."],"tags":["not-found","booking","attendee","validation","nestjs"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}