calcom/cal.diy · error · NotFoundException
Booking with uid ${bookingUid} not found
Error message
Booking with uid ${bookingUid} not found What it means
A 404 NotFoundException thrown by BookingGuestsService_2024_08_13.addGuests when bookingsRepository.getByUidWithAttendeesAndUserAndEvent(bookingUid) returns null. The guests endpoint needs a valid booking with attendees and user data to enforce the guest count limit and send notifications.
Source
Thrown at apps/api/v2/src/platform/bookings/2024-08-13/services/booking-guests.service.ts:25
import { addGuestsHandler } from "@calcom/platform-libraries/bookings";
import type { AddGuestsInput_2024_08_13 } from "@calcom/platform-types";
const MAX_TOTAL_GUESTS_PER_BOOKING = 30;
@Injectable()
export class BookingGuestsService_2024_08_13 {
private readonly logger = new Logger("BookingGuestsService_2024_08_13");
constructor(
private readonly bookingsRepository: BookingsRepository_2024_08_13,
private readonly bookingsService: BookingsService_2024_08_13,
private readonly platformBookingsService: PlatformBookingsService
) {}
async addGuests(bookingUid: string, input: AddGuestsInput_2024_08_13, user: ApiAuthGuardUser) {
const booking = await this.bookingsRepository.getByUidWithAttendeesAndUserAndEvent(bookingUid);
if (!booking) {
throw new NotFoundException(`Booking with uid ${bookingUid} not found`);
}
const currentGuestCount = booking.attendees.length;
const newGuestCount = input.guests.length;
const totalGuestCount = currentGuestCount + newGuestCount;
if (totalGuestCount > MAX_TOTAL_GUESTS_PER_BOOKING) {
const remainingSlots = Math.max(0, MAX_TOTAL_GUESTS_PER_BOOKING - currentGuestCount);
throw new BadRequestException(
`Cannot add ${newGuestCount} guests. This booking already has ${currentGuestCount} attendees. ` +
`Maximum total guests allowed is ${MAX_TOTAL_GUESTS_PER_BOOKING}. You can add up to ${remainingSlots} more guests.`
);
}
const platformClientParams = booking.eventTypeId
? await this.platformBookingsService.getOAuthClientParams(booking.eventTypeId)
: undefined;
View on GitHub (pinned to 176037d0af)
Solutions
- Verify the bookingUid exists via GET /v2/bookings/{bookingUid}.
- Use the booking UID (UUID-format string), not the numeric ID.
- Confirm the booking hasn't been cancelled — cancelled bookings may not support guest additions.
- Ensure you're targeting the correct API environment.
Defensive patterns
Strategy: validation
Validate before calling
// Verify the booking exists and check attendee count before adding guests
async function getBookingInfo(token, bookingUid) {
const res = await fetch(`/v2/bookings/${bookingUid}/attendees`, {
headers: { Authorization: `Bearer ${token}` }
});
if (!res.ok) return null;
return res.json();
}
const booking = await getBookingInfo(token, bookingUid);
if (!booking) {
throw new Error(`Booking ${bookingUid} not found — cannot add guests`);
} Try / catch
try {
await api.addGuests(bookingUid, guests);
} catch (err) {
if (err.statusCode === 404 && err.message.includes('not found')) {
console.error('Booking not found:', bookingUid);
} else { throw err; }
} Prevention
- Verify the booking UID exists before adding guests.
- Use booking UIDs, not numeric IDs.
- Confirm the booking hasn't been cancelled — cancelled bookings reject guest additions.
- Store booking UIDs from creation and reference them consistently.
When it happens
Trigger: POST /v2/bookings/{bookingUid}/guests where bookingUid doesn't match any booking record. The repository method loads the booking with attendees, user, and event type relations to check guest limits (MAX_TOTAL_GUESTS_PER_BOOKING = 30) and platform email settings.
Common situations: Client sends a mistyped or stale bookingUid. The booking was cancelled or deleted before guests could be added. Using a numeric booking ID instead of the UID. Environment mismatch. The bookingUid was truncated or corrupted in transit.
Related errors
- Booking with uid ${bookingUid} not found
- Cannot add ${newGuestCount} guests. This booking already has
- Booking with uid ${uid} not found
- Event type with uid ${uid} not found
- error.message
AI-assisted analysis of calcom/cal.diy@176037d0af (2026-08-12).
Data as JSON: /api/errors/33cb2ed5498fd73d.
Report an issue: GitHub.