calcom/cal.diy · error · NotFoundException

Event type with slug ${eventSlug} not found

Error message

Event type with slug ${eventSlug} not found

What it means

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.

Source

Thrown at apps/api/v2/src/modules/atoms/services/event-types-atom.service.ts:424

      if (usernamePossiblyNotFromProfile) {
        const user = await this.usersRepository.findByUsernameWithProfile(username);
        if (user) {
          const profile = await this.usersService.getUserMainProfile(user);
          if (profile?.username) {
            event = await getPublicEvent(
              profile.username,
              eventSlug,
              isTeamEvent,
              orgSlug,
              this.dbRead.prisma as unknown as PrismaClient,
              true
            );
          }
        }
      }

      if (!event) {
        throw new NotFoundException(`Event type with slug ${eventSlug} not found`);
      }

      return event;
    } catch (err) {
      if (err instanceof Error) {
        throw new NotFoundException(err.message);
      }
      throw new NotFoundException(`Event type with slug ${eventSlug} not found`);
    }
  }
}

View on GitHub (pinned to 176037d0af)

Solutions

  1. Verify the eventSlug matches exactly (case-sensitive, no trailing characters) an active, public event type for the given username or team.
  2. If the user changed their username, update the stored reference or use the new username.
  3. Check that the event type is published and not hidden/draft.
  4. For org-scoped events, confirm the orgId and orgSlug match the event type's actual organization.

Example fix

// before: using a possibly stale slug
const event = await atomsApi.getPublicEventType({
  eventSlug: '30Min',  // wrong case
  username: 'john'
});

// after: verify slug from source and match case
const userEventTypes = await api.get(`/v2/users/john/event-types`);
const match = userEventTypes.find(et => et.slug.toLowerCase() === '30min');
if (!match) {
  throw new Error(`No public event type with slug '30min' for user 'john'.`);
}
const event = await atomsApi.getPublicEventType({
  eventSlug: match.slug,
  username: 'john'
});
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify the event slug and username/team exist before the public lookup
const verifyPublicEventExists = async (
  api: ApiClient,
  username: string,
  eventSlug: string
): Promise<void> => {
  const eventTypes = await api.get(`/v2/users/${username}/event-types`);
  const match = eventTypes.find((et: { slug: string; hidden: boolean }) =>
    et.slug === eventSlug && !et.hidden
  );
  if (!match) {
    throw new Error(`No public event type with slug '${eventSlug}' for user '${username}'.`);
  }
};

Try / catch

// Handle public event not found
try {
  return await atomsApi.getPublicEventType({
    eventSlug,
    username,
    isTeamEvent: false
  });
} catch (err: any) {
  if (err?.response?.status === 404) {
    // Show 'event not available' UI to the end user
    return { status: 'unavailable', message: 'This event type is no longer available.' };
  }
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of calcom/cal.diy@176037d0af (2026-08-12). Data as JSON: /api/errors/abbb469900706af7. Report an issue: GitHub.