Skip to content

Scheduling infrastructure for absolutely everyone.

refactor: v2 api event-types/:eventTypeId access (#24969)

Lauris Skraucis829edec0ea3d
diff --git a/.github/oasdiff-err-ignore.txt b/.github/oasdiff-err-ignore.txt
index e69de29bb2d..e3e210756f5 100644
--- a/.github/oasdiff-err-ignore.txt
+++ b/.github/oasdiff-err-ignore.txt
@@ -0,0 +1,2 @@
+GET /v2/event-types/{eventTypeId} added to the 'data' response property 'oneOf' list for the response status '200'
+GET /v2/event-types/{eventTypeId} added '#/components/schemas/EventTypeOutput_2024_06_14, #/components/schemas/TeamEventTypeOutput_2024_06_14' to the 'data' response property 'oneOf' list for the response status '200'
diff --git a/apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts b/apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts
index aa4c0c82fb0..526a6733ffa 100644
--- a/apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts
+++ b/apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts
@@ -1,5 +1,5 @@
-import { BookingsRepository_2024_08_13 } from "@/ee/bookings/2024-08-13/repositories/bookings.repository";
import { CalendarLink } from "@/ee/bookings/2024-08-13/outputs/calendar-links.output";
+import { BookingsRepository_2024_08_13 } from "@/ee/bookings/2024-08-13/repositories/bookings.repository";
import { ErrorsBookingsService_2024_08_13 } from "@/ee/bookings/2024-08-13/services/errors.service";
import { InputBookingsService_2024_08_13 } from "@/ee/bookings/2024-08-13/services/input.service";
import { OutputBookingsService_2024_08_13 } from "@/ee/bookings/2024-08-13/services/output.service";
@@ -13,9 +13,8 @@ import { AuthOptionalUser } from "@/modules/auth/decorators/get-optional-user/ge
import { ApiAuthGuardUser } from "@/modules/auth/strategies/api-auth/api-auth.strategy";
import { BillingService } from "@/modules/billing/services/billing.service";
import { BookingSeatRepository } from "@/modules/booking-seat/booking-seat.repository";
+import { EventTypeAccessService } from "@/modules/event-types/services/event-type-access.service";
import { KyselyReadService } from "@/modules/kysely/kysely-read.service";
-import { MembershipsRepository } from "@/modules/memberships/memberships.repository";
-import { MembershipsService } from "@/modules/memberships/services/memberships.service";
import { OAuthClientRepository } from "@/modules/oauth-clients/oauth-client.repository";
import { OAuthClientUsersService } from "@/modules/oauth-clients/services/oauth-clients-users.service";
import { OrganizationsRepository } from "@/modules/organizations/index/organizations.repository";
@@ -109,12 +108,11 @@ export class BookingsService_2024_08_13 {
private readonly organizationsRepository: OrganizationsRepository,
private readonly teamsRepository: TeamsRepository,
private readonly teamsEventTypesRepository: TeamsEventTypesRepository,
- private readonly membershipsRepository: MembershipsRepository,
- private readonly membershipsService: MembershipsService,
private readonly errorsBookingsService: ErrorsBookingsService_2024_08_13,
private readonly regularBookingService: RegularBookingService,
private readonly recurringBookingService: RecurringBookingService,
- private readonly instantBookingCreateService: InstantBookingCreateService
+ private readonly instantBookingCreateService: InstantBookingCreateService,
+ private readonly eventTypeAccessService: EventTypeAccessService
) {}
async createBooking(request: Request, body: CreateBookingInput, authUser: AuthOptionalUser) {
@@ -128,7 +126,7 @@ export class BookingsService_2024_08_13 {
this.errorsBookingsService.handleEventTypeToBeBookedNotFound(body);
}
const userIsEventTypeAdminOrOwner = authUser
- ? await this.userIsEventTypeAdminOrOwner(authUser, eventType)
+ ? await this.eventTypeAccessService.userIsEventTypeAdminOrOwner(authUser, eventType)
: false;
await this.checkBookingRequiresAuthenticationSetting(eventType, authUser, userIsEventTypeAdminOrOwner);
@@ -197,44 +195,6 @@ export class BookingsService_2024_08_13 {
}
}
- async userIsEventTypeAdminOrOwner(authUser: ApiAuthGuardUser, eventType: EventType) {
- const authUserId = authUser.id;
- const authUserRole = authUser.role;
- const eventTypeId = eventType.id;
- const teamId = eventType.teamId;
- const eventTypeOwnerId = eventType.userId || null;
-
- if (authUserRole === "ADMIN") return true;
-
- if (eventTypeOwnerId === authUserId) return true;
-
- if (eventTypeId) {
- const [isUserHost, isUserAssigned] = await Promise.all([
- this.eventTypesRepository.isUserHostOfEventType(authUserId, eventTypeId),
- this.eventTypesRepository.isUserAssignedToEventType(authUserId, eventTypeId),
- ]);
-
- if (isUserHost || isUserAssigned) return true;
- }
-
- if (teamId) {
- const membership = await this.membershipsRepository.getUserAdminOrOwnerTeamMembership(
- authUserId,
- teamId
- );
- if (membership) return true;
- }
-
- if (
- eventTypeOwnerId &&
- (await this.membershipsService.isUserOrgAdminOrOwnerOfAnotherUser(authUserId, eventTypeOwnerId))
- ) {
- return true;
- }
-
- return false;
- }
-
async getBookedEventType(body: CreateBookingInput) {
if (body.eventTypeId) {
return await this.eventTypesRepository.getEventTypeByIdWithOwnerAndTeam(body.eventTypeId);
@@ -616,7 +576,7 @@ export class BookingsService_2024_08_13 {
const booking = await this.bookingsRepository.getByUidWithAttendeesWithBookingSeatAndUserAndEvent(uid);
const userIsEventTypeAdminOrOwner =
authUser && booking?.eventType
- ? await this.userIsEventTypeAdminOrOwner(authUser, booking.eventType)
+ ? await this.eventTypeAccessService.userIsEventTypeAdminOrOwner(authUser, booking.eventType)
: false;
if (booking) {
@@ -805,7 +765,7 @@ export class BookingsService_2024_08_13 {
const userIsEventTypeAdminOrOwner =
authUser && databaseBooking.eventType
- ? await this.userIsEventTypeAdminOrOwner(authUser, databaseBooking.eventType)
+ ? await this.eventTypeAccessService.userIsEventTypeAdminOrOwner(authUser, databaseBooking.eventType)
: false;
const isRecurring = !!databaseBooking.recurringEventId;
const isSeated = !!databaseBooking.eventType?.seatsPerTimeSlot;
diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts
index 28ff9959984..3762f158340 100644
--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts
+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts
@@ -22,17 +22,31 @@ import { UserRepositoryFixture } from "test/fixtures/repository/users.repository
import { randomString } from "test/utils/randomString";
import { withApiAuth } from "test/utils/withApiAuth";
-
-
import { CAL_API_VERSION_HEADER, SUCCESS_STATUS, VERSION_2024_06_14 } from "@calcom/platform-constants";
-import { BookingWindowPeriodInputTypeEnum_2024_06_14, BookerLayoutsInputEnum_2024_06_14, ConfirmationPolicyEnum, NoticeThresholdUnitEnum, FrequencyInput } from "@calcom/platform-enums";
+import {
+ BookingWindowPeriodInputTypeEnum_2024_06_14,
+ BookerLayoutsInputEnum_2024_06_14,
+ ConfirmationPolicyEnum,
+ NoticeThresholdUnitEnum,
+ FrequencyInput,
+} from "@calcom/platform-enums";
import { SchedulingType } from "@calcom/platform-libraries";
-import { type ApiSuccessResponse, type CreateEventTypeInput_2024_06_14, type EventTypeOutput_2024_06_14, type GuestsDefaultFieldOutput_2024_06_14, type NameDefaultFieldInput_2024_06_14, type NotesDefaultFieldInput_2024_06_14, type SplitNameDefaultFieldOutput_2024_06_14, type UpdateEventTypeInput_2024_06_14 } from "@calcom/platform-types";
+import {
+ BaseConfirmationPolicy_2024_06_14,
+ TeamEventTypeOutput_2024_06_14,
+ type ApiSuccessResponse,
+ type CreateEventTypeInput_2024_06_14,
+ type EventTypeOutput_2024_06_14,
+ type GuestsDefaultFieldOutput_2024_06_14,
+ type NameDefaultFieldInput_2024_06_14,
+ type NotesDefaultFieldInput_2024_06_14,
+ type SplitNameDefaultFieldOutput_2024_06_14,
+ type UpdateEventTypeInput_2024_06_14,
+} from "@calcom/platform-types";
import { FAILED_RECURRING_EVENT_TYPE_WITH_BOOKER_LIMITS_ERROR_MESSAGE } from "@calcom/platform-types/event-types/event-types_2024_06_14/inputs/validators/CantHaveRecurrenceAndBookerActiveBookingsLimit";
import { REQUIRES_AT_LEAST_ONE_PROPERTY_ERROR } from "@calcom/platform-types/utils/RequiresOneOfPropertiesWhenNotDisabled";
import type { PlatformOAuthClient, Team, User, Schedule, EventType } from "@calcom/prisma/client";
-
const orderBySlug = (a: { slug: string }, b: { slug: string }) => {
if (a.slug < b.slug) return -1;
if (a.slug > b.slug) return 1;
@@ -83,6 +97,8 @@ describe("Event types Endpoints", () => {
let apiKeysRepositoryFixture: ApiKeysRepositoryFixture;
let apiKeyString: string;
let apiKeyOrgUser: string;
+ let systemAdminUser: User;
+ let systemAdminApiKeyString: string;
const userEmail = `event-types-2024-06-14-user-${randomString()}@api.com`;
const falseTestEmail = `event-types-2024-06-14-false-user-${randomString()}@api.com`;
@@ -196,6 +212,17 @@ describe("Event types Endpoints", () => {
const { keyString } = await apiKeysRepositoryFixture.createApiKey(user.id, null);
apiKeyString = `cal_test_${keyString}`;
+ systemAdminUser = await userRepositoryFixture.create({
+ email: `event-types-2024-06-14-system-admin-${randomString()}@api.com`,
+ username: `event-types-2024-06-14-system-admin-${randomString()}`,
+ role: "ADMIN",
+ });
+ const { keyString: adminKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ systemAdminUser.id,
+ null
+ );
+ systemAdminApiKeyString = `cal_test_${adminKeyString}`;
+
orgUser = await userRepositoryFixture.create({
email: `event-types-2024-06-14-org-user-${randomString()}@example.com`,
name: `event-types-2024-06-14-org-user-${randomString()}`,
@@ -1375,6 +1402,99 @@ describe("Event types Endpoints", () => {
expect(fetchedEventType.color).toEqual(eventType.color);
});
+ it("system admin can access another user's event type by id", async () => {
+ return request(app.getHttpServer())
+ .get(`/api/v2/event-types/${orgUserEventType1.id}`)
+ .set(CAL_API_VERSION_HEADER, VERSION_2024_06_14)
+ .set("Authorization", `Bearer ${systemAdminApiKeyString}`)
+ .expect(200)
+ .then((response) => {
+ const responseBody: ApiSuccessResponse<EventTypeOutput_2024_06_14> = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.id).toEqual(orgUserEventType1.id);
+ expect(responseBody.data.ownerId).toEqual(orgUser.id);
+ });
+ });
+
+ it("user can access a team event type as team member (using user's API key)", async () => {
+ const team = await teamRepositoryFixture.create({
+ name: `event-types-2024-06-14-team-${randomString()}`,
+ isOrganization: false,
+ });
+
+ await membershipsRepositoryFixture.create({
+ role: "ADMIN",
+ user: { connect: { id: user.id } },
+ team: { connect: { id: team.id } },
+ accepted: true,
+ });
+
+ const teamEventType = await eventTypesRepositoryFixture.createTeamEventType({
+ title: `event-types-2024-06-14-team-event-${randomString()}`,
+ slug: `event-types-2024-06-14-team-event-${randomString()}`,
+ length: 60,
+ locations: [],
+ schedulingType: "COLLECTIVE",
+ team: { connect: { id: team.id } },
+ });
+
+ return request(app.getHttpServer())
+ .get(`/api/v2/event-types/${teamEventType.id}`)
+ .set(CAL_API_VERSION_HEADER, VERSION_2024_06_14)
+ .set("Authorization", `Bearer ${apiKeyString}`)
+ .expect(200)
+ .then(async (response) => {
+ const responseBody: ApiSuccessResponse<TeamEventTypeOutput_2024_06_14> = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.id).toEqual(teamEventType.id);
+ expect(responseBody.data.teamId).toEqual(team.id);
+ await teamRepositoryFixture.delete(team.id);
+ });
+ });
+
+ it("user can access a team event type as HOST even if membership role is MEMBER (using user's API key)", async () => {
+ const team = await teamRepositoryFixture.create({
+ name: `event-types-2024-06-14-host-team-${randomString()}`,
+ isOrganization: false,
+ });
+
+ await membershipsRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: user.id } },
+ team: { connect: { id: team.id } },
+ accepted: true,
+ });
+
+ const teamEventType = await eventTypesRepositoryFixture.createTeamEventType({
+ title: `event-types-2024-06-14-host-event-${randomString()}`,
+ slug: `event-types-2024-06-14-host-event-${randomString()}`,
+ length: 60,
+ locations: [],
+ schedulingType: "COLLECTIVE",
+ team: { connect: { id: team.id } },
+ hosts: {
+ create: [
+ {
+ user: { connect: { id: user.id } },
+ },
+ ],
+ },
+ });
+
+ return request(app.getHttpServer())
+ .get(`/api/v2/event-types/${teamEventType.id}`)
+ .set(CAL_API_VERSION_HEADER, VERSION_2024_06_14)
+ .set("Authorization", `Bearer ${apiKeyString}`)
+ .expect(200)
+ .then(async (response) => {
+ const responseBody: ApiSuccessResponse<TeamEventTypeOutput_2024_06_14> = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.id).toEqual(teamEventType.id);
+ expect(responseBody.data.teamId).toEqual(team.id);
+ await teamRepositoryFixture.delete(team.id);
+ });
+ });
+
it(`/GET/event-types by username and eventSlug`, async () => {
const response = await request(app.getHttpServer())
.get(`/api/v2/event-types?username=${username}&eventSlug=${eventType.slug}`)
@@ -1780,7 +1900,7 @@ describe("Event types Endpoints", () => {
.then(async (response) => {
const responseBody: ApiSuccessResponse<EventTypeOutput_2024_06_14> = response.body;
const updatedEventType = responseBody.data;
- const policy = updatedEventType.confirmationPolicy as any;
+ const policy = updatedEventType.confirmationPolicy as BaseConfirmationPolicy_2024_06_14;
expect(policy?.type).toEqual(ConfirmationPolicyEnum.ALWAYS);
expect(policy?.blockUnconfirmedBookingsInBooker).toEqual(false);
expect(policy?.noticeThreshold).toBeUndefined();
@@ -1808,7 +1928,7 @@ describe("Event types Endpoints", () => {
.then(async (response) => {
const responseBody: ApiSuccessResponse<EventTypeOutput_2024_06_14> = response.body;
const updatedEventType = responseBody.data;
- const policy = updatedEventType.confirmationPolicy as any;
+ const policy = updatedEventType.confirmationPolicy as BaseConfirmationPolicy_2024_06_14;
expect(policy?.type).toEqual(ConfirmationPolicyEnum.TIME);
expect(policy?.noticeThreshold).toEqual({
unit: NoticeThresholdUnitEnum.MINUTES,
@@ -2793,4 +2913,4 @@ describe("Event types Endpoints", () => {
await app.close();
});
});
-});
\ No newline at end of file
+});
diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.ts
index b4c8d88a2a2..78fa6ee2e63 100644
--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.ts
+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.ts
@@ -23,6 +23,8 @@ import { Permissions } from "@/modules/auth/decorators/permissions/permissions.d
import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard";
import { OptionalApiAuthGuard } from "@/modules/auth/guards/optional-api-auth/optional-api-auth.guard";
import { PermissionsGuard } from "@/modules/auth/guards/permissions/permissions.guard";
+import { ApiAuthGuardUser } from "@/modules/auth/strategies/api-auth/api-auth.strategy";
+import { OutputTeamEventTypesResponsePipe } from "@/modules/organizations/event-types/pipes/team-event-types-response.transformer";
import { UserWithProfile } from "@/modules/users/users.repository";
import {
Controller,
@@ -73,7 +75,8 @@ export class EventTypesController_2024_06_14 {
private readonly eventTypesService: EventTypesService_2024_06_14,
private readonly inputEventTypesService: InputEventTypesService_2024_06_14,
private readonly eventTypeResponseTransformPipe: EventTypeResponseTransformPipe,
- private readonly outputEventTypesService: OutputEventTypesService_2024_06_14
+ private readonly outputEventTypesService: OutputEventTypesService_2024_06_14,
+ private readonly outputTeamEventTypesResponsePipe: OutputTeamEventTypesResponsePipe
) {}
@Post("/")
@@ -107,21 +110,36 @@ export class EventTypesController_2024_06_14 {
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
@ApiOperation({
summary: "Get an event type",
- description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>`,
+ description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
+
+ Access control: This endpoint fetches an event type by ID and returns it only if the authenticated user is authorized. Authorization is granted to:
+ - System admins
+ - The event type owner
+ - Hosts of the event type or users assigned to the event type
+ - Team admins/owners of the team that owns the team event type
+ - Organization admins/owners of the event type owner's organization
+ - Organization admins/owners of the team's parent organization
+
+ Note: Update and delete endpoints remain restricted to the event type owner only.`,
})
async getEventTypeById(
@Param("eventTypeId") eventTypeId: string,
- @GetUser() user: UserWithProfile
+ @GetUser() user: ApiAuthGuardUser
): Promise<GetEventTypeOutput_2024_06_14> {
- const eventType = await this.eventTypesService.getUserEventType(user.id, Number(eventTypeId));
+ const eventType = await this.eventTypesService.getEventTypeByIdIfAuthorized(user, Number(eventTypeId));
if (!eventType) {
throw new NotFoundException(`Event type with id ${eventTypeId} not found`);
}
+ const responseEventType =
+ "hosts" in eventType
+ ? await this.outputTeamEventTypesResponsePipe.transform(eventType)
+ : this.eventTypeResponseTransformPipe.transform(eventType);
+
return {
status: SUCCESS_STATUS,
- data: this.eventTypeResponseTransformPipe.transform(eventType),
+ data: responseEventType,
};
}
diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.module.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.module.ts
index 0f7bd4683b3..1ea35964919 100644
--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.module.ts
+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.module.ts
@@ -10,10 +10,15 @@ import { OutputEventTypesService_2024_06_14 } from "@/ee/event-types/event-types
import { SchedulesRepository_2024_06_11 } from "@/ee/schedules/schedules_2024_06_11/schedules.repository";
import { AppsRepository } from "@/modules/apps/apps.repository";
import { CredentialsRepository } from "@/modules/credentials/credentials.repository";
+import { EventTypeAccessService } from "@/modules/event-types/services/event-type-access.service";
import { MembershipsModule } from "@/modules/memberships/memberships.module";
+import { OutputTeamEventTypesResponsePipe } from "@/modules/organizations/event-types/pipes/team-event-types-response.transformer";
+import { OutputOrganizationsEventTypesService } from "@/modules/organizations/event-types/services/output.service";
import { PrismaModule } from "@/modules/prisma/prisma.module";
import { RedisModule } from "@/modules/redis/redis.module";
import { SelectedCalendarsModule } from "@/modules/selected-calendars/selected-calendars.module";
+import { TeamsEventTypesRepository } from "@/modules/teams/event-types/teams-event-types.repository";
+import { TeamsRepository } from "@/modules/teams/teams/teams.repository";
import { TokensModule } from "@/modules/tokens/tokens.module";
import { UsersService } from "@/modules/users/services/users.service";
import { UsersRepository } from "@/modules/users/users.repository";
@@ -26,6 +31,8 @@ import { Module } from "@nestjs/common";
EventTypesService_2024_06_14,
InputEventTypesService_2024_06_14,
OutputEventTypesService_2024_06_14,
+ EventTypeAccessService,
+ TeamsRepository,
UsersRepository,
UsersService,
SchedulesRepository_2024_06_11,
@@ -35,6 +42,9 @@ import { Module } from "@nestjs/common";
CredentialsRepository,
AppsRepository,
CalendarsRepository,
+ OutputTeamEventTypesResponsePipe,
+ OutputOrganizationsEventTypesService,
+ TeamsEventTypesRepository,
],
controllers: [EventTypesController_2024_06_14],
exports: [
@@ -42,6 +52,7 @@ import { Module } from "@nestjs/common";
EventTypesRepository_2024_06_14,
InputEventTypesService_2024_06_14,
OutputEventTypesService_2024_06_14,
+ EventTypeAccessService,
],
})
export class EventTypesModule_2024_06_14 {}
diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.repository.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.repository.ts
index b9c7eea8bd4..4f1588db8cb 100644
--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.repository.ts
+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.repository.ts
@@ -93,6 +93,19 @@ export class EventTypesRepository_2024_06_14 {
});
}
+ async getEventTypeByIdWithHosts(eventTypeId: number) {
+ return this.dbRead.prisma.eventType.findUnique({
+ where: { id: eventTypeId },
+ include: {
+ users: true,
+ schedule: true,
+ destinationCalendar: true,
+ calVideoSettings: true,
+ hosts: true,
+ },
+ });
+ }
+
async getEventTypeByIdIncludeUsersAndTeam(eventTypeId: number) {
const eventType = await this.dbRead.prisma.eventType.findUnique({
where: { id: eventTypeId },
diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/outputs/get-event-type.output.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/outputs/get-event-type.output.ts
index b42034fd9c2..c8e40b4df98 100644
--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/outputs/get-event-type.output.ts
+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/outputs/get-event-type.output.ts
@@ -1,19 +1,22 @@
-import { ApiProperty } from "@nestjs/swagger";
+import { ApiExtraModels, ApiProperty, getSchemaPath } from "@nestjs/swagger";
import { Type } from "class-transformer";
-import { IsIn, ValidateNested } from "class-validator";
+import { IsIn } from "class-validator";
import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
-import { EventTypeOutput_2024_06_14 } from "@calcom/platform-types";
+import { EventTypeOutput_2024_06_14, TeamEventTypeOutput_2024_06_14 } from "@calcom/platform-types";
+@ApiExtraModels(EventTypeOutput_2024_06_14, TeamEventTypeOutput_2024_06_14)
export class GetEventTypeOutput_2024_06_14 {
@ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
@IsIn([SUCCESS_STATUS, ERROR_STATUS])
status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
@ApiProperty({
- type: EventTypeOutput_2024_06_14,
+ oneOf: [
+ { $ref: getSchemaPath(EventTypeOutput_2024_06_14) },
+ { $ref: getSchemaPath(TeamEventTypeOutput_2024_06_14) },
+ ],
})
- @ValidateNested()
- @Type(() => EventTypeOutput_2024_06_14)
- data!: EventTypeOutput_2024_06_14 | null;
+ @Type(() => Object)
+ data!: EventTypeOutput_2024_06_14 | TeamEventTypeOutput_2024_06_14 | null;
}
diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/event-types.service.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/event-types.service.ts
index a932e5c54aa..e7e89d94363 100644
--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/event-types.service.ts
+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/event-types.service.ts
@@ -1,10 +1,14 @@
import { DEFAULT_EVENT_TYPES } from "@/ee/event-types/event-types_2024_06_14/constants/constants";
import { EventTypesRepository_2024_06_14 } from "@/ee/event-types/event-types_2024_06_14/event-types.repository";
+import { DatabaseEventType } from "@/ee/event-types/event-types_2024_06_14/services/output-event-types.service";
import { InputEventTransformed_2024_06_14 } from "@/ee/event-types/event-types_2024_06_14/transformed";
import { SystemField, CustomField } from "@/ee/event-types/event-types_2024_06_14/transformers";
import { SchedulesRepository_2024_06_11 } from "@/ee/schedules/schedules_2024_06_11/schedules.repository";
import { AuthOptionalUser } from "@/modules/auth/decorators/get-optional-user/get-optional-user.decorator";
+import { ApiAuthGuardUser } from "@/modules/auth/strategies/api-auth/api-auth.strategy";
+import { EventTypeAccessService } from "@/modules/event-types/services/event-type-access.service";
import { MembershipsRepository } from "@/modules/memberships/memberships.repository";
+import { DatabaseTeamEventType } from "@/modules/organizations/event-types/services/output.service";
import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
import { SelectedCalendarsRepository } from "@/modules/selected-calendars/selected-calendars.repository";
import { UsersService } from "@/modules/users/services/users.service";
@@ -30,7 +34,8 @@ export class EventTypesService_2024_06_14 {
private readonly usersService: UsersService,
private readonly selectedCalendarsRepository: SelectedCalendarsRepository,
private readonly dbWrite: PrismaWriteService,
- private readonly schedulesRepository: SchedulesRepository_2024_06_11
+ private readonly schedulesRepository: SchedulesRepository_2024_06_11,
+ private readonly eventTypeAccessService: EventTypeAccessService
) {}
async createUserEventType(user: UserWithProfile, body: InputEventTransformed_2024_06_14) {
@@ -39,7 +44,7 @@ export class EventTypesService_2024_06_14 {
}
await this.checkCanCreateEventType(user.id, body);
const eventTypeUser = await this.getUserToCreateEvent(user);
-
+
const { destinationCalendar: _destinationCalendar, ...rest } = body;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -79,6 +84,31 @@ export class EventTypesService_2024_06_14 {
};
}
+ async getEventTypeByIdIfAuthorized(
+ authUser: ApiAuthGuardUser,
+ eventTypeId: number
+ ): Promise<DatabaseTeamEventType | ({ ownerId: number } & DatabaseEventType) | null> {
+ const eventType = await this.eventTypesRepository.getEventTypeByIdWithHosts(eventTypeId);
+
+ if (!eventType) {
+ return null;
+ }
+
+ const hasAccess = await this.eventTypeAccessService.userIsEventTypeAdminOrOwner(
+ authUser,
+ eventType as unknown as EventType
+ );
+
+ if (!hasAccess) {
+ return null;
+ }
+
+ return {
+ ownerId: eventType.userId ?? 0,
+ ...eventType,
+ };
+ }
+
async checkCanCreateEventType(userId: number, body: InputEventTransformed_2024_06_14) {
const existsWithSlug = await this.eventTypesRepository.getUserEventTypeBySlug(userId, body.slug);
if (existsWithSlug) {
diff --git a/apps/api/v2/src/modules/event-types/services/event-type-access.service.ts b/apps/api/v2/src/modules/event-types/services/event-type-access.service.ts
new file mode 100644
index 00000000000..00de2547f1a
--- /dev/null
+++ b/apps/api/v2/src/modules/event-types/services/event-type-access.service.ts
@@ -0,0 +1,78 @@
+import { EventTypesRepository_2024_06_14 } from "@/ee/event-types/event-types_2024_06_14/event-types.repository";
+import { ApiAuthGuardUser } from "@/modules/auth/strategies/api-auth/api-auth.strategy";
+import { MembershipsRepository } from "@/modules/memberships/memberships.repository";
+import { MembershipsService } from "@/modules/memberships/services/memberships.service";
+import { TeamsRepository } from "@/modules/teams/teams/teams.repository";
+import { Injectable } from "@nestjs/common";
+
+import type { EventType } from "@calcom/prisma/client";
+
+@Injectable()
+export class EventTypeAccessService {
+ constructor(
+ private readonly eventTypesRepository: EventTypesRepository_2024_06_14,
+ private readonly membershipsRepository: MembershipsRepository,
+ private readonly membershipsService: MembershipsService,
+ private readonly teamsRepository: TeamsRepository
+ ) {}
+
+ async userIsEventTypeAdminOrOwner(authUser: ApiAuthGuardUser, eventType: EventType): Promise<boolean> {
+ const authUserId = authUser.id;
+ const eventTypeId = eventType.id;
+ const teamId = eventType.teamId;
+ const eventTypeOwnerId = eventType.userId || null;
+
+ if (authUser.isSystemAdmin) return true;
+
+ if (eventTypeOwnerId === authUserId) return true;
+
+ if (eventTypeId) {
+ const isHostOrAssigned = await this.isUserHostOrAssignedToEventType(authUserId, eventTypeId);
+ if (isHostOrAssigned) return true;
+ }
+
+ if (teamId) {
+ const isTeamOrParentOrgAdmin = await this.isUserTeamAdminOrParentOrgAdmin(authUserId, teamId);
+ if (isTeamOrParentOrgAdmin) return true;
+ }
+
+ if (eventTypeOwnerId) {
+ const isOrgAdminOrOwnerOfEventOwner = await this.isUserOrgAdminOrOwnerOfEventOwner(
+ authUserId,
+ eventTypeOwnerId
+ );
+ if (isOrgAdminOrOwnerOfEventOwner) return true;
+ }
+
+ return false;
+ }
+
+ private async isUserHostOrAssignedToEventType(authUserId: number, eventTypeId: number): Promise<boolean> {
+ const [isUserHost, isUserAssigned] = await Promise.all([
+ this.eventTypesRepository.isUserHostOfEventType(authUserId, eventTypeId),
+ this.eventTypesRepository.isUserAssignedToEventType(authUserId, eventTypeId),
+ ]);
+ return isUserHost || isUserAssigned;
+ }
+
+ private async isUserTeamAdminOrParentOrgAdmin(authUserId: number, teamId: number): Promise<boolean> {
+ const membership = await this.membershipsRepository.getUserAdminOrOwnerTeamMembership(authUserId, teamId);
+ if (membership) return true;
+
+ const team = await this.teamsRepository.getById(teamId);
+ const parentOrgId = team?.parentId ?? null;
+ if (parentOrgId) {
+ const isOrgAdmin = await this.membershipsRepository.isUserOrganizationAdmin(authUserId, parentOrgId);
+ if (isOrgAdmin) return true;
+ }
+
+ return false;
+ }
+
+ private async isUserOrgAdminOrOwnerOfEventOwner(
+ authUserId: number,
+ eventTypeOwnerId: number
+ ): Promise<boolean> {
+ return this.membershipsService.isUserOrgAdminOrOwnerOfAnotherUser(authUserId, eventTypeOwnerId);
+ }
+}
diff --git a/docs/api-reference/v2/openapi.json b/docs/api-reference/v2/openapi.json
index e65cb5a7d9b..ecef1f6c9d4 100644
--- a/docs/api-reference/v2/openapi.json
+++ b/docs/api-reference/v2/openapi.json
@@ -11579,7 +11579,7 @@
"get": {
"operationId": "EventTypesController_2024_06_14_getEventTypeById",
"summary": "Get an event type",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n \n Access control: This endpoint fetches an event type by ID and returns it only if the authenticated user is authorized. Authorization is granted to:\n - System admins\n - The event type owner\n - Hosts of the event type or users assigned to the event type\n - Team admins/owners of the team that owns the team event type\n - Organization admins/owners of the event type owner's organization\n - Organization admins/owners of the team's parent organization\n\n Note: Update and delete endpoints remain restricted to the event type owner only.",
"parameters": [
{
"name": "cal-api-version",
@@ -19166,45 +19166,56 @@
},
"required": ["status", "data"]
},
- "GetEventTypeOutput_2024_06_14": {
+ "EventTypeTeam": {
"type": "object",
"properties": {
- "status": {
- "type": "string",
- "enum": ["success", "error"],
- "example": "success"
+ "id": {
+ "type": "number"
},
- "data": {
- "nullable": true,
- "allOf": [
- {
- "$ref": "#/components/schemas/EventTypeOutput_2024_06_14"
- }
- ]
- }
- },
- "required": ["status", "data"]
- },
- "GetEventTypesOutput_2024_06_14": {
- "type": "object",
- "properties": {
- "status": {
- "type": "string",
- "enum": ["success", "error"],
- "example": "success"
+ "slug": {
+ "type": "string"
},
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EventTypeOutput_2024_06_14"
- }
+ "bannerUrl": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "logoUrl": {
+ "type": "string"
+ },
+ "weekStart": {
+ "type": "string"
+ },
+ "brandColor": {
+ "type": "string"
+ },
+ "darkBrandColor": {
+ "type": "string"
+ },
+ "theme": {
+ "type": "string"
}
},
- "required": ["status", "data"]
+ "required": [
+ "id",
+ "slug",
+ "bannerUrl",
+ "name",
+ "logoUrl",
+ "weekStart",
+ "brandColor",
+ "darkBrandColor",
+ "theme"
+ ]
},
- "UpdateEventTypeInput_2024_06_14": {
+ "TeamEventTypeOutput_2024_06_14": {
"type": "object",
"properties": {
+ "id": {
+ "type": "number",
+ "example": 1
+ },
"lengthInMinutes": {
"type": "number",
"example": 60
@@ -19214,7 +19225,7 @@
"description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.",
"type": "array",
"items": {
- "type": "string"
+ "type": "number"
}
},
"title": {
@@ -19227,181 +19238,194 @@
},
"description": {
"type": "string",
- "example": "Discover the culinary wonders of the Argentina by making the best flan ever!"
+ "example": "Discover the culinary wonders of Argentina by making the best flan ever!"
+ },
+ "locations": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OutputAddressLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/OutputLinkLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/OutputIntegrationLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/OutputPhoneLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/OutputOrganizersDefaultAppLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/OutputUnknownLocation_2024_06_14"
+ }
+ ]
+ }
},
"bookingFields": {
"type": "array",
- "description": "Complete set of booking form fields. This array replaces all existing booking fields. To modify existing fields, first fetch the current event type, then include all desired fields in this array. Sending only one field will remove all other custom fields, keeping only default fields plus the provided one.",
"items": {
"oneOf": [
{
- "$ref": "#/components/schemas/NameDefaultFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/NameDefaultFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/EmailDefaultFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/EmailDefaultFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/TitleDefaultFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/LocationDefaultFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/LocationDefaultFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/RescheduleReasonDefaultFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/NotesDefaultFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/TitleDefaultFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/GuestsDefaultFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/NotesDefaultFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/RescheduleReasonDefaultFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/GuestsDefaultFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/PhoneFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/PhoneFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/AddressFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/AddressFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/TextFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/TextFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/NumberFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/NumberFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/TextAreaFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/TextAreaFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/SelectFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/SelectFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/MultiSelectFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/MultiSelectFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/MultiEmailFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/MultiEmailFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/CheckboxGroupFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/CheckboxGroupFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/RadioGroupFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/RadioGroupFieldOutput_2024_06_14"
},
{
- "$ref": "#/components/schemas/BooleanFieldInput_2024_06_14"
+ "$ref": "#/components/schemas/BooleanFieldOutput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/UrlFieldOutput_2024_06_14"
}
]
}
},
"disableGuests": {
- "type": "boolean",
- "description": "If true, person booking this event can't add guests via their emails."
+ "type": "boolean"
},
"slotInterval": {
- "type": "number",
- "description": "Number representing length of each slot when event is booked. By default it equal length of the event type.\n If event length is 60 minutes then we would have slots 9AM, 10AM, 11AM etc. but if it was changed to 30 minutes then\n we would have slots 9AM, 9:30AM, 10AM, 10:30AM etc. as the available times to book the 60 minute event."
+ "type": "object",
+ "example": 60,
+ "nullable": true
},
"minimumBookingNotice": {
"type": "number",
- "description": "Minimum number of minutes before the event that a booking can be made."
+ "example": 0
},
"beforeEventBuffer": {
"type": "number",
- "description": "Time spaces that can be prepended before an event to give more time before it."
+ "example": 0
},
"afterEventBuffer": {
"type": "number",
- "description": "Time spaces that can be appended after an event to give more time after it."
+ "example": 0
+ },
+ "recurrence": {
+ "nullable": true,
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Recurrence_2024_06_14"
+ }
+ ]
+ },
+ "metadata": {
+ "type": "object"
+ },
+ "price": {
+ "type": "number"
+ },
+ "currency": {
+ "type": "string"
+ },
+ "lockTimeZoneToggleOnBookingPage": {
+ "type": "boolean"
+ },
+ "seatsPerTimeSlot": {
+ "type": "object",
+ "nullable": true
+ },
+ "forwardParamsSuccessRedirect": {
+ "type": "object",
+ "nullable": true
+ },
+ "successRedirectUrl": {
+ "type": "object",
+ "nullable": true
+ },
+ "isInstantEvent": {
+ "type": "boolean"
+ },
+ "seatsShowAvailabilityCount": {
+ "type": "boolean",
+ "nullable": true
},
"scheduleId": {
"type": "number",
- "description": "If you want that this event has different schedule than user's default one you can specify it here."
+ "nullable": true
},
"bookingLimitsCount": {
- "description": "Limit how many times this event can be booked",
- "oneOf": [
- {
- "$ref": "#/components/schemas/BaseBookingLimitsCount_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "type": "object"
},
"bookerActiveBookingsLimit": {
- "description": "Limit the number of active bookings a booker can make for this event type.",
- "oneOf": [
- {
- "$ref": "#/components/schemas/BookerActiveBookingsLimit_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "$ref": "#/components/schemas/BookerActiveBookingsLimitOutput_2024_06_14"
},
"onlyShowFirstAvailableSlot": {
- "type": "boolean",
- "description": "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time."
+ "type": "boolean"
},
"bookingLimitsDuration": {
- "description": "Limit total amount of time that this event can be booked",
- "oneOf": [
- {
- "$ref": "#/components/schemas/BaseBookingLimitsDuration_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "type": "object"
},
"bookingWindow": {
+ "type": "array",
"description": "Limit how far in the future this event can be booked",
- "oneOf": [
- {
- "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/RangeWindow_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
- },
- "offsetStart": {
- "type": "number",
- "description": "Offset timeslots shown to bookers by a specified number of minutes"
- },
- "bookerLayouts": {
- "description": "Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.",
- "allOf": [
- {
- "$ref": "#/components/schemas/BookerLayouts_2024_06_14"
- }
- ]
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/RangeWindow_2024_06_14"
+ }
+ ]
+ }
},
- "confirmationPolicy": {
- "description": "Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.",
- "oneOf": [
- {
- "$ref": "#/components/schemas/BaseConfirmationPolicy_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "bookerLayouts": {
+ "$ref": "#/components/schemas/BookerLayouts_2024_06_14"
},
- "recurrence": {
- "description": "Create a recurring event type.",
- "oneOf": [
- {
- "$ref": "#/components/schemas/Recurrence_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "confirmationPolicy": {
+ "type": "object"
},
"requiresBookerEmailVerification": {
"type": "boolean"
@@ -19409,27 +19433,17 @@
"hideCalendarNotes": {
"type": "boolean"
},
- "lockTimeZoneToggleOnBookingPage": {
- "type": "boolean"
- },
"color": {
"$ref": "#/components/schemas/EventTypeColor_2024_06_14"
},
"seats": {
- "description": "Create an event type with multiple seats.",
- "oneOf": [
- {
- "$ref": "#/components/schemas/Seats_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "$ref": "#/components/schemas/Seats_2024_06_14"
+ },
+ "offsetStart": {
+ "type": "number"
},
"customName": {
- "type": "string",
- "description": "Customizable event name with valid variables:\n {Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name},\n {Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION},\n {HOST/ATTENDEE}, {HOST}, {ATTENDEE}, {USER}",
- "example": "{Event type title} between {Organiser} and {Scheduler}"
+ "type": "string"
},
"destinationCalendar": {
"$ref": "#/components/schemas/DestinationCalendar_2024_06_14"
@@ -19440,11 +19454,6 @@
"hideCalendarEventDetails": {
"type": "boolean"
},
- "successRedirectUrl": {
- "type": "string",
- "description": "A valid URL where the booker will redirect to, once the booking is completed successfully",
- "example": "https://masterchief.com/argentina/flan/video/9129412"
- },
"hideOrganizerEmail": {
"type": "boolean",
"description": "Boolean to Hide organizer's email address from the booking screen, email notifications, and calendar events"
@@ -19462,76 +19471,76 @@
},
"bookingRequiresAuthentication": {
"type": "boolean",
- "default": false,
"description": "Boolean to require authentication for booking this event type via api. If true, only authenticated users who are the event-type owner or org/team admin/owner can book this event type."
},
- "locations": {
+ "teamId": {
+ "type": "number"
+ },
+ "ownerId": {
+ "type": "object",
+ "nullable": true
+ },
+ "parentEventTypeId": {
+ "type": "object",
+ "description": "For managed event types, parent event type is the event type that this event type is based on",
+ "nullable": true
+ },
+ "hosts": {
"type": "array",
- "description": "Locations where the event will take place. If not provided, cal video link will be used as the location.",
"items": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/InputAddressLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/InputLinkLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/InputIntegrationLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/InputPhoneLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/InputAttendeeAddressLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/InputAttendeePhoneLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/InputAttendeeDefinedLocation_2024_06_14"
- }
- ]
+ "type": "string"
}
- }
- }
- },
- "UpdateEventTypeOutput_2024_06_14": {
- "type": "object",
- "properties": {
- "status": {
- "type": "string",
- "enum": ["success", "error"],
- "example": "success"
},
- "data": {
- "$ref": "#/components/schemas/EventTypeOutput_2024_06_14"
- }
- },
- "required": ["status", "data"]
- },
- "DeleteData_2024_06_14": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "example": 1
- },
- "lengthInMinutes": {
- "type": "number",
- "example": 60
+ "assignAllTeamMembers": {
+ "type": "boolean"
},
- "title": {
+ "schedulingType": {
"type": "string",
- "example": "Learn the secrets of masterchief!"
+ "enum": ["roundRobin", "collective", "managed"]
},
- "slug": {
- "type": "string"
+ "team": {
+ "$ref": "#/components/schemas/EventTypeTeam"
+ },
+ "emailSettings": {
+ "description": "Email settings for this event type. Only available for organization team event types.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EmailSettings_2024_06_14"
+ }
+ ]
+ },
+ "rescheduleWithSameRoundRobinHost": {
+ "type": "boolean",
+ "description": "Rescheduled events will be assigned to the same host as initially scheduled."
}
},
- "required": ["id", "lengthInMinutes", "title", "slug"]
+ "required": [
+ "id",
+ "lengthInMinutes",
+ "title",
+ "slug",
+ "description",
+ "locations",
+ "bookingFields",
+ "disableGuests",
+ "recurrence",
+ "metadata",
+ "price",
+ "currency",
+ "lockTimeZoneToggleOnBookingPage",
+ "forwardParamsSuccessRedirect",
+ "successRedirectUrl",
+ "isInstantEvent",
+ "scheduleId",
+ "hidden",
+ "bookingRequiresAuthentication",
+ "teamId",
+ "hosts",
+ "schedulingType",
+ "team"
+ ]
},
- "DeleteEventTypeOutput_2024_06_14": {
+ "GetEventTypeOutput_2024_06_14": {
"type": "object",
"properties": {
"status": {
@@ -19540,77 +19549,486 @@
"example": "success"
},
"data": {
- "$ref": "#/components/schemas/DeleteData_2024_06_14"
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/EventTypeOutput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/TeamEventTypeOutput_2024_06_14"
+ }
+ ]
}
},
"required": ["status", "data"]
},
- "SelectedCalendarsInputDto": {
- "type": "object",
- "properties": {
- "integration": {
- "type": "string"
- },
- "externalId": {
- "type": "string"
- },
- "credentialId": {
- "type": "number"
- },
- "delegationCredentialId": {
- "type": "string"
- }
- },
- "required": ["integration", "externalId", "credentialId"]
- },
- "SelectedCalendarOutputDto": {
- "type": "object",
- "properties": {
- "userId": {
- "type": "number"
- },
- "integration": {
- "type": "string"
- },
- "externalId": {
- "type": "string"
- },
- "credentialId": {
- "type": "number",
- "nullable": true
- }
- },
- "required": ["userId", "integration", "externalId", "credentialId"]
- },
- "SelectedCalendarOutputResponseDto": {
+ "GetEventTypesOutput_2024_06_14": {
"type": "object",
"properties": {
"status": {
"type": "string",
- "example": "success",
- "enum": ["success", "error"]
+ "enum": ["success", "error"],
+ "example": "success"
},
"data": {
- "$ref": "#/components/schemas/SelectedCalendarOutputDto"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EventTypeOutput_2024_06_14"
+ }
}
},
"required": ["status", "data"]
},
- "OrgTeamOutputDto": {
+ "UpdateEventTypeInput_2024_06_14": {
"type": "object",
"properties": {
- "id": {
- "type": "number"
+ "lengthInMinutes": {
+ "type": "number",
+ "example": 60
},
- "parentId": {
- "type": "number"
+ "lengthInMinutesOptions": {
+ "example": [15, 30, 60],
+ "description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "name": {
+ "title": {
"type": "string",
- "minLength": 1
+ "example": "Learn the secrets of masterchief!"
},
"slug": {
- "type": "string"
+ "type": "string",
+ "example": "learn-the-secrets-of-masterchief"
+ },
+ "description": {
+ "type": "string",
+ "example": "Discover the culinary wonders of the Argentina by making the best flan ever!"
+ },
+ "bookingFields": {
+ "type": "array",
+ "description": "Complete set of booking form fields. This array replaces all existing booking fields. To modify existing fields, first fetch the current event type, then include all desired fields in this array. Sending only one field will remove all other custom fields, keeping only default fields plus the provided one.",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/NameDefaultFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/EmailDefaultFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/TitleDefaultFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/LocationDefaultFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/NotesDefaultFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/GuestsDefaultFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/RescheduleReasonDefaultFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/PhoneFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/AddressFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/TextFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/NumberFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/TextAreaFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/SelectFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/MultiSelectFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/MultiEmailFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/CheckboxGroupFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/RadioGroupFieldInput_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/BooleanFieldInput_2024_06_14"
+ }
+ ]
+ }
+ },
+ "disableGuests": {
+ "type": "boolean",
+ "description": "If true, person booking this event can't add guests via their emails."
+ },
+ "slotInterval": {
+ "type": "number",
+ "description": "Number representing length of each slot when event is booked. By default it equal length of the event type.\n If event length is 60 minutes then we would have slots 9AM, 10AM, 11AM etc. but if it was changed to 30 minutes then\n we would have slots 9AM, 9:30AM, 10AM, 10:30AM etc. as the available times to book the 60 minute event."
+ },
+ "minimumBookingNotice": {
+ "type": "number",
+ "description": "Minimum number of minutes before the event that a booking can be made."
+ },
+ "beforeEventBuffer": {
+ "type": "number",
+ "description": "Time spaces that can be prepended before an event to give more time before it."
+ },
+ "afterEventBuffer": {
+ "type": "number",
+ "description": "Time spaces that can be appended after an event to give more time after it."
+ },
+ "scheduleId": {
+ "type": "number",
+ "description": "If you want that this event has different schedule than user's default one you can specify it here."
+ },
+ "bookingLimitsCount": {
+ "description": "Limit how many times this event can be booked",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BaseBookingLimitsCount_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
+ },
+ "bookerActiveBookingsLimit": {
+ "description": "Limit the number of active bookings a booker can make for this event type.",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BookerActiveBookingsLimit_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
+ },
+ "onlyShowFirstAvailableSlot": {
+ "type": "boolean",
+ "description": "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time."
+ },
+ "bookingLimitsDuration": {
+ "description": "Limit total amount of time that this event can be booked",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BaseBookingLimitsDuration_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
+ },
+ "bookingWindow": {
+ "description": "Limit how far in the future this event can be booked",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/RangeWindow_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
+ },
+ "offsetStart": {
+ "type": "number",
+ "description": "Offset timeslots shown to bookers by a specified number of minutes"
+ },
+ "bookerLayouts": {
+ "description": "Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BookerLayouts_2024_06_14"
+ }
+ ]
+ },
+ "confirmationPolicy": {
+ "description": "Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BaseConfirmationPolicy_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
+ },
+ "recurrence": {
+ "description": "Create a recurring event type.",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/Recurrence_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
+ },
+ "requiresBookerEmailVerification": {
+ "type": "boolean"
+ },
+ "hideCalendarNotes": {
+ "type": "boolean"
+ },
+ "lockTimeZoneToggleOnBookingPage": {
+ "type": "boolean"
+ },
+ "color": {
+ "$ref": "#/components/schemas/EventTypeColor_2024_06_14"
+ },
+ "seats": {
+ "description": "Create an event type with multiple seats.",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/Seats_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
+ },
+ "customName": {
+ "type": "string",
+ "description": "Customizable event name with valid variables:\n {Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name},\n {Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION},\n {HOST/ATTENDEE}, {HOST}, {ATTENDEE}, {USER}",
+ "example": "{Event type title} between {Organiser} and {Scheduler}"
+ },
+ "destinationCalendar": {
+ "$ref": "#/components/schemas/DestinationCalendar_2024_06_14"
+ },
+ "useDestinationCalendarEmail": {
+ "type": "boolean"
+ },
+ "hideCalendarEventDetails": {
+ "type": "boolean"
+ },
+ "successRedirectUrl": {
+ "type": "string",
+ "description": "A valid URL where the booker will redirect to, once the booking is completed successfully",
+ "example": "https://masterchief.com/argentina/flan/video/9129412"
+ },
+ "hideOrganizerEmail": {
+ "type": "boolean",
+ "description": "Boolean to Hide organizer's email address from the booking screen, email notifications, and calendar events"
+ },
+ "calVideoSettings": {
+ "description": "Cal video settings for the event type",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/CalVideoSettings"
+ }
+ ]
+ },
+ "hidden": {
+ "type": "boolean"
+ },
+ "bookingRequiresAuthentication": {
+ "type": "boolean",
+ "default": false,
+ "description": "Boolean to require authentication for booking this event type via api. If true, only authenticated users who are the event-type owner or org/team admin/owner can book this event type."
+ },
+ "locations": {
+ "type": "array",
+ "description": "Locations where the event will take place. If not provided, cal video link will be used as the location.",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/InputAddressLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputLinkLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputIntegrationLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputPhoneLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputAttendeeAddressLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputAttendeePhoneLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputAttendeeDefinedLocation_2024_06_14"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "UpdateEventTypeOutput_2024_06_14": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "enum": ["success", "error"],
+ "example": "success"
+ },
+ "data": {
+ "$ref": "#/components/schemas/EventTypeOutput_2024_06_14"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "DeleteData_2024_06_14": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "example": 1
+ },
+ "lengthInMinutes": {
+ "type": "number",
+ "example": 60
+ },
+ "title": {
+ "type": "string",
+ "example": "Learn the secrets of masterchief!"
+ },
+ "slug": {
+ "type": "string"
+ }
+ },
+ "required": ["id", "lengthInMinutes", "title", "slug"]
+ },
+ "DeleteEventTypeOutput_2024_06_14": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "enum": ["success", "error"],
+ "example": "success"
+ },
+ "data": {
+ "$ref": "#/components/schemas/DeleteData_2024_06_14"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "SelectedCalendarsInputDto": {
+ "type": "object",
+ "properties": {
+ "integration": {
+ "type": "string"
+ },
+ "externalId": {
+ "type": "string"
+ },
+ "credentialId": {
+ "type": "number"
+ },
+ "delegationCredentialId": {
+ "type": "string"
+ }
+ },
+ "required": ["integration", "externalId", "credentialId"]
+ },
+ "SelectedCalendarOutputDto": {
+ "type": "object",
+ "properties": {
+ "userId": {
+ "type": "number"
+ },
+ "integration": {
+ "type": "string"
+ },
+ "externalId": {
+ "type": "string"
+ },
+ "credentialId": {
+ "type": "number",
+ "nullable": true
+ }
+ },
+ "required": ["userId", "integration", "externalId", "credentialId"]
+ },
+ "SelectedCalendarOutputResponseDto": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "$ref": "#/components/schemas/SelectedCalendarOutputDto"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "StripConnectOutputDto": {
+ "type": "object",
+ "properties": {
+ "authUrl": {
+ "type": "string"
+ }
+ },
+ "required": ["authUrl"]
+ },
+ "StripConnectOutputResponseDto": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "$ref": "#/components/schemas/StripConnectOutputDto"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "StripCredentialsSaveOutputResponseDto": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ }
+ },
+ "required": ["url"]
+ },
+ "StripCredentialsCheckOutputResponseDto": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "object",
+ "example": "success"
+ }
+ },
+ "required": ["status"]
+ },
+ "OrgTeamOutputDto": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "parentId": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1
+ },
+ "slug": {
+ "type": "string"
},
"logoUrl": {
"type": "string"
@@ -20425,302 +20843,37 @@
"description": "Time format",
"example": 24
},
- "defaultScheduleId": {
- "type": "number",
- "minimum": 0,
- "description": "Default schedule ID",
- "example": 1
- },
- "locale": {
- "type": "string",
- "nullable": true,
- "default": "en",
- "description": "Locale",
- "example": "en"
- },
- "avatarUrl": {
- "type": "string",
- "description": "Avatar URL",
- "example": "https://example.com/avatar.jpg"
- },
- "organizationRole": {
- "type": "string",
- "default": "MEMBER",
- "enum": ["MEMBER", "ADMIN", "OWNER"]
- },
- "autoAccept": {
- "type": "boolean",
- "default": true
- }
- },
- "required": ["email"]
- },
- "GetOrganizationUserOutput": {
- "type": "object",
- "properties": {
- "status": {
- "type": "string",
- "example": "success",
- "enum": ["success", "error"]
- },
- "data": {
- "$ref": "#/components/schemas/GetOrgUsersWithProfileOutput"
- }
- },
- "required": ["status", "data"]
- },
- "UpdateOrganizationUserInput": {
- "type": "object",
- "properties": {}
- },
- "BaseAttribute": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- }
- },
- "required": ["id", "name"]
- },
- "TextAttribute": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "type": {
- "type": "string"
- },
- "option": {
- "type": "string"
- },
- "optionId": {
- "type": "string"
- }
- },
- "required": ["id", "name", "type", "option", "optionId"]
- },
- "NumberAttribute": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "type": {
- "type": "string"
- },
- "option": {
- "type": "number"
- },
- "optionId": {
- "type": "string"
- }
- },
- "required": ["id", "name", "type", "option", "optionId"]
- },
- "SingleSelectAttribute": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "type": {
- "type": "string"
- },
- "option": {
- "type": "string"
- },
- "optionId": {
- "type": "string"
- }
- },
- "required": ["id", "name", "type", "option", "optionId"]
- },
- "MultiSelectAttributeOption": {
- "type": "object",
- "properties": {
- "optionId": {
- "type": "string"
- },
- "option": {
- "type": "string"
- }
- },
- "required": ["optionId", "option"]
- },
- "MultiSelectAttribute": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "type": {
- "type": "string"
- },
- "options": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/MultiSelectAttributeOption"
- }
- }
- },
- "required": ["id", "name", "type", "options"]
- },
- "MembershipUserOutputDto": {
- "type": "object",
- "properties": {
- "avatarUrl": {
- "type": "string"
- },
- "username": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "bio": {
- "type": "string"
- },
- "metadata": {
- "type": "object",
- "example": {
- "key": "value"
- }
- }
- },
- "required": ["email"]
- },
- "OrganizationMembershipOutput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number"
- },
- "userId": {
- "type": "number"
- },
- "teamId": {
- "type": "number"
- },
- "accepted": {
- "type": "boolean"
- },
- "role": {
- "type": "string",
- "enum": ["MEMBER", "OWNER", "ADMIN"]
- },
- "disableImpersonation": {
- "type": "boolean"
- },
- "user": {
- "$ref": "#/components/schemas/MembershipUserOutputDto"
- },
- "attributes": {
- "type": "array",
- "items": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/TextAttribute"
- },
- {
- "$ref": "#/components/schemas/NumberAttribute"
- },
- {
- "$ref": "#/components/schemas/SingleSelectAttribute"
- },
- {
- "$ref": "#/components/schemas/MultiSelectAttribute"
- }
- ]
- }
- }
- },
- "required": ["id", "userId", "teamId", "accepted", "role", "user", "attributes"]
- },
- "GetAllOrgMemberships": {
- "type": "object",
- "properties": {
- "status": {
- "type": "string",
- "example": "success",
- "enum": ["success", "error"]
- },
- "data": {
- "$ref": "#/components/schemas/OrganizationMembershipOutput"
- }
- },
- "required": ["status", "data"]
- },
- "CreateOrgMembershipDto": {
- "type": "object",
- "properties": {
- "userId": {
- "type": "number"
- },
- "accepted": {
- "type": "boolean",
- "default": false
+ "defaultScheduleId": {
+ "type": "number",
+ "minimum": 0,
+ "description": "Default schedule ID",
+ "example": 1
},
- "role": {
+ "locale": {
"type": "string",
- "default": "MEMBER",
- "enum": ["MEMBER", "OWNER", "ADMIN"],
- "description": "If you are platform customer then managed users should only have MEMBER role."
+ "nullable": true,
+ "default": "en",
+ "description": "Locale",
+ "example": "en"
},
- "disableImpersonation": {
- "type": "boolean",
- "default": false
- }
- },
- "required": ["userId", "role"]
- },
- "CreateOrgMembershipOutput": {
- "type": "object",
- "properties": {
- "status": {
+ "avatarUrl": {
"type": "string",
- "example": "success",
- "enum": ["success", "error"]
+ "description": "Avatar URL",
+ "example": "https://example.com/avatar.jpg"
},
- "data": {
- "$ref": "#/components/schemas/OrganizationMembershipOutput"
- }
- },
- "required": ["status", "data"]
- },
- "GetOrgMembership": {
- "type": "object",
- "properties": {
- "status": {
+ "organizationRole": {
"type": "string",
- "example": "success",
- "enum": ["success", "error"]
+ "default": "MEMBER",
+ "enum": ["MEMBER", "ADMIN", "OWNER"]
},
- "data": {
- "$ref": "#/components/schemas/OrganizationMembershipOutput"
+ "autoAccept": {
+ "type": "boolean",
+ "default": true
}
},
- "required": ["status", "data"]
+ "required": ["email"]
},
- "DeleteOrgMembership": {
+ "GetOrganizationUserOutput": {
"type": "object",
"properties": {
"status": {
@@ -20729,438 +20882,326 @@
"enum": ["success", "error"]
},
"data": {
- "$ref": "#/components/schemas/OrganizationMembershipOutput"
+ "$ref": "#/components/schemas/GetOrgUsersWithProfileOutput"
}
},
"required": ["status", "data"]
},
- "UpdateOrgMembershipDto": {
+ "UpdateOrganizationUserInput": {
"type": "object",
- "properties": {
- "accepted": {
- "type": "boolean"
- },
- "role": {
- "type": "string",
- "enum": ["MEMBER", "OWNER", "ADMIN"]
- },
- "disableImpersonation": {
- "type": "boolean"
- }
- }
+ "properties": {}
},
- "UpdateOrgMembership": {
+ "BaseAttribute": {
"type": "object",
"properties": {
- "status": {
- "type": "string",
- "example": "success",
- "enum": ["success", "error"]
+ "id": {
+ "type": "string"
},
- "data": {
- "$ref": "#/components/schemas/OrganizationMembershipOutput"
+ "name": {
+ "type": "string"
}
},
- "required": ["status", "data"]
+ "required": ["id", "name"]
},
- "Host": {
+ "TextAttribute": {
"type": "object",
"properties": {
- "userId": {
- "type": "number",
- "description": "Which user is the host of this event"
+ "id": {
+ "type": "string"
},
- "mandatory": {
- "type": "boolean",
- "description": "Only relevant for round robin event types. If true then the user must attend round robin event always."
+ "name": {
+ "type": "string"
},
- "priority": {
- "type": "string",
- "enum": ["lowest", "low", "medium", "high", "highest"]
+ "type": {
+ "type": "string"
+ },
+ "option": {
+ "type": "string"
+ },
+ "optionId": {
+ "type": "string"
}
},
- "required": ["userId"]
+ "required": ["id", "name", "type", "option", "optionId"]
},
- "CreateTeamEventTypeInput_2024_06_14": {
+ "NumberAttribute": {
"type": "object",
"properties": {
- "lengthInMinutes": {
- "type": "number",
- "example": 60
- },
- "lengthInMinutesOptions": {
- "example": [15, 30, 60],
- "description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "title": {
- "type": "string",
- "example": "Learn the secrets of masterchief!"
- },
- "slug": {
- "type": "string",
- "example": "learn-the-secrets-of-masterchief"
- },
- "description": {
- "type": "string",
- "example": "Discover the culinary wonders of the Argentina by making the best flan ever!"
- },
- "bookingFields": {
- "type": "array",
- "description": "Custom fields that can be added to the booking form when the event is booked by someone. By default booking form has name and email field.",
- "items": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/NameDefaultFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/EmailDefaultFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/TitleDefaultFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/LocationDefaultFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/NotesDefaultFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/GuestsDefaultFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/RescheduleReasonDefaultFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/PhoneFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/AddressFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/TextFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/NumberFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/TextAreaFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/SelectFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/MultiSelectFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/MultiEmailFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/CheckboxGroupFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/RadioGroupFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/BooleanFieldInput_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/UrlFieldInput_2024_06_14"
- }
- ]
- }
- },
- "disableGuests": {
- "type": "boolean",
- "description": "If true, person booking this event can't add guests via their emails."
- },
- "slotInterval": {
- "type": "number",
- "description": "Number representing length of each slot when event is booked. By default it equal length of the event type.\n If event length is 60 minutes then we would have slots 9AM, 10AM, 11AM etc. but if it was changed to 30 minutes then\n we would have slots 9AM, 9:30AM, 10AM, 10:30AM etc. as the available times to book the 60 minute event."
- },
- "minimumBookingNotice": {
- "type": "number",
- "description": "Minimum number of minutes before the event that a booking can be made."
- },
- "beforeEventBuffer": {
- "type": "number",
- "description": "Time spaces that can be prepended before an event to give more time before it."
- },
- "afterEventBuffer": {
- "type": "number",
- "description": "Time spaces that can be appended after an event to give more time after it."
- },
- "scheduleId": {
- "type": "number",
- "description": "If you want that this event has different schedule than user's default one you can specify it here."
- },
- "bookingLimitsCount": {
- "description": "Limit how many times this event can be booked",
- "oneOf": [
- {
- "$ref": "#/components/schemas/BaseBookingLimitsCount_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
- },
- "bookerActiveBookingsLimit": {
- "description": "Limit the number of active bookings a booker can make for this event type.",
- "oneOf": [
- {
- "$ref": "#/components/schemas/BookerActiveBookingsLimit_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "id": {
+ "type": "string"
},
- "onlyShowFirstAvailableSlot": {
- "type": "boolean",
- "description": "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time."
+ "name": {
+ "type": "string"
},
- "bookingLimitsDuration": {
- "description": "Limit total amount of time that this event can be booked",
- "oneOf": [
- {
- "$ref": "#/components/schemas/BaseBookingLimitsDuration_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "type": {
+ "type": "string"
},
- "bookingWindow": {
- "description": "Limit how far in the future this event can be booked",
- "oneOf": [
- {
- "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/RangeWindow_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "option": {
+ "type": "number"
},
- "offsetStart": {
- "type": "number",
- "description": "Offset timeslots shown to bookers by a specified number of minutes"
+ "optionId": {
+ "type": "string"
+ }
+ },
+ "required": ["id", "name", "type", "option", "optionId"]
+ },
+ "SingleSelectAttribute": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
},
- "bookerLayouts": {
- "description": "Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.",
- "allOf": [
- {
- "$ref": "#/components/schemas/BookerLayouts_2024_06_14"
- }
- ]
+ "name": {
+ "type": "string"
},
- "confirmationPolicy": {
- "description": "Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.",
- "oneOf": [
- {
- "$ref": "#/components/schemas/BaseConfirmationPolicy_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "type": {
+ "type": "string"
},
- "recurrence": {
- "description": "Create a recurring event type.",
- "oneOf": [
- {
- "$ref": "#/components/schemas/Recurrence_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "option": {
+ "type": "string"
},
- "requiresBookerEmailVerification": {
- "type": "boolean"
+ "optionId": {
+ "type": "string"
+ }
+ },
+ "required": ["id", "name", "type", "option", "optionId"]
+ },
+ "MultiSelectAttributeOption": {
+ "type": "object",
+ "properties": {
+ "optionId": {
+ "type": "string"
},
- "hideCalendarNotes": {
- "type": "boolean"
+ "option": {
+ "type": "string"
+ }
+ },
+ "required": ["optionId", "option"]
+ },
+ "MultiSelectAttribute": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
},
- "lockTimeZoneToggleOnBookingPage": {
- "type": "boolean"
+ "name": {
+ "type": "string"
},
- "color": {
- "$ref": "#/components/schemas/EventTypeColor_2024_06_14"
+ "type": {
+ "type": "string"
},
- "seats": {
- "description": "Create an event type with multiple seats.",
- "oneOf": [
- {
- "$ref": "#/components/schemas/Seats_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/Disabled_2024_06_14"
- }
- ]
+ "options": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MultiSelectAttributeOption"
+ }
+ }
+ },
+ "required": ["id", "name", "type", "options"]
+ },
+ "MembershipUserOutputDto": {
+ "type": "object",
+ "properties": {
+ "avatarUrl": {
+ "type": "string"
},
- "customName": {
- "type": "string",
- "description": "Customizable event name with valid variables:\n {Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name},\n {Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION},\n {HOST/ATTENDEE}, {HOST}, {ATTENDEE}, {USER}",
- "example": "{Event type title} between {Organiser} and {Scheduler}"
+ "username": {
+ "type": "string"
},
- "destinationCalendar": {
- "$ref": "#/components/schemas/DestinationCalendar_2024_06_14"
+ "name": {
+ "type": "string"
},
- "useDestinationCalendarEmail": {
- "type": "boolean"
+ "email": {
+ "type": "string"
},
- "hideCalendarEventDetails": {
- "type": "boolean"
+ "bio": {
+ "type": "string"
},
- "successRedirectUrl": {
- "type": "string",
- "description": "A valid URL where the booker will redirect to, once the booking is completed successfully",
- "example": "https://masterchief.com/argentina/flan/video/9129412"
+ "metadata": {
+ "type": "object",
+ "example": {
+ "key": "value"
+ }
+ }
+ },
+ "required": ["email"]
+ },
+ "OrganizationMembershipOutput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
},
- "hideOrganizerEmail": {
- "type": "boolean",
- "description": "Boolean to Hide organizer's email address from the booking screen, email notifications, and calendar events"
+ "userId": {
+ "type": "number"
},
- "calVideoSettings": {
- "description": "Cal video settings for the event type. Platform customers can't manage this property because currently we have no way of determining if managed user is a host or an attendee.",
- "allOf": [
- {
- "$ref": "#/components/schemas/CalVideoSettings"
- }
- ]
+ "teamId": {
+ "type": "number"
},
- "hidden": {
+ "accepted": {
"type": "boolean"
},
- "bookingRequiresAuthentication": {
- "type": "boolean",
- "default": false,
- "description": "Boolean to require authentication for booking this event type via api. If true, only authenticated users who are the event-type owner or org/team admin/owner can book this event type."
- },
- "schedulingType": {
+ "role": {
"type": "string",
- "enum": ["collective", "roundRobin", "managed"],
- "example": "collective",
- "description": "The scheduling type for the team event - collective, roundRobin or managed."
+ "enum": ["MEMBER", "OWNER", "ADMIN"]
},
- "hosts": {
- "description": "Hosts contain specific team members you want to assign to this event type, but if you want to assign all team members, use `assignAllTeamMembers: true` instead and omit this field. For platform customers the hosts can include userIds only of managed users. Provide either hosts or assignAllTeamMembers but not both",
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Host"
- }
+ "disableImpersonation": {
+ "type": "boolean"
},
- "assignAllTeamMembers": {
- "type": "boolean",
- "description": "If true, all current and future team members will be assigned to this event type. Provide either assignAllTeamMembers or hosts but not both"
+ "user": {
+ "$ref": "#/components/schemas/MembershipUserOutputDto"
},
- "locations": {
+ "attributes": {
"type": "array",
- "description": "Locations where the event will take place. If not provided, cal video link will be used as the location.",
"items": {
"oneOf": [
{
- "$ref": "#/components/schemas/InputAddressLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/InputLinkLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/InputIntegrationLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/InputPhoneLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/InputAttendeeAddressLocation_2024_06_14"
+ "$ref": "#/components/schemas/TextAttribute"
},
{
- "$ref": "#/components/schemas/InputAttendeePhoneLocation_2024_06_14"
+ "$ref": "#/components/schemas/NumberAttribute"
},
{
- "$ref": "#/components/schemas/InputAttendeeDefinedLocation_2024_06_14"
+ "$ref": "#/components/schemas/SingleSelectAttribute"
},
{
- "$ref": "#/components/schemas/InputOrganizersDefaultApp_2024_06_14"
+ "$ref": "#/components/schemas/MultiSelectAttribute"
}
]
}
+ }
+ },
+ "required": ["id", "userId", "teamId", "accepted", "role", "user", "attributes"]
+ },
+ "GetAllOrgMemberships": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
},
- "emailSettings": {
- "description": "Email settings for this event type - only available for organization team event types.",
- "allOf": [
- {
- "$ref": "#/components/schemas/EmailSettings_2024_06_14"
- }
- ]
- },
- "rescheduleWithSameRoundRobinHost": {
- "type": "boolean",
- "description": "Rescheduled events will be assigned to the same host as initially scheduled."
+ "data": {
+ "$ref": "#/components/schemas/OrganizationMembershipOutput"
}
},
- "required": ["lengthInMinutes", "title", "slug", "schedulingType"]
+ "required": ["status", "data"]
},
- "EventTypeTeam": {
+ "CreateOrgMembershipDto": {
"type": "object",
"properties": {
- "id": {
+ "userId": {
"type": "number"
},
- "slug": {
- "type": "string"
+ "accepted": {
+ "type": "boolean",
+ "default": false
},
- "bannerUrl": {
- "type": "string"
+ "role": {
+ "type": "string",
+ "default": "MEMBER",
+ "enum": ["MEMBER", "OWNER", "ADMIN"],
+ "description": "If you are platform customer then managed users should only have MEMBER role."
},
- "name": {
- "type": "string"
+ "disableImpersonation": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "required": ["userId", "role"]
+ },
+ "CreateOrgMembershipOutput": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
},
- "logoUrl": {
- "type": "string"
+ "data": {
+ "$ref": "#/components/schemas/OrganizationMembershipOutput"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "GetOrgMembership": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
},
- "weekStart": {
- "type": "string"
+ "data": {
+ "$ref": "#/components/schemas/OrganizationMembershipOutput"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "DeleteOrgMembership": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
},
- "brandColor": {
- "type": "string"
+ "data": {
+ "$ref": "#/components/schemas/OrganizationMembershipOutput"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "UpdateOrgMembershipDto": {
+ "type": "object",
+ "properties": {
+ "accepted": {
+ "type": "boolean"
},
- "darkBrandColor": {
- "type": "string"
+ "role": {
+ "type": "string",
+ "enum": ["MEMBER", "OWNER", "ADMIN"]
},
- "theme": {
- "type": "string"
+ "disableImpersonation": {
+ "type": "boolean"
+ }
+ }
+ },
+ "UpdateOrgMembership": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "$ref": "#/components/schemas/OrganizationMembershipOutput"
}
},
- "required": [
- "id",
- "slug",
- "bannerUrl",
- "name",
- "logoUrl",
- "weekStart",
- "brandColor",
- "darkBrandColor",
- "theme"
- ]
+ "required": ["status", "data"]
},
- "TeamEventTypeOutput_2024_06_14": {
+ "Host": {
"type": "object",
"properties": {
- "id": {
+ "userId": {
"type": "number",
- "example": 1
+ "description": "Which user is the host of this event"
+ },
+ "mandatory": {
+ "type": "boolean",
+ "description": "Only relevant for round robin event types. If true then the user must attend round robin event always."
},
+ "priority": {
+ "type": "string",
+ "enum": ["lowest", "low", "medium", "high", "highest"]
+ }
+ },
+ "required": ["userId"]
+ },
+ "CreateTeamEventTypeInput_2024_06_14": {
+ "type": "object",
+ "properties": {
"lengthInMinutes": {
"type": "number",
"example": 60
@@ -21170,7 +21211,7 @@
"description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.",
"type": "array",
"items": {
- "type": "number"
+ "type": "string"
}
},
"title": {
@@ -21183,194 +21224,184 @@
},
"description": {
"type": "string",
- "example": "Discover the culinary wonders of Argentina by making the best flan ever!"
- },
- "locations": {
- "type": "array",
- "items": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OutputAddressLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/OutputLinkLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/OutputIntegrationLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/OutputPhoneLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/OutputOrganizersDefaultAppLocation_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/OutputUnknownLocation_2024_06_14"
- }
- ]
- }
+ "example": "Discover the culinary wonders of the Argentina by making the best flan ever!"
},
"bookingFields": {
"type": "array",
+ "description": "Custom fields that can be added to the booking form when the event is booked by someone. By default booking form has name and email field.",
"items": {
"oneOf": [
{
- "$ref": "#/components/schemas/NameDefaultFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/NameDefaultFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/EmailDefaultFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/EmailDefaultFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/LocationDefaultFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/TitleDefaultFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/RescheduleReasonDefaultFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/LocationDefaultFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/TitleDefaultFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/NotesDefaultFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/NotesDefaultFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/GuestsDefaultFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/GuestsDefaultFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/RescheduleReasonDefaultFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/PhoneFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/PhoneFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/AddressFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/AddressFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/TextFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/TextFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/NumberFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/NumberFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/TextAreaFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/TextAreaFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/SelectFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/SelectFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/MultiSelectFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/MultiSelectFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/MultiEmailFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/MultiEmailFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/CheckboxGroupFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/CheckboxGroupFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/RadioGroupFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/RadioGroupFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/BooleanFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/BooleanFieldInput_2024_06_14"
},
{
- "$ref": "#/components/schemas/UrlFieldOutput_2024_06_14"
+ "$ref": "#/components/schemas/UrlFieldInput_2024_06_14"
}
]
}
},
"disableGuests": {
- "type": "boolean"
+ "type": "boolean",
+ "description": "If true, person booking this event can't add guests via their emails."
},
"slotInterval": {
- "type": "object",
- "example": 60,
- "nullable": true
+ "type": "number",
+ "description": "Number representing length of each slot when event is booked. By default it equal length of the event type.\n If event length is 60 minutes then we would have slots 9AM, 10AM, 11AM etc. but if it was changed to 30 minutes then\n we would have slots 9AM, 9:30AM, 10AM, 10:30AM etc. as the available times to book the 60 minute event."
},
"minimumBookingNotice": {
"type": "number",
- "example": 0
+ "description": "Minimum number of minutes before the event that a booking can be made."
},
"beforeEventBuffer": {
"type": "number",
- "example": 0
- },
- "afterEventBuffer": {
- "type": "number",
- "example": 0
- },
- "recurrence": {
- "nullable": true,
- "allOf": [
- {
- "$ref": "#/components/schemas/Recurrence_2024_06_14"
- }
- ]
- },
- "metadata": {
- "type": "object"
- },
- "price": {
- "type": "number"
- },
- "currency": {
- "type": "string"
- },
- "lockTimeZoneToggleOnBookingPage": {
- "type": "boolean"
- },
- "seatsPerTimeSlot": {
- "type": "object",
- "nullable": true
- },
- "forwardParamsSuccessRedirect": {
- "type": "object",
- "nullable": true
- },
- "successRedirectUrl": {
- "type": "object",
- "nullable": true
- },
- "isInstantEvent": {
- "type": "boolean"
- },
- "seatsShowAvailabilityCount": {
- "type": "boolean",
- "nullable": true
+ "description": "Time spaces that can be prepended before an event to give more time before it."
+ },
+ "afterEventBuffer": {
+ "type": "number",
+ "description": "Time spaces that can be appended after an event to give more time after it."
},
"scheduleId": {
"type": "number",
- "nullable": true
+ "description": "If you want that this event has different schedule than user's default one you can specify it here."
},
"bookingLimitsCount": {
- "type": "object"
+ "description": "Limit how many times this event can be booked",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BaseBookingLimitsCount_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
},
"bookerActiveBookingsLimit": {
- "$ref": "#/components/schemas/BookerActiveBookingsLimitOutput_2024_06_14"
+ "description": "Limit the number of active bookings a booker can make for this event type.",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BookerActiveBookingsLimit_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
},
"onlyShowFirstAvailableSlot": {
- "type": "boolean"
+ "type": "boolean",
+ "description": "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time."
},
"bookingLimitsDuration": {
- "type": "object"
+ "description": "Limit total amount of time that this event can be booked",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BaseBookingLimitsDuration_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
},
"bookingWindow": {
- "type": "array",
"description": "Limit how far in the future this event can be booked",
- "items": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14"
- },
- {
- "$ref": "#/components/schemas/RangeWindow_2024_06_14"
- }
- ]
- }
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/RangeWindow_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
+ },
+ "offsetStart": {
+ "type": "number",
+ "description": "Offset timeslots shown to bookers by a specified number of minutes"
},
"bookerLayouts": {
- "$ref": "#/components/schemas/BookerLayouts_2024_06_14"
+ "description": "Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BookerLayouts_2024_06_14"
+ }
+ ]
},
"confirmationPolicy": {
- "type": "object"
+ "description": "Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/BaseConfirmationPolicy_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
+ },
+ "recurrence": {
+ "description": "Create a recurring event type.",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/Recurrence_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
},
"requiresBookerEmailVerification": {
"type": "boolean"
@@ -21378,17 +21409,27 @@
"hideCalendarNotes": {
"type": "boolean"
},
+ "lockTimeZoneToggleOnBookingPage": {
+ "type": "boolean"
+ },
"color": {
"$ref": "#/components/schemas/EventTypeColor_2024_06_14"
},
"seats": {
- "$ref": "#/components/schemas/Seats_2024_06_14"
- },
- "offsetStart": {
- "type": "number"
+ "description": "Create an event type with multiple seats.",
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/Seats_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/Disabled_2024_06_14"
+ }
+ ]
},
"customName": {
- "type": "string"
+ "type": "string",
+ "description": "Customizable event name with valid variables:\n {Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name},\n {Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION},\n {HOST/ATTENDEE}, {HOST}, {ATTENDEE}, {USER}",
+ "example": "{Event type title} between {Organiser} and {Scheduler}"
},
"destinationCalendar": {
"$ref": "#/components/schemas/DestinationCalendar_2024_06_14"
@@ -21399,12 +21440,17 @@
"hideCalendarEventDetails": {
"type": "boolean"
},
+ "successRedirectUrl": {
+ "type": "string",
+ "description": "A valid URL where the booker will redirect to, once the booking is completed successfully",
+ "example": "https://masterchief.com/argentina/flan/video/9129412"
+ },
"hideOrganizerEmail": {
"type": "boolean",
"description": "Boolean to Hide organizer's email address from the booking screen, email notifications, and calendar events"
},
"calVideoSettings": {
- "description": "Cal video settings for the event type",
+ "description": "Cal video settings for the event type. Platform customers can't manage this property because currently we have no way of determining if managed user is a host or an attendee.",
"allOf": [
{
"$ref": "#/components/schemas/CalVideoSettings"
@@ -21416,38 +21462,60 @@
},
"bookingRequiresAuthentication": {
"type": "boolean",
+ "default": false,
"description": "Boolean to require authentication for booking this event type via api. If true, only authenticated users who are the event-type owner or org/team admin/owner can book this event type."
},
- "teamId": {
- "type": "number"
- },
- "ownerId": {
- "type": "object",
- "nullable": true
- },
- "parentEventTypeId": {
- "type": "object",
- "description": "For managed event types, parent event type is the event type that this event type is based on",
- "nullable": true
+ "schedulingType": {
+ "type": "string",
+ "enum": ["collective", "roundRobin", "managed"],
+ "example": "collective",
+ "description": "The scheduling type for the team event - collective, roundRobin or managed."
},
"hosts": {
+ "description": "Hosts contain specific team members you want to assign to this event type, but if you want to assign all team members, use `assignAllTeamMembers: true` instead and omit this field. For platform customers the hosts can include userIds only of managed users. Provide either hosts or assignAllTeamMembers but not both",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/components/schemas/Host"
}
},
"assignAllTeamMembers": {
- "type": "boolean"
- },
- "schedulingType": {
- "type": "string",
- "enum": ["roundRobin", "collective", "managed"]
+ "type": "boolean",
+ "description": "If true, all current and future team members will be assigned to this event type. Provide either assignAllTeamMembers or hosts but not both"
},
- "team": {
- "$ref": "#/components/schemas/EventTypeTeam"
+ "locations": {
+ "type": "array",
+ "description": "Locations where the event will take place. If not provided, cal video link will be used as the location.",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/InputAddressLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputLinkLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputIntegrationLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputPhoneLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputAttendeeAddressLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputAttendeePhoneLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputAttendeeDefinedLocation_2024_06_14"
+ },
+ {
+ "$ref": "#/components/schemas/InputOrganizersDefaultApp_2024_06_14"
+ }
+ ]
+ }
},
"emailSettings": {
- "description": "Email settings for this event type. Only available for organization team event types.",
+ "description": "Email settings for this event type - only available for organization team event types.",
"allOf": [
{
"$ref": "#/components/schemas/EmailSettings_2024_06_14"
@@ -21459,31 +21527,7 @@
"description": "Rescheduled events will be assigned to the same host as initially scheduled."
}
},
- "required": [
- "id",
- "lengthInMinutes",
- "title",
- "slug",
- "description",
- "locations",
- "bookingFields",
- "disableGuests",
- "recurrence",
- "metadata",
- "price",
- "currency",
- "lockTimeZoneToggleOnBookingPage",
- "forwardParamsSuccessRedirect",
- "successRedirectUrl",
- "isInstantEvent",
- "scheduleId",
- "hidden",
- "bookingRequiresAuthentication",
- "teamId",
- "hosts",
- "schedulingType",
- "team"
- ]
+ "required": ["lengthInMinutes", "title", "slug", "schedulingType"]
},
"CreateTeamEventTypeOutput": {
"type": "object",
@@ -24945,48 +24989,6 @@
},
"required": ["status", "data"]
},
- "StripConnectOutputDto": {
- "type": "object",
- "properties": {
- "authUrl": {
- "type": "string"
- }
- },
- "required": ["authUrl"]
- },
- "StripConnectOutputResponseDto": {
- "type": "object",
- "properties": {
- "status": {
- "type": "string",
- "example": "success",
- "enum": ["success", "error"]
- },
- "data": {
- "$ref": "#/components/schemas/StripConnectOutputDto"
- }
- },
- "required": ["status", "data"]
- },
- "StripCredentialsSaveOutputResponseDto": {
- "type": "object",
- "properties": {
- "url": {
- "type": "string"
- }
- },
- "required": ["url"]
- },
- "StripCredentialsCheckOutputResponseDto": {
- "type": "object",
- "properties": {
- "status": {
- "type": "object",
- "example": "success"
- }
- },
- "required": ["status"]
- },
"GetDefaultScheduleOutput_2024_06_11": {
"type": "object",
"properties": {