calcom/cal.diy · error · NotFoundException
Event type with id ${body.eventTypeId} not found.
Error message
Event type with id ${body.eventTypeId} not found. What it means
The terminal fallback of handleEventTypeToBeBookedNotFound: thrown when none of the username/teamSlug/org branches match (typically because the caller passed eventTypeId only, or a combination the dispatcher does not recognize). NotFoundException (HTTP 404). It reports the numeric eventTypeId from the body.
Source
Thrown at apps/api/v2/src/platform/bookings/2024-08-13/services/errors.service.ts:31
`Event type with slug ${body.eventTypeSlug} belonging to user ${body.username} not found.`
);
}
if (body.username && body.eventTypeSlug && body.organizationSlug) {
throw new NotFoundException(
`Event type with slug ${body.eventTypeSlug} belonging to user ${body.username} within organization ${body.organizationSlug} not found.`
);
}
if (body.teamSlug && body.eventTypeSlug && !body.organizationSlug) {
throw new NotFoundException(
`Event type with slug ${body.eventTypeSlug} belonging to team ${body.teamSlug} not found.`
);
}
if (body.teamSlug && body.eventTypeSlug && body.organizationSlug) {
throw new NotFoundException(
`Event type with slug ${body.eventTypeSlug} belonging to team ${body.teamSlug} within organization ${body.organizationSlug} not found.`
);
}
throw new NotFoundException(`Event type with id ${body.eventTypeId} not found.`);
}
handleBookingError(error: unknown, bookingTeamEventType: boolean): never {
const hostsUnavaile = "One of the hosts either already has booking at this time or is not available";
if (error instanceof Error) {
if (error.message === "no_available_users_found_error") {
if (bookingTeamEventType) {
throw new BadRequestException(hostsUnavaile);
}
throw new BadRequestException("User either already has booking at this time or is not available");
} else if (error.message === "booking_time_out_of_bounds_error") {
throw new BadRequestException(
`The event type can't be booked at the "start" time provided. This could be because it's too soon (violating the minimum booking notice) or too far in the future (outside the event's scheduling window). Try fetching available slots first using the GET /v2/slots endpoint and then make a booking with "start" time equal to one of the available slots.`
);
} else if (error.message === "Attempting to book a meeting in the past.") {
throw new BadRequestException("Attempting to book a meeting in the past.");
} else if (error.message === "hosts_unavailable_for_booking") {View on GitHub (pinned to 176037d0af)
Solutions
- Fetch the event type via GET /v2/event-types/{eventTypeId} to confirm it exists and is in scope before booking.
- Prefer slug-based booking (username/teamSlug + eventTypeSlug) over numeric ids to survive event-type recreations.
- Verify the API key / OAuth client has access to the owner of that event type.
- Refresh any cached eventTypeId after event-type recreation.
Example fix
// before
body: { eventTypeId: 1234 }
// after
const et = await api.get('/v2/event-types/1234');
if (!et.data) throw new Error('refresh event type id');
body: { eventTypeId: et.data.id } Defensive patterns
Strategy: validation
Validate before calling
const et = await api.get(`/v2/event-types/${body.eventTypeId}`);
if (!et.data) throw new Error('event type id stale — refetch'); Type guard
const hasOnlyEventTypeId = (b: CreateBookingInput): boolean => !!(b.eventTypeId && !b.eventTypeSlug && !b.username && !b.teamSlug);
Try / catch
try { await api.post('/v2/bookings', body); }
catch (e) {
if (e.response?.status === 404 && /Event type with id/.test(e.response.data.message)) {
/* refetch event types and rebuild the booking with the current id */
} else throw e;
} Prevention
- Prefer slug-based booking over numeric ids to survive event-type recreation.
- Refresh cached eventTypeId after the event type is recreated.
- Confirm the API key has access to the event type's owner.
When it happens
Trigger: POST /v2/bookings with body containing only eventTypeId (no slug fields) where the id does not exist, was deleted, belongs to another account, or is unpublished. Also fires when an unrecognized field combination reaches the dispatcher's fallthrough.
Common situations: Hard-coded eventTypeId from a stale config after the event type was recreated with a new id; event type belongs to a different user/team than the authenticated API key scope; event type soft-deleted; passing eventTypeId alongside slug fields in a way that bypasses the slug branches.
Related errors
- Event type with slug ${body.eventTypeSlug} belonging to user
- Event type with slug ${body.eventTypeSlug} belonging to user
- Event type with slug ${body.eventTypeSlug} belonging to team
- Event type with slug ${body.eventTypeSlug} belonging to team
- Event type with id=${inputBooking.eventTypeId} is not a recu
AI-assisted analysis of calcom/cal.diy@176037d0af (2026-08-12).
Data as JSON: /api/errors/fa23e02322f9eeaf.
Report an issue: GitHub.