{"record":{"id":"abbb469900706af7","repo":"calcom/cal.diy","slug":"event-type-with-slug-eventslug-not-found","errorCode":null,"errorMessage":"Event type with slug ${eventSlug} not found","messagePattern":"Event type with slug (.+?) not found","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"apps/api/v2/src/modules/atoms/services/event-types-atom.service.ts","lineNumber":424,"sourceCode":"      if (usernamePossiblyNotFromProfile) {\n        const user = await this.usersRepository.findByUsernameWithProfile(username);\n        if (user) {\n          const profile = await this.usersService.getUserMainProfile(user);\n          if (profile?.username) {\n            event = await getPublicEvent(\n              profile.username,\n              eventSlug,\n              isTeamEvent,\n              orgSlug,\n              this.dbRead.prisma as unknown as PrismaClient,\n              true\n            );\n          }\n        }\n      }\n\n      if (!event) {\n        throw new NotFoundException(`Event type with slug ${eventSlug} not found`);\n      }\n\n      return event;\n    } catch (err) {\n      if (err instanceof Error) {\n        throw new NotFoundException(err.message);\n      }\n      throw new NotFoundException(`Event type with slug ${eventSlug} not found`);\n    }\n  }\n}\n","sourceCodeStart":406,"sourceCodeEnd":436,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/modules/atoms/services/event-types-atom.service.ts#L406-L436","documentation":"Thrown by EventTypesAtomService.getPublicEventTypeForAtoms when getPublicEvent returns null after all lookup attempts. The method first tries the provided usernameOrTeamSlug, then if no event is found and the conditions match (username + orgId + no event), it retries with the user's profile username. If both attempts return null, NotFoundException (HTTP 404) is thrown inside the try block. This is the primary 'not found' path.","triggerScenarios":"The eventSlug doesn't match any event type for the given username or team slug. The event type exists but is not public (unpublished, hidden, or draft). The username or team slug is correct but the event type belongs to a different org context. The orgSlug was resolved but doesn't match the event type's organization.","commonSituations":"Typo in the eventSlug (e.g. '30-min' vs '30min'). Event type was unpublished or set to private after being shared. The user changed their username and the old link is stale. Cross-org access: event type is in Org A but the request resolves the slug for Org B. The profile.username retry logic fails because the user has no profile or profile.username is null.","solutions":["Verify the eventSlug matches exactly (case-sensitive, no trailing characters) an active, public event type for the given username or team.","If the user changed their username, update the stored reference or use the new username.","Check that the event type is published and not hidden/draft.","For org-scoped events, confirm the orgId and orgSlug match the event type's actual organization."],"exampleFix":"// before: using a possibly stale slug\nconst event = await atomsApi.getPublicEventType({\n  eventSlug: '30Min',  // wrong case\n  username: 'john'\n});\n\n// after: verify slug from source and match case\nconst userEventTypes = await api.get(`/v2/users/john/event-types`);\nconst match = userEventTypes.find(et => et.slug.toLowerCase() === '30min');\nif (!match) {\n  throw new Error(`No public event type with slug '30min' for user 'john'.`);\n}\nconst event = await atomsApi.getPublicEventType({\n  eventSlug: match.slug,\n  username: 'john'\n});","handlingStrategy":"try-catch","validationCode":"// Verify the event slug and username/team exist before the public lookup\nconst verifyPublicEventExists = async (\n  api: ApiClient,\n  username: string,\n  eventSlug: string\n): Promise<void> => {\n  const eventTypes = await api.get(`/v2/users/${username}/event-types`);\n  const match = eventTypes.find((et: { slug: string; hidden: boolean }) =>\n    et.slug === eventSlug && !et.hidden\n  );\n  if (!match) {\n    throw new Error(`No public event type with slug '${eventSlug}' for user '${username}'.`);\n  }\n};","typeGuard":null,"tryCatchPattern":"// Handle public event not found\ntry {\n  return await atomsApi.getPublicEventType({\n    eventSlug,\n    username,\n    isTeamEvent: false\n  });\n} catch (err: any) {\n  if (err?.response?.status === 404) {\n    // Show 'event not available' UI to the end user\n    return { status: 'unavailable', message: 'This event type is no longer available.' };\n  }\n  throw err;\n}","preventionTips":["Verify eventSlug case matches exactly — slugs are case-sensitive.","Check that the event type is published and not hidden before sharing the public link.","When a user changes their username, set up redirects from old profile URLs to new ones.","For org-scoped events, ensure the orgId and the event type's organization match."],"tags":["not-found","event-types","atoms","nestjs","api-v2","public-event"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}