{"record":{"id":"04b2e035091bf3c3","repo":"calcom/cal.diy","slug":"event-type-not-found-04b2e0","errorCode":null,"errorMessage":"Event Type not found","messagePattern":"Event Type not found","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"apps/api/v2/src/modules/slots/slots-2024-09-04/services/slots-input.service.ts","lineNumber":50,"sourceCode":"export type InternalGetSlotsQueryWithRouting = InternalGetSlotsQuery & {\n  routedTeamMemberIds: number[] | null;\n  skipContactOwner: boolean;\n  teamMemberEmail: string | null;\n};\n\n@Injectable()\nexport class SlotsInputService_2024_09_04 {\n  constructor(\n    private readonly eventTypeRepository: EventTypesRepository_2024_06_14,\n    private readonly usersRepository: UsersRepository,\n    private readonly teamsRepository: TeamsRepository,\n    private readonly teamsEventTypesRepository: TeamsEventTypesRepository\n  ) {}\n\n  async transformGetSlotsQuery(query: GetSlotsInput_2024_09_04): Promise<InternalGetSlotsQuery> {\n    const eventType = await this.getEventType(query);\n    if (!eventType) {\n      throw new NotFoundException(`Event Type not found`);\n    }\n    const isTeamEvent = !!eventType?.teamId;\n\n    const startTime = this.adjustStartTime(query.start);\n    const endTime = this.adjustEndTime(query.end);\n    const duration = query.duration;\n    const eventTypeId = eventType.id;\n    const eventTypeSlug = eventType.slug;\n    const usernameList = \"usernames\" in query ? query.usernames : [];\n    const timeZone = query.timeZone;\n    const orgSlug = \"organizationSlug\" in query ? query.organizationSlug : null;\n    const rescheduleUid = query.bookingUidToReschedule || null;\n\n    return {\n      isTeamEvent,\n      startTime,\n      endTime,\n      duration,","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/modules/slots/slots-2024-09-04/services/slots-input.service.ts#L32-L68","documentation":"NotFoundException (HTTP 404) thrown by SlotsInputService_2024_09_04.transformGetSlotsQuery() when getEventType(query) returns null. This is the input-transformation gate for the 2024-09-04 slots endpoint: every other field (duration, usernames, timeZone, rescheduleUid) is derived from the resolved event type, so a missing event type aborts before any slot computation.","triggerScenarios":"GET /v2/slots/2024-09-04 with an eventTypeId or event-type slug that does not resolve (deleted, never existed, belongs to another org, or slug typo); reschedule via bookingUidToReschedule whose event type no longer exists.","commonSituations":"Slug-based deep links to a renamed/deleted event type; org subdomain routing resolving the wrong org so the event type isn't found; cache of a slug after the event type was edited; team event type removed between link generation and click.","solutions":["Verify the event type slug/id exists (and is in the right org context) before requesting slots.","For slug-based flows, handle 404 by showing 'event no longer available' and refreshing the list.","If rescheduling, confirm the original booking's event type still exists before calling the slots endpoint."],"exampleFix":"// before\napi.get('/slots/2024-09-04', { eventTypeSlug: 'old-slug', startTime, endTime });\n// after — validate slug first\nconst et = await api.getEventTypeBySlug('old-slug');\nif (!et) { showNotFound(); return; }\napi.get('/slots/2024-09-04', { eventTypeId: et.id, startTime, endTime });","handlingStrategy":"try-catch","validationCode":"async function resolveEventType(slugOrId: string | number) {\n  const et = typeof slugOrId === 'number'\n    ? await api.getEventType(slugOrId).catch(() => null)\n    : await api.getEventTypeBySlug(slugOrId).catch(() => null);\n  if (!et) throw new Error(`Event type ${slugOrId} not found`);\n  return et;\n}","typeGuard":"const eventTypeResolves = async (slugOrId: string | number): Promise<boolean> =>\n  Boolean(await resolveEventType(slugOrId).catch(() => null));","tryCatchPattern":"try { await api.getSlots({ eventTypeSlug }); }\ncatch (e) { if (e.status === 404) { showEventUnavailable(); } else throw e; }","preventionTips":["Validate the slug/id (in the correct org context) before requesting slots.","Handle 404 on slug-based deep links by refreshing the event list.","For reschedule flows, confirm the booking's event type still exists first."],"tags":["slots","event-type","not-found","api-v2","nestjs"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}