calcom/cal.diy · error · NotFoundException
Event type with slug ${body.eventTypeSlug} belonging to team
Error message
Event type with slug ${body.eventTypeSlug} belonging to team ${body.teamSlug} not found. What it means
Thrown by handleEventTypeToBeBookedNotFound when the booking body contains teamSlug + eventTypeSlug (no organizationSlug) and no matching team-owned event type was resolved. NotFoundException (HTTP 404). This is the team analogue of error 321.
Source
Thrown at apps/api/v2/src/platform/bookings/2024-08-13/services/errors.service.ts:22
import { CreateBookingInput } from "@calcom/platform-types";
@Injectable()
export class ErrorsBookingsService_2024_08_13 {
private readonly logger = new Logger("ErrorsBookingsService_2024_08_13");
handleEventTypeToBeBookedNotFound(body: CreateBookingInput): never {
if (body.username && body.eventTypeSlug && !body.organizationSlug) {
throw new NotFoundException(
`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);View on GitHub (pinned to 176037d0af)
Solutions
- List team event types via GET /v2/event-types?teamSlug={teamSlug} to confirm the slug before booking.
- If the team is inside an organization, add organizationSlug so the 324 branch resolves.
- Verify teamSlug casing and remove trailing whitespace.
- Confirm the event type is published and assigned to the team.
Example fix
// before
body: { teamSlug: 'Sales ', eventTypeSlug: 'demo' }
// after
body: { teamSlug: 'sales', eventTypeSlug: 'demo' } Defensive patterns
Strategy: validation
Validate before calling
const teamSlug = body.teamSlug?.trim().toLowerCase();
const eventTypeSlug = body.eventTypeSlug?.trim();
const et = await api.get(`/v2/event-types?teamSlug=${encodeURIComponent(teamSlug)}`);
if (!et.data.some(e => e.slug === eventTypeSlug)) throw new Error('team event type not found'); Type guard
const hasTeamSlugCombo = (b: CreateBookingInput): boolean => !!(b.teamSlug && b.eventTypeSlug && !b.organizationSlug);
Try / catch
try { await api.post('/v2/bookings', body); }
catch (e) {
if (e.response?.status === 404 && /belonging to team/.test(e.response.data.message)) {
/* verify teamSlug casing or add organizationSlug if team is org-scoped */
} else throw e;
} Prevention
- Confirm the team slug casing and ownership before booking.
- Add organizationSlug when the team is inside an organization.
- Pre-fetch team event types to validate the slug.
When it happens
Trigger: POST /v2/bookings with { teamSlug, eventTypeSlug } where the team slug is wrong, the event type is not owned by that team, or the team is inside an organization (which requires organizationSlug and triggers the 324 branch instead).
Common situations: Team was renamed; event type reassigned from one team to another; team lives inside an org but the caller omitted organizationSlug; team event type is unpublished; slug casing mismatch (team slugs can be case-sensitive).
Related errors
- Event type with slug ${body.eventTypeSlug} belonging to team
- Event type with slug ${body.eventTypeSlug} belonging to user
- Event type with slug ${body.eventTypeSlug} belonging to user
- Event type with id ${body.eventTypeId} not found.
- 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/30a96710e60cb901.
Report an issue: GitHub.