Scheduling infrastructure for absolutely everyone.
feat: verified resources endpoint [v2] (#21006)
Morgan0f0c2b8b9257
diff --git a/apps/api/v2/package.json b/apps/api/v2/package.jsonindex 6a004e5e4f0..c3b945ede58 100644--- a/apps/api/v2/package.json+++ b/apps/api/v2/package.json@@ -38,7 +38,7 @@"@axiomhq/winston": "^1.2.0","@calcom/platform-constants": "*","@calcom/platform-enums": "*",- "@calcom/platform-libraries": "npm:@calcom/[email protected]",+ "@calcom/platform-libraries": "npm:@calcom/[email protected]","@calcom/platform-libraries-0.0.2": "npm:@calcom/[email protected]","@calcom/platform-types": "*","@calcom/platform-utils": "*",diff --git a/apps/api/v2/src/lib/endpoint-throttler-decorator.ts b/apps/api/v2/src/lib/endpoint-throttler-decorator.tsnew file mode 100644index 00000000000..02e3b1b4a22--- /dev/null+++ b/apps/api/v2/src/lib/endpoint-throttler-decorator.ts@@ -0,0 +1,4 @@+import { RateLimitType } from "@/lib/throttler-guard";+import { Reflector } from "@nestjs/core";++export const Throttle = Reflector.createDecorator<RateLimitType>();diff --git a/apps/api/v2/src/lib/throttler-guard.ts b/apps/api/v2/src/lib/throttler-guard.tsindex 66aad5cf3bf..8f810f84908 100644--- a/apps/api/v2/src/lib/throttler-guard.ts+++ b/apps/api/v2/src/lib/throttler-guard.ts@@ -1,5 +1,6 @@import { getEnv } from "@/env";import { hashAPIKey, isApiKey, stripApiKey } from "@/lib/api-key";+import { Throttle } from "@/lib/endpoint-throttler-decorator";import { PrismaReadService } from "@/modules/prisma/prisma-read.service";import { ThrottlerStorageRedisService } from "@nest-lab/throttler-storage-redis";import { Inject, Injectable, Logger, UnauthorizedException } from "@nestjs/common";@@ -22,7 +23,7 @@ const rateLimitSchema = z.object({ttl: z.number(),blockDuration: z.number(),});-type RateLimitType = z.infer<typeof rateLimitSchema>;+export type RateLimitType = z.infer<typeof rateLimitSchema>;const rateLimitsSchema = z.array(rateLimitSchema);const sixtySecondsMs = 60 * 1000;@@ -52,7 +53,7 @@ export class CustomThrottlerGuard extends ThrottlerGuard {protected async handleRequest(requestProps: ThrottlerRequest): Promise<boolean> {const { context } = requestProps;-+ const throttleOptions = this.reflector.get(Throttle, context.getHandler());const request = context.switchToHttp().getRequest<Request>();const IP = request?.headers?.["cf-connecting-ip"] ?? request?.headers?.["CF-Connecting-IP"] ?? request.ip;const response = context.switchToHttp().getResponse<Response>();@@ -63,6 +64,10 @@ export class CustomThrottlerGuard extends ThrottlerGuard {)}", OAuth client ID "${request.get(X_CAL_CLIENT_ID)}" and IP "${IP}"`);+ if (throttleOptions) {+ return this.handleApiEndpointThrottle(tracker, throttleOptions, response);+ }+if (tracker.startsWith("api_key_")) {return this.handleApiKeyRequest(tracker, response);} else {@@ -70,6 +75,15 @@ export class CustomThrottlerGuard extends ThrottlerGuard {}}+ private async handleApiEndpointThrottle(tracker: string, options: RateLimitType, response: Response) {+ const { isBlocked } = await this.incrementRateLimit(`${tracker}_${options.name}`, options, response);+ if (isBlocked) {+ throw new ThrottlerException("CustomThrottlerGuard - Too many requests. Please try again later.");+ }++ return true;+ }+private async handleApiKeyRequest(tracker: string, response: Response): Promise<boolean> {const rateLimits = await this.getRateLimitsForApiKeyTracker(tracker);diff --git a/apps/api/v2/src/modules/endpoints.module.ts b/apps/api/v2/src/modules/endpoints.module.tsindex b7d0a6a67b3..6febe08de05 100644--- a/apps/api/v2/src/modules/endpoints.module.ts+++ b/apps/api/v2/src/modules/endpoints.module.ts@@ -11,6 +11,7 @@ import { OrganizationsUsersBookingsModule } from "@/modules/organizations/users/import { RouterModule } from "@/modules/router/router.module";import { StripeModule } from "@/modules/stripe/stripe.module";import { TimezoneModule } from "@/modules/timezones/timezones.module";+import { VerifiedResourcesModule } from "@/modules/verified-resources/verified-resources.module";import type { MiddlewareConsumer, NestModule } from "@nestjs/common";import { Module } from "@nestjs/common";@@ -33,6 +34,7 @@ import { WebhooksModule } from "./webhooks/webhooks.module";OrganizationsUsersBookingsModule,OrganizationsBookingsModule,OrganizationsRoutingFormsModule,+ VerifiedResourcesModule,RouterModule,],})diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.tsindex efd3817a8ea..22ed0bd9cd2 100644--- a/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.ts+++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.ts@@ -6,6 +6,7 @@ import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard";import { PlatformPlanGuard } from "@/modules/auth/guards/billing/platform-plan.guard";import { IsAdminAPIEnabledGuard } from "@/modules/auth/guards/organizations/is-admin-api-enabled.guard";import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard";+import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard";import { IsRoutingFormInTeam } from "@/modules/auth/guards/routing-forms/is-routing-form-in-team.guard";import { IsTeamInOrg } from "@/modules/auth/guards/teams/is-team-in-org.guard";import { GetRoutingFormResponsesParams } from "@/modules/organizations/routing-forms/inputs/get-routing-form-responses-params.input";@@ -29,6 +30,7 @@ import { SUCCESS_STATUS } from "@calcom/platform-constants";IsTeamInOrg,IsRoutingFormInTeam,PlatformPlanGuard,+ RolesGuard,IsAdminAPIEnabledGuard)@ApiHeader(API_KEY_HEADER)diff --git a/apps/api/v2/src/modules/organizations/teams/verified-resources/org-teams-verified-resources.controller.e2e-spec.ts b/apps/api/v2/src/modules/organizations/teams/verified-resources/org-teams-verified-resources.controller.e2e-spec.tsnew file mode 100644index 00000000000..81729cb5e39--- /dev/null+++ b/apps/api/v2/src/modules/organizations/teams/verified-resources/org-teams-verified-resources.controller.e2e-spec.ts@@ -0,0 +1,236 @@+import { bootstrap } from "@/app";+import { AppModule } from "@/app.module";+import { PrismaModule } from "@/modules/prisma/prisma.module";+import { TokensModule } from "@/modules/tokens/tokens.module";+import { UsersModule } from "@/modules/users/users.module";+import { RequestEmailVerificationInput } from "@/modules/verified-resources/inputs/request-email-verification.input";+import { VerifyEmailInput } from "@/modules/verified-resources/inputs/verify-email.input";+import {+ TeamVerifiedEmailOutput,+ TeamVerifiedEmailsOutput,+} from "@/modules/verified-resources/outputs/verified-email.output";+import {+ TeamVerifiedPhoneOutput,+ TeamVerifiedPhonesOutput,+} from "@/modules/verified-resources/outputs/verified-phone.output";+import { INestApplication } from "@nestjs/common";+import { NestExpressApplication } from "@nestjs/platform-express";+import { Test } from "@nestjs/testing";+import { TOTP as TOTPtoMock } from "@otplib/core";+import { User } from "@prisma/client";+import { totp } from "otplib";+import * as request from "supertest";+import { ApiKeysRepositoryFixture } from "test/fixtures/repository/api-keys.repository.fixture";+import { MembershipRepositoryFixture } from "test/fixtures/repository/membership.repository.fixture";+import { OrganizationRepositoryFixture } from "test/fixtures/repository/organization.repository.fixture";+import { ProfileRepositoryFixture } from "test/fixtures/repository/profiles.repository.fixture";+import { TeamRepositoryFixture } from "test/fixtures/repository/team.repository.fixture";+import { UserRepositoryFixture } from "test/fixtures/repository/users.repository.fixture";+import { VerifiedResourcesRepositoryFixtures } from "test/fixtures/repository/verified-resources.repository.fixture";+import { randomString } from "test/utils/randomString";++import { AttendeeVerifyEmail } from "@calcom/platform-libraries/emails";+import { Team } from "@calcom/prisma/client";++jest.spyOn(totp, "generate").mockImplementation(function () {+ return "1234";+});++jest.spyOn(TOTPtoMock.prototype, "check").mockImplementation(function () {+ return true;+});++jest+ .spyOn(AttendeeVerifyEmail.prototype as any, "getNodeMailerPayload")+ .mockImplementation(async function () {+ return {+ to: `[email protected]`,+ from: `[email protected]`,+ subject: "No Subject",+ html: "<html><body>Mocked Email Content</body></html>",+ text: "body",+ };+ });++describe("Organizations Teams Verified Resources", () => {+ let app: INestApplication;++ let userRepositoryFixture: UserRepositoryFixture;+ let organizationsRepositoryFixture: OrganizationRepositoryFixture;+ let verifiedResourcesRepositoryFixtures: VerifiedResourcesRepositoryFixtures;+ let teamsRepositoryFixture: TeamRepositoryFixture;+ let profileRepositoryFixture: ProfileRepositoryFixture;+ let apiKeysRepositoryFixture: ApiKeysRepositoryFixture;+ let membershipsRepositoryFixture: MembershipRepositoryFixture;++ let org: Team;+ let orgTeam: Team;+ const emailToVerify = `org-team-e2e-verified-resources-${randomString()}@example.com`;+ const phoneToVerify = "+37255556666";+ const authEmail = `organizations-verified-resources-responses-user-${randomString()}@api.com`;+ let user: User;+ let apiKeyString: string;+ let verifiedEmailId: number;+ let verifiedPhoneId: number;++ beforeAll(async () => {+ const moduleRef = await Test.createTestingModule({+ imports: [AppModule, PrismaModule, UsersModule, TokensModule],+ }).compile();++ verifiedResourcesRepositoryFixtures = new VerifiedResourcesRepositoryFixtures(moduleRef);+ userRepositoryFixture = new UserRepositoryFixture(moduleRef);+ organizationsRepositoryFixture = new OrganizationRepositoryFixture(moduleRef);+ teamsRepositoryFixture = new TeamRepositoryFixture(moduleRef);+ profileRepositoryFixture = new ProfileRepositoryFixture(moduleRef);+ apiKeysRepositoryFixture = new ApiKeysRepositoryFixture(moduleRef);+ membershipsRepositoryFixture = new MembershipRepositoryFixture(moduleRef);++ org = await organizationsRepositoryFixture.create({+ name: `organizations-verified-resources-responses-organization-${randomString()}`,+ isOrganization: true,+ });++ user = await userRepositoryFixture.create({+ email: authEmail,+ username: authEmail,+ });++ const { keyString } = await apiKeysRepositoryFixture.createApiKey(user.id, null);+ apiKeyString = keyString;++ orgTeam = await teamsRepositoryFixture.create({+ name: `organizations-verified-resources-responses-team-${randomString()}`,+ isOrganization: false,+ parent: { connect: { id: org.id } },+ });++ await membershipsRepositoryFixture.create({+ role: "ADMIN",+ user: { connect: { id: user.id } },+ team: { connect: { id: org.id } },+ });++ await membershipsRepositoryFixture.create({+ role: "ADMIN",+ user: { connect: { id: user.id } },+ team: { connect: { id: orgTeam.id } },+ });++ await profileRepositoryFixture.create({+ uid: `usr-${user.id}`,+ username: authEmail,+ organization: {+ connect: {+ id: org.id,+ },+ },+ user: {+ connect: {+ id: user.id,+ },+ },+ });++ verifiedPhoneId = (+ await verifiedResourcesRepositoryFixtures.createPhone({+ phoneNumber: phoneToVerify,+ user: { connect: { id: user.id } },+ team: {+ connect: {+ id: orgTeam.id,+ },+ },+ })+ ).id;++ app = moduleRef.createNestApplication();+ bootstrap(app as NestExpressApplication);++ await app.init();+ });++ it("should trigger email verification code", async () => {+ return request(app.getHttpServer())+ .post(+ `/v2/organizations/${org.id}/teams/${orgTeam.id}/verified-resources/emails/verification-code/request`+ )+ .send({ email: emailToVerify } satisfies RequestEmailVerificationInput)+ .set({ Authorization: `Bearer cal_test_${apiKeyString}` })+ .expect(200);+ });++ it("should verify email", async () => {+ return request(app.getHttpServer())+ .post(+ `/v2/organizations/${org.id}/teams/${orgTeam.id}/verified-resources/emails/verification-code/verify`+ )+ .send({ email: emailToVerify, code: "1234" } satisfies VerifyEmailInput)+ .set({ Authorization: `Bearer cal_test_${apiKeyString}` })+ .expect(200)+ .then((res) => {+ const response = res.body as TeamVerifiedEmailOutput;+ verifiedEmailId = response.data.id;+ expect(response.data.email).toEqual(emailToVerify);+ expect(response.data.teamId).toEqual(orgTeam.id);+ });+ });++ it("should fetch verified email by id", async () => {+ return request(app.getHttpServer())+ .get(`/v2/organizations/${org.id}/teams/${orgTeam.id}/verified-resources/emails/${verifiedEmailId}`)+ .set({ Authorization: `Bearer cal_test_${apiKeyString}` })+ .expect(200)+ .then((res) => {+ const response = res.body as TeamVerifiedEmailOutput;+ expect(response.data.email).toEqual(emailToVerify);+ expect(response.data.teamId).toEqual(orgTeam.id);+ });+ });++ it("should fetch verified number by id", async () => {+ return request(app.getHttpServer())+ .get(`/v2/organizations/${org.id}/teams/${orgTeam.id}/verified-resources/phones/${verifiedPhoneId}`)+ .set({ Authorization: `Bearer cal_test_${apiKeyString}` })+ .expect(200)+ .then((res) => {+ const response = res.body as TeamVerifiedPhoneOutput;+ expect(response.data.phoneNumber).toEqual(phoneToVerify);+ expect(response.data.teamId).toEqual(orgTeam.id);+ });+ });++ it("should fetch verified emails", async () => {+ return request(app.getHttpServer())+ .get(`/v2/organizations/${org.id}/teams/${orgTeam.id}/verified-resources/emails`)+ .set({ Authorization: `Bearer cal_test_${apiKeyString}` })+ .expect(200)+ .then((res) => {+ const response = res.body as TeamVerifiedEmailsOutput;+ expect(response.data.find((verifiedEmail) => verifiedEmail.email === emailToVerify)).toBeDefined();+ expect(response.data.find((verifiedEmail) => verifiedEmail.teamId === orgTeam.id)).toBeDefined();+ });+ });++ it("should fetch verified phones", async () => {+ return request(app.getHttpServer())+ .get(`/v2/organizations/${org.id}/teams/${orgTeam.id}/verified-resources/phones`)+ .set({ Authorization: `Bearer cal_test_${apiKeyString}` })+ .expect(200)+ .then((res) => {+ const response = res.body as TeamVerifiedPhonesOutput;+ expect(+ response.data.find((verifiedPhone) => verifiedPhone.phoneNumber === phoneToVerify)+ ).toBeDefined();+ expect(response.data.find((verifiedPhone) => verifiedPhone.teamId === orgTeam.id)).toBeDefined();+ });+ });++ afterAll(async () => {+ await verifiedResourcesRepositoryFixtures.deleteEmailById(verifiedEmailId);+ await verifiedResourcesRepositoryFixtures.deletePhoneById(verifiedPhoneId);+ await userRepositoryFixture.deleteByEmail(user.email);+ await organizationsRepositoryFixture.delete(org.id);+ await app.close();+ });+});diff --git a/apps/api/v2/src/modules/organizations/teams/verified-resources/org-teams-verified-resources.controller.ts b/apps/api/v2/src/modules/organizations/teams/verified-resources/org-teams-verified-resources.controller.tsnew file mode 100644index 00000000000..b3ee9f18fa1--- /dev/null+++ b/apps/api/v2/src/modules/organizations/teams/verified-resources/org-teams-verified-resources.controller.ts@@ -0,0 +1,256 @@+import { API_KEY_OR_ACCESS_TOKEN_HEADER } from "@/lib/docs/headers";+import { Throttle } from "@/lib/endpoint-throttler-decorator";+import { PlatformPlan } from "@/modules/auth/decorators/billing/platform-plan.decorator";+import { GetUser } from "@/modules/auth/decorators/get-user/get-user.decorator";+import { Roles } from "@/modules/auth/decorators/roles/roles.decorator";+import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard";+import { PlatformPlanGuard } from "@/modules/auth/guards/billing/platform-plan.guard";+import { IsAdminAPIEnabledGuard } from "@/modules/auth/guards/organizations/is-admin-api-enabled.guard";+import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard";+import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard";+import { IsTeamInOrg } from "@/modules/auth/guards/teams/is-team-in-org.guard";+import { RequestEmailVerificationInput } from "@/modules/verified-resources/inputs/request-email-verification.input";+import { RequestPhoneVerificationInput } from "@/modules/verified-resources/inputs/request-phone-verification.input";+import { VerifyEmailInput } from "@/modules/verified-resources/inputs/verify-email.input";+import { VerifyPhoneInput } from "@/modules/verified-resources/inputs/verify-phone.input";+import { RequestEmailVerificationOutput } from "@/modules/verified-resources/outputs/request-email-verification-output";+import { RequestPhoneVerificationOutput } from "@/modules/verified-resources/outputs/request-phone-verification-output";+import {+ TeamVerifiedEmailOutput,+ TeamVerifiedEmailOutputData,+ TeamVerifiedEmailsOutput,+} from "@/modules/verified-resources/outputs/verified-email.output";+import {+ TeamVerifiedPhoneOutput,+ TeamVerifiedPhoneOutputData,+ TeamVerifiedPhonesOutput,+} from "@/modules/verified-resources/outputs/verified-phone.output";+import { VerifiedResourcesService } from "@/modules/verified-resources/services/verified-resources.service";+import {+ Body,+ Controller,+ Get,+ HttpCode,+ HttpStatus,+ Param,+ ParseIntPipe,+ Post,+ Query,+ UseGuards,+} from "@nestjs/common";+import { ApiHeader, ApiOperation, ApiTags } from "@nestjs/swagger";+import { plainToClass } from "class-transformer";++import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";+import { SkipTakePagination } from "@calcom/platform-types";++@Controller({+ path: "/v2/organizations/:orgId/teams/:teamId/verified-resources",+})+@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, IsTeamInOrg, PlatformPlanGuard, IsAdminAPIEnabledGuard)+@ApiTags("Organization Team Verified Resources")+export class OrgTeamsVerifiedResourcesController {+ constructor(private readonly verifiedResourcesService: VerifiedResourcesService) {}+ @ApiOperation({+ summary: "Request Email Verification Code",+ description: `Sends a verification code to the email.`,+ })+ @Roles("TEAM_ADMIN")+ @Throttle({+ limit: 3,+ ttl: 60000,+ blockDuration: 60000,+ name: "org_teams_verified_resources_emails_requests",+ })+ @PlatformPlan("ESSENTIALS")+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Post("/emails/verification-code/request")+ @HttpCode(HttpStatus.OK)+ async requestEmailVerificationCode(+ @Body() body: RequestEmailVerificationInput,+ @GetUser("username") username: string,+ @GetUser("locale") locale: string+ ): Promise<RequestEmailVerificationOutput> {+ const verificationCodeRequest = await this.verifiedResourcesService.requestEmailVerificationCode(+ { username, locale },+ body.email+ );++ return {+ status: verificationCodeRequest ? SUCCESS_STATUS : ERROR_STATUS,+ };+ }++ @ApiOperation({+ summary: "Request Phone Number Verification Code",+ description: `Sends a verification code to the phone number.`,+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @Throttle({+ limit: 3,+ ttl: 60000,+ blockDuration: 60000,+ name: "org_teams_verified_resources_phones_requests",+ })+ @Post("/phones/verification-code/request")+ @HttpCode(HttpStatus.OK)+ async requestPhoneVerificationCode(+ @Body() body: RequestPhoneVerificationInput+ ): Promise<RequestPhoneVerificationOutput> {+ const verificationCodeRequest = await this.verifiedResourcesService.requestPhoneVerificationCode(+ body.phone+ );++ return {+ status: verificationCodeRequest ? SUCCESS_STATUS : ERROR_STATUS,+ };+ }++ @ApiOperation({+ summary: "Verify an email for an org team.",+ description: `Use code to verify an email`,+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @PlatformPlan("ESSENTIALS")+ @Post("/emails/verification-code/verify")+ @HttpCode(HttpStatus.OK)+ async verifyEmail(+ @Body() body: VerifyEmailInput,+ @GetUser("id") userId: number,+ @Param("teamId", ParseIntPipe) teamId: number+ ): Promise<TeamVerifiedEmailOutput> {+ const verifiedEmail = await this.verifiedResourcesService.verifyEmail(+ userId,+ body.email,+ body.code,+ teamId+ );+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(TeamVerifiedEmailOutputData, verifiedEmail),+ };+ }++ @ApiOperation({+ summary: "Verify a phone number for an org team.",+ description: `Use code to verify a phone number`,+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @PlatformPlan("ESSENTIALS")+ @Post("/phones/verification-code/verify")+ @Throttle({+ limit: 3,+ ttl: 60000,+ blockDuration: 60000,+ name: "org_teams_verified_resources_phones_verify",+ })+ @HttpCode(HttpStatus.OK)+ async verifyPhoneNumber(+ @Body() body: VerifyPhoneInput,+ @GetUser("id") userId: number,+ @Param("teamId", ParseIntPipe) teamId: number+ ): Promise<TeamVerifiedPhoneOutput> {+ const verifiedPhone = await this.verifiedResourcesService.verifyPhone(+ userId,+ body.phone,+ body.code,+ teamId+ );+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(TeamVerifiedPhoneOutputData, verifiedPhone),+ };+ }++ @ApiOperation({+ summary: "Get list of verified emails of an org team.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @PlatformPlan("ESSENTIALS")+ @Get("/emails")+ @HttpCode(HttpStatus.OK)+ async getVerifiedEmails(+ @Param("teamId", ParseIntPipe) teamId: number,+ @Query() pagination: SkipTakePagination+ ): Promise<TeamVerifiedEmailsOutput> {+ const verifiedEmails = await this.verifiedResourcesService.getTeamVerifiedEmails(+ teamId,+ pagination?.skip ?? 0,+ pagination?.take ?? 250+ );+ return {+ status: SUCCESS_STATUS,+ data: verifiedEmails.map((verifiedEmail) => plainToClass(TeamVerifiedEmailOutputData, verifiedEmail)),+ };+ }++ @ApiOperation({+ summary: "Get list of verified phone numbers of an org team.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @PlatformPlan("ESSENTIALS")+ @Get("/phones")+ @Roles("TEAM_ADMIN")+ @HttpCode(HttpStatus.OK)+ async getVerifiedPhoneNumbers(+ @Param("teamId", ParseIntPipe) teamId: number,+ @Query() pagination: SkipTakePagination+ ): Promise<TeamVerifiedPhonesOutput> {+ const verifiedPhoneNumbers = await this.verifiedResourcesService.getTeamVerifiedPhoneNumbers(+ teamId,+ pagination?.skip ?? 0,+ pagination?.take ?? 250+ );+ return {+ status: SUCCESS_STATUS,+ data: verifiedPhoneNumbers.map((verifiedPhoneNumber) =>+ plainToClass(TeamVerifiedPhoneOutputData, verifiedPhoneNumber)+ ),+ };+ }++ @ApiOperation({+ summary: "Get verified email of an org team by id.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @PlatformPlan("ESSENTIALS")+ @Get("/emails/:id")+ @HttpCode(HttpStatus.OK)+ async getVerifiedEmailById(+ @Param("id") id: number,+ @Param("teamId", ParseIntPipe) teamId: number+ ): Promise<TeamVerifiedEmailOutput> {+ const verifiedEmail = await this.verifiedResourcesService.getTeamVerifiedEmailById(teamId, id);+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(TeamVerifiedEmailOutputData, verifiedEmail),+ };+ }++ @ApiOperation({+ summary: "Get verified phone number of an org team by id.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @PlatformPlan("ESSENTIALS")+ @Get("/phones/:id")+ @HttpCode(HttpStatus.OK)+ async getVerifiedPhoneById(+ @Param("teamId", ParseIntPipe) teamId: number,+ @Param("id") id: number+ ): Promise<TeamVerifiedPhoneOutput> {+ const verifiedPhoneNumber = await this.verifiedResourcesService.getTeamVerifiedPhoneNumberById(+ teamId,+ id+ );+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(TeamVerifiedPhoneOutputData, verifiedPhoneNumber),+ };+ }+}diff --git a/apps/api/v2/src/modules/teams/verified-resources/teams-verified-resources.controller.ts b/apps/api/v2/src/modules/teams/verified-resources/teams-verified-resources.controller.tsnew file mode 100644index 00000000000..a3b16c2e9f9--- /dev/null+++ b/apps/api/v2/src/modules/teams/verified-resources/teams-verified-resources.controller.ts@@ -0,0 +1,229 @@+import { API_KEY_OR_ACCESS_TOKEN_HEADER } from "@/lib/docs/headers";+import { Throttle } from "@/lib/endpoint-throttler-decorator";+import { GetUser } from "@/modules/auth/decorators/get-user/get-user.decorator";+import { Roles } from "@/modules/auth/decorators/roles/roles.decorator";+import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard";+import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard";+import { RequestEmailVerificationInput } from "@/modules/verified-resources/inputs/request-email-verification.input";+import { RequestPhoneVerificationInput } from "@/modules/verified-resources/inputs/request-phone-verification.input";+import { VerifyEmailInput } from "@/modules/verified-resources/inputs/verify-email.input";+import { VerifyPhoneInput } from "@/modules/verified-resources/inputs/verify-phone.input";+import { RequestEmailVerificationOutput } from "@/modules/verified-resources/outputs/request-email-verification-output";+import { RequestPhoneVerificationOutput } from "@/modules/verified-resources/outputs/request-phone-verification-output";+import {+ TeamVerifiedEmailOutput,+ TeamVerifiedEmailOutputData,+ TeamVerifiedEmailsOutput,+} from "@/modules/verified-resources/outputs/verified-email.output";+import {+ TeamVerifiedPhoneOutput,+ TeamVerifiedPhoneOutputData,+ TeamVerifiedPhonesOutput,+} from "@/modules/verified-resources/outputs/verified-phone.output";+import { VerifiedResourcesService } from "@/modules/verified-resources/services/verified-resources.service";+import {+ Body,+ Controller,+ Get,+ HttpCode,+ HttpStatus,+ Param,+ ParseIntPipe,+ Post,+ Query,+ UseGuards,+} from "@nestjs/common";+import { ApiHeader, ApiOperation, ApiTags } from "@nestjs/swagger";+import { plainToClass } from "class-transformer";++import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";+import { SkipTakePagination } from "@calcom/platform-types";++@Controller({+ path: "/v2/teams/:teamId/verified-resources",+})+@UseGuards(ApiAuthGuard, RolesGuard)+@ApiTags("Teams Verified Resources")+export class TeamsVerifiedResourcesController {+ constructor(private readonly verifiedResourcesService: VerifiedResourcesService) {}+ @ApiOperation({+ summary: "Request Email Verification Code",+ description: `Sends a verification code to the Email.`,+ })+ @Roles("TEAM_ADMIN")+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Post("/emails/verification-code/request")+ @Throttle({ limit: 5, ttl: 60000, blockDuration: 60000, name: "teams_verified_resources_emails_requests" })+ @HttpCode(HttpStatus.OK)+ async requestEmailVerificationCode(+ @Body() body: RequestEmailVerificationInput,+ @GetUser("username") username: string,+ @GetUser("locale") locale: string+ ): Promise<RequestEmailVerificationOutput> {+ const verificationCodeRequest = await this.verifiedResourcesService.requestEmailVerificationCode(+ { username, locale },+ body.email+ );++ return {+ status: verificationCodeRequest ? SUCCESS_STATUS : ERROR_STATUS,+ };+ }++ @ApiOperation({+ summary: "Request Phone Number Verification Code",+ description: `Sends a verification code to the phone number.`,+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @Post("/phones/verification-code/request")+ @Throttle({ limit: 3, ttl: 60000, blockDuration: 60000, name: "teams_verified_resources_phones_requests" })+ @HttpCode(HttpStatus.OK)+ async requestPhoneVerificationCode(+ @Body() body: RequestPhoneVerificationInput+ ): Promise<RequestPhoneVerificationOutput> {+ const verificationCodeRequest = await this.verifiedResourcesService.requestPhoneVerificationCode(+ body.phone+ );++ return {+ status: verificationCodeRequest ? SUCCESS_STATUS : ERROR_STATUS,+ };+ }++ @ApiOperation({+ summary: "Verify an email for a team.",+ description: `Use code to verify an email`,+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @Post("/emails/verification-code/verify")+ @HttpCode(HttpStatus.OK)+ async verifyEmail(+ @Body() body: VerifyEmailInput,+ @GetUser("id") userId: number,+ @Param("teamId", ParseIntPipe) teamId: number+ ): Promise<TeamVerifiedEmailOutput> {+ const verifiedEmail = await this.verifiedResourcesService.verifyEmail(+ userId,+ body.email,+ body.code,+ teamId+ );+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(TeamVerifiedEmailOutputData, verifiedEmail),+ };+ }++ @ApiOperation({+ summary: "Verify a phone number for an org team.",+ description: `Use code to verify a phone number`,+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @Post("/phones/verification-code/verify")+ @Throttle({ limit: 3, ttl: 60000, blockDuration: 60000, name: "teams_verified_resources_phones_verify" })+ @HttpCode(HttpStatus.OK)+ async verifyPhoneNumber(+ @Body() body: VerifyPhoneInput,+ @GetUser("id") userId: number,+ @Param("teamId", ParseIntPipe) teamId: number+ ): Promise<TeamVerifiedPhoneOutput> {+ const verifiedPhone = await this.verifiedResourcesService.verifyPhone(+ userId,+ body.phone,+ body.code,+ teamId+ );+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(TeamVerifiedPhoneOutputData, verifiedPhone),+ };+ }++ @ApiOperation({+ summary: "Get list of verified emails of a team.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @Get("/emails")+ @HttpCode(HttpStatus.OK)+ async getVerifiedEmails(+ @Param("teamId", ParseIntPipe) teamId: number,+ @Query() pagination: SkipTakePagination+ ): Promise<TeamVerifiedEmailsOutput> {+ const verifiedEmails = await this.verifiedResourcesService.getTeamVerifiedEmails(+ teamId,+ pagination?.skip ?? 0,+ pagination?.take ?? 250+ );+ return {+ status: SUCCESS_STATUS,+ data: verifiedEmails.map((verifiedEmail) => plainToClass(TeamVerifiedEmailOutputData, verifiedEmail)),+ };+ }++ @ApiOperation({+ summary: "Get list of verified phone numbers of a team.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Get("/phones")+ @Roles("TEAM_ADMIN")+ @HttpCode(HttpStatus.OK)+ async getVerifiedPhoneNumbers(+ @Param("teamId", ParseIntPipe) teamId: number,+ @Query() pagination: SkipTakePagination+ ): Promise<TeamVerifiedPhonesOutput> {+ const verifiedPhoneNumbers = await this.verifiedResourcesService.getTeamVerifiedPhoneNumbers(+ teamId,+ pagination?.skip ?? 0,+ pagination?.take ?? 250+ );+ return {+ status: SUCCESS_STATUS,+ data: verifiedPhoneNumbers.map((verifiedPhoneNumber) =>+ plainToClass(TeamVerifiedPhoneOutputData, verifiedPhoneNumber)+ ),+ };+ }++ @ApiOperation({+ summary: "Get verified email of a team by id.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @Get("/emails/:id")+ @HttpCode(HttpStatus.OK)+ async getVerifiedEmailById(+ @Param("id") id: number,+ @Param("teamId", ParseIntPipe) teamId: number+ ): Promise<TeamVerifiedEmailOutput> {+ const verifiedEmail = await this.verifiedResourcesService.getTeamVerifiedEmailById(teamId, id);+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(TeamVerifiedEmailOutputData, verifiedEmail),+ };+ }++ @ApiOperation({+ summary: "Get verified phone number of a team by id.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Roles("TEAM_ADMIN")+ @Get("/phones/:id")+ @HttpCode(HttpStatus.OK)+ async getVerifiedPhoneById(+ @Param("teamId", ParseIntPipe) teamId: number,+ @Param("id") id: number+ ): Promise<TeamVerifiedPhoneOutput> {+ const verifiedPhoneNumber = await this.verifiedResourcesService.getTeamVerifiedPhoneNumberById(+ teamId,+ id+ );+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(TeamVerifiedPhoneOutputData, verifiedPhoneNumber),+ };+ }+}diff --git a/apps/api/v2/src/modules/verified-resources/controllers/users-verified-resources.controller.ts b/apps/api/v2/src/modules/verified-resources/controllers/users-verified-resources.controller.tsnew file mode 100644index 00000000000..25dac497b4d--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/controllers/users-verified-resources.controller.ts@@ -0,0 +1,196 @@+import { API_KEY_OR_ACCESS_TOKEN_HEADER } from "@/lib/docs/headers";+import { Throttle } from "@/lib/endpoint-throttler-decorator";+import { GetUser } from "@/modules/auth/decorators/get-user/get-user.decorator";+import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard";+import { RequestEmailVerificationInput } from "@/modules/verified-resources/inputs/request-email-verification.input";+import { RequestPhoneVerificationInput } from "@/modules/verified-resources/inputs/request-phone-verification.input";+import { VerifyEmailInput } from "@/modules/verified-resources/inputs/verify-email.input";+import { VerifyPhoneInput } from "@/modules/verified-resources/inputs/verify-phone.input";+import { RequestEmailVerificationOutput } from "@/modules/verified-resources/outputs/request-email-verification-output";+import { RequestPhoneVerificationOutput } from "@/modules/verified-resources/outputs/request-phone-verification-output";+import {+ UserVerifiedEmailOutput,+ UserVerifiedEmailOutputData,+ UserVerifiedEmailsOutput,+} from "@/modules/verified-resources/outputs/verified-email.output";+import {+ UserVerifiedPhoneOutput,+ UserVerifiedPhoneOutputData,+ UserVerifiedPhonesOutput,+} from "@/modules/verified-resources/outputs/verified-phone.output";+import { VerifiedResourcesService } from "@/modules/verified-resources/services/verified-resources.service";+import { Body, Controller, Get, HttpCode, HttpStatus, Param, Post, Query, UseGuards } from "@nestjs/common";+import { ApiHeader, ApiOperation, ApiTags } from "@nestjs/swagger";+import { plainToClass } from "class-transformer";++import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";+import { SkipTakePagination } from "@calcom/platform-types";++@Controller({+ path: "/v2/verified-resources",+})+@UseGuards(ApiAuthGuard)+@ApiTags("Verified Resources")+export class UserVerifiedResourcesController {+ constructor(private readonly verifiedResourcesService: VerifiedResourcesService) {}+ @ApiOperation({+ summary: "Request Email Verification Code",+ description: `Sends a verification code to the email.`,+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Post("/emails/verification-code/request")+ @HttpCode(HttpStatus.OK)+ @Throttle({ limit: 5, ttl: 60000, blockDuration: 60000, name: "users_verified_resources_emails_requests" })+ async requestEmailVerificationCode(+ @Body() body: RequestEmailVerificationInput,+ @GetUser("username") username: string,+ @GetUser("locale") locale: string+ ): Promise<RequestEmailVerificationOutput> {+ const verificationCodeRequest = await this.verifiedResourcesService.requestEmailVerificationCode(+ { username, locale },+ body.email+ );++ return {+ status: verificationCodeRequest ? SUCCESS_STATUS : ERROR_STATUS,+ };+ }++ @ApiOperation({+ summary: "Request Phone Number Verification Code",+ description: `Sends a verification code to the phone number.`,+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Post("/phones/verification-code/request")+ @HttpCode(HttpStatus.OK)+ @Throttle({ limit: 3, ttl: 60000, blockDuration: 60000, name: "users_verified_resources_phones_requests" })+ async requestPhoneVerificationCode(+ @Body() body: RequestPhoneVerificationInput+ ): Promise<RequestPhoneVerificationOutput> {+ const verificationCodeRequest = await this.verifiedResourcesService.requestPhoneVerificationCode(+ body.phone+ );++ return {+ status: verificationCodeRequest ? SUCCESS_STATUS : ERROR_STATUS,+ };+ }++ @ApiOperation({+ summary: "Verify an email.",+ description: `Use code to verify an email`,+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Post("/emails/verification-code/verify")+ @Throttle({ limit: 3, ttl: 60000, blockDuration: 60000, name: "users_verified_resources_phones_verify" })+ @HttpCode(HttpStatus.OK)+ async verifyEmail(+ @Body() body: VerifyEmailInput,+ @GetUser("id") userId: number+ ): Promise<UserVerifiedEmailOutput> {+ const verifiedEmail = await this.verifiedResourcesService.verifyEmail(userId, body.email, body.code);+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(UserVerifiedEmailOutputData, verifiedEmail),+ };+ }++ @ApiOperation({+ summary: "Verify a phone number.",+ description: `Use code to verify a phone number`,+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Post("/phones/verification-code/verify")+ @HttpCode(HttpStatus.OK)+ async verifyPhoneNumber(+ @Body() body: VerifyPhoneInput,+ @GetUser("id") userId: number+ ): Promise<UserVerifiedPhoneOutput> {+ const verifiedPhone = await this.verifiedResourcesService.verifyPhone(userId, body.phone, body.code);+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(UserVerifiedPhoneOutputData, verifiedPhone),+ };+ }++ @ApiOperation({+ summary: "Get list of verified emails.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Get("/emails")+ @HttpCode(HttpStatus.OK)+ async getVerifiedEmails(+ @GetUser("id") userId: number,+ @Query() pagination: SkipTakePagination+ ): Promise<UserVerifiedEmailsOutput> {+ const verifiedEmails = await this.verifiedResourcesService.getUserVerifiedEmails(+ userId,+ pagination?.skip ?? 0,+ pagination?.take ?? 250+ );+ return {+ status: SUCCESS_STATUS,+ data: verifiedEmails.map((verifiedEmail) => plainToClass(UserVerifiedEmailOutputData, verifiedEmail)),+ };+ }++ @ApiOperation({+ summary: "Get list of verified phone numbers.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Get("/phones")+ @HttpCode(HttpStatus.OK)+ async getVerifiedPhoneNumbers(+ @GetUser("id") userId: number,+ @Query() pagination: SkipTakePagination+ ): Promise<UserVerifiedPhonesOutput> {+ const verifiedPhoneNumbers = await this.verifiedResourcesService.getUserVerifiedPhoneNumbers(+ userId,+ pagination?.skip ?? 0,+ pagination?.take ?? 250+ );+ return {+ status: SUCCESS_STATUS,+ data: verifiedPhoneNumbers.map((verifiedPhoneNumber) =>+ plainToClass(UserVerifiedPhoneOutputData, verifiedPhoneNumber)+ ),+ };+ }++ @ApiOperation({+ summary: "Get verified email by id.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Get("/emails/:id")+ @HttpCode(HttpStatus.OK)+ async getVerifiedEmailById(+ @GetUser("id") userId: number,+ @Param("id") id: number+ ): Promise<UserVerifiedEmailOutput> {+ const verifiedEmail = await this.verifiedResourcesService.getUserVerifiedEmailById(userId, id);+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(UserVerifiedEmailOutputData, verifiedEmail),+ };+ }++ @ApiOperation({+ summary: "Get verified phone number by id.",+ })+ @ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)+ @Get("/phones/:id")+ @HttpCode(HttpStatus.OK)+ async getVerifiedPhoneById(+ @GetUser("id") userId: number,+ @Param("id") id: number+ ): Promise<UserVerifiedPhoneOutput> {+ const verifiedPhoneNumber = await this.verifiedResourcesService.getUserVerifiedPhoneNumberById(+ userId,+ id+ );+ return {+ status: SUCCESS_STATUS,+ data: plainToClass(UserVerifiedPhoneOutputData, verifiedPhoneNumber),+ };+ }+}diff --git a/apps/api/v2/src/modules/verified-resources/inputs/request-email-verification.input.ts b/apps/api/v2/src/modules/verified-resources/inputs/request-email-verification.input.tsnew file mode 100644index 00000000000..70726861c61--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/inputs/request-email-verification.input.ts@@ -0,0 +1,14 @@+import { ApiProperty } from "@nestjs/swagger";+import { Expose } from "class-transformer";+import { IsEmail } from "class-validator";++export class RequestEmailVerificationInput {+ @ApiProperty({+ type: String,+ description: "Email to verify.",+ example: "[email protected]",+ })+ @IsEmail()+ @Expose()+ email!: string;+}diff --git a/apps/api/v2/src/modules/verified-resources/inputs/request-phone-verification.input.ts b/apps/api/v2/src/modules/verified-resources/inputs/request-phone-verification.input.tsnew file mode 100644index 00000000000..1ae2169b449--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/inputs/request-phone-verification.input.ts@@ -0,0 +1,14 @@+import { ApiProperty } from "@nestjs/swagger";+import { Expose } from "class-transformer";+import { IsPhoneNumber } from "class-validator";++export class RequestPhoneVerificationInput {+ @ApiProperty({+ type: String,+ description: "Phone number to verify.",+ example: "+372 5555 6666",+ })+ @IsPhoneNumber()+ @Expose()+ phone!: string;+}diff --git a/apps/api/v2/src/modules/verified-resources/inputs/verify-email.input.ts b/apps/api/v2/src/modules/verified-resources/inputs/verify-email.input.tsnew file mode 100644index 00000000000..81aa0df59d6--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/inputs/verify-email.input.ts@@ -0,0 +1,23 @@+import { ApiProperty } from "@nestjs/swagger";+import { Expose } from "class-transformer";+import { IsEmail, IsString } from "class-validator";++export class VerifyEmailInput {+ @ApiProperty({+ type: String,+ description: "Email to verify.",+ example: "[email protected]",+ })+ @IsEmail()+ @Expose()+ email!: string;++ @ApiProperty({+ type: String,+ description: "verification code sent to the email to verify",+ example: "1ABG2C",+ })+ @Expose()+ @IsString()+ code!: string;+}diff --git a/apps/api/v2/src/modules/verified-resources/inputs/verify-phone.input.ts b/apps/api/v2/src/modules/verified-resources/inputs/verify-phone.input.tsnew file mode 100644index 00000000000..2b00ea23e67--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/inputs/verify-phone.input.ts@@ -0,0 +1,23 @@+import { ApiProperty } from "@nestjs/swagger";+import { Expose } from "class-transformer";+import { IsEmail, IsPhoneNumber, IsString } from "class-validator";++export class VerifyPhoneInput {+ @ApiProperty({+ type: String,+ description: "phone number to verify.",+ example: "+37255556666",+ })+ @IsPhoneNumber()+ @Expose()+ phone!: string;++ @ApiProperty({+ type: String,+ description: "verification code sent to the phone number to verify",+ example: "1ABG2C",+ })+ @Expose()+ @IsString()+ code!: string;+}diff --git a/apps/api/v2/src/modules/verified-resources/outputs/request-email-verification-output.ts b/apps/api/v2/src/modules/verified-resources/outputs/request-email-verification-output.tsnew file mode 100644index 00000000000..7635f6db4a6--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/outputs/request-email-verification-output.ts@@ -0,0 +1,10 @@+import { ApiProperty } from "@nestjs/swagger";+import { IsEnum } from "class-validator";++import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";++export class RequestEmailVerificationOutput {+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;+}diff --git a/apps/api/v2/src/modules/verified-resources/outputs/request-phone-verification-output.ts b/apps/api/v2/src/modules/verified-resources/outputs/request-phone-verification-output.tsnew file mode 100644index 00000000000..1fbfc61928e--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/outputs/request-phone-verification-output.ts@@ -0,0 +1,10 @@+import { ApiProperty } from "@nestjs/swagger";+import { IsEnum } from "class-validator";++import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";++export class RequestPhoneVerificationOutput {+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;+}diff --git a/apps/api/v2/src/modules/verified-resources/outputs/verified-email.output.ts b/apps/api/v2/src/modules/verified-resources/outputs/verified-email.output.tsnew file mode 100644index 00000000000..a79cd5403b8--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/outputs/verified-email.output.ts@@ -0,0 +1,135 @@+import { ScheduleOutput } from "@/ee/schedules/schedules_2024_04_15/outputs/schedule.output";+import { ApiProperty } from "@nestjs/swagger";+import { Expose, Type } from "class-transformer";+import {+ IsArray,+ IsEnum,+ IsNotEmptyObject,+ IsNumber,+ IsOptional,+ IsString,+ ValidateNested,+} from "class-validator";++import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";++export class UserVerifiedEmailOutputData {+ @Expose()+ @IsNumber()+ @ApiProperty({+ description: "The unique identifier for the verified email.",+ example: 789,+ })+ id!: number;++ @Expose()+ @IsString()+ @ApiProperty({+ description: "The verified email address.",+ example: "[email protected]",+ format: "email",+ })+ email!: string;++ @Expose()+ @IsNumber()+ @ApiProperty({+ description: "The ID of the associated user, if applicable.",+ example: 45,+ })+ userId!: number;+}++export class TeamVerifiedEmailOutputData {+ @Expose()+ @IsNumber()+ @ApiProperty({+ description: "The unique identifier for the verified email.",+ example: 789,+ })+ id!: number;++ @Expose()+ @IsString()+ @ApiProperty({+ description: "The verified email address.",+ example: "[email protected]",+ format: "email",+ })+ email!: string;++ @Expose()+ @IsNumber()+ @ApiProperty({+ description: "The ID of the associated team, if applicable.",+ example: 89,+ })+ teamId!: number;++ @Expose()+ @IsNumber()+ @IsOptional()+ @ApiProperty({+ description: "The ID of the associated user, if applicable.",+ example: 45,+ nullable: true,+ required: false,+ })+ userId?: number | null;+}++export class TeamVerifiedEmailOutput {+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;++ @ApiProperty({+ type: ScheduleOutput,+ })+ @IsNotEmptyObject()+ @Type(() => TeamVerifiedEmailOutputData)+ data!: TeamVerifiedEmailOutputData;+}++export class UserVerifiedEmailOutput {+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;++ @ApiProperty({+ type: ScheduleOutput,+ })+ @IsNotEmptyObject()+ @Type(() => UserVerifiedEmailOutputData)+ data!: UserVerifiedEmailOutputData;+}++export class TeamVerifiedEmailsOutput {+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;++ @ApiProperty({+ type: ScheduleOutput,+ })+ @IsNotEmptyObject()+ @IsArray()+ @ValidateNested({ each: true })+ @Type(() => TeamVerifiedEmailOutputData)+ data!: TeamVerifiedEmailOutputData[];+}++export class UserVerifiedEmailsOutput {+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;++ @ApiProperty({+ type: ScheduleOutput,+ })+ @IsNotEmptyObject()+ @IsArray()+ @ValidateNested({ each: true })+ @Type(() => UserVerifiedEmailOutputData)+ data!: UserVerifiedEmailOutputData[];+}diff --git a/apps/api/v2/src/modules/verified-resources/outputs/verified-phone.output.ts b/apps/api/v2/src/modules/verified-resources/outputs/verified-phone.output.tsnew file mode 100644index 00000000000..a1d1fd8b4ab--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/outputs/verified-phone.output.ts@@ -0,0 +1,135 @@+import { ScheduleOutput } from "@/ee/schedules/schedules_2024_04_15/outputs/schedule.output";+import { ApiProperty } from "@nestjs/swagger";+import { Expose, Type } from "class-transformer";+import {+ IsArray,+ IsEnum,+ IsNotEmptyObject,+ IsNumber,+ IsString,+ ValidateNested,+ IsOptional,+} from "class-validator";++import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";++export class UserVerifiedPhoneOutputData {+ @Expose()+ @IsNumber()+ @ApiProperty({+ description: "The unique identifier for the verified email.",+ example: 789,+ })+ id!: number;++ @Expose()+ @IsString()+ @ApiProperty({+ description: "The verified phone number.",+ example: "+37255556666",+ format: "phone",+ })+ phoneNumber!: string;++ @Expose()+ @IsNumber()+ @ApiProperty({+ description: "The ID of the associated user, if applicable.",+ example: 45,+ })+ userId!: number;+}++export class TeamVerifiedPhoneOutputData {+ @Expose()+ @IsNumber()+ @ApiProperty({+ description: "The unique identifier for the verified email.",+ example: 789,+ })+ id!: number;++ @Expose()+ @IsString()+ @ApiProperty({+ description: "The verified phone number.",+ example: "+37255556666",+ format: "phone",+ })+ phoneNumber!: string;++ @Expose()+ @IsNumber()+ @IsOptional()+ @ApiProperty({+ description: "The ID of the associated user, if applicable.",+ example: 45,+ nullable: true,+ required: false,+ })+ userId?: number | null;++ @Expose()+ @IsNumber()+ @ApiProperty({+ description: "The ID of the associated team, if applicable.",+ example: 89,+ })+ teamId!: number;+}++export class UserVerifiedPhoneOutput {+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;++ @ApiProperty({+ type: ScheduleOutput,+ })+ @IsNotEmptyObject()+ @Type(() => UserVerifiedPhoneOutputData)+ data!: UserVerifiedPhoneOutputData;+}++export class TeamVerifiedPhoneOutput {+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;++ @ApiProperty({+ type: ScheduleOutput,+ })+ @IsNotEmptyObject()+ @Type(() => TeamVerifiedPhoneOutputData)+ data!: TeamVerifiedPhoneOutputData;+}++export class UserVerifiedPhonesOutput {+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;++ @ApiProperty({+ type: ScheduleOutput,+ })+ @IsNotEmptyObject()+ @IsArray()+ @ValidateNested({ each: true })+ @Type(() => UserVerifiedPhoneOutputData)+ data!: UserVerifiedPhoneOutputData[];+}++export class TeamVerifiedPhonesOutput {+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;++ @ApiProperty({+ type: ScheduleOutput,+ })+ @IsNotEmptyObject()+ @IsArray()+ @ValidateNested({ each: true })+ @Type(() => TeamVerifiedPhoneOutputData)+ data!: TeamVerifiedPhoneOutputData[];+}diff --git a/apps/api/v2/src/modules/verified-resources/services/verified-resources.service.ts b/apps/api/v2/src/modules/verified-resources/services/verified-resources.service.tsnew file mode 100644index 00000000000..b0ba2b434af--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/services/verified-resources.service.ts@@ -0,0 +1,120 @@+import { TeamsVerifiedResourcesRepository } from "@/modules/verified-resources/teams-verified-resources.repository";+import { UsersVerifiedResourcesRepository } from "@/modules/verified-resources/users-verified-resources.repository";+import { BadRequestException, ConflictException, Injectable } from "@nestjs/common";++import {+ verifyPhoneNumber,+ sendVerificationCode as sendPhoneVerificationCode,+} from "@calcom/platform-libraries";+import { sendEmailVerificationByCode, verifyEmailCodeHandler } from "@calcom/platform-libraries/emails";++@Injectable()+export class VerifiedResourcesService {+ constructor(+ private readonly usersVerifiedResourcesRepository: UsersVerifiedResourcesRepository,+ private readonly teamsVerifiedResourcesRepository: TeamsVerifiedResourcesRepository+ ) {}++ async requestEmailVerificationCode(user: { username: string; locale: string }, email: string) {+ const res = await sendEmailVerificationByCode({+ email: email,+ language: user.locale,+ username: user.username,+ isVerifyingEmail: true,+ });++ if (res.ok && !res.skipped) {+ return true;+ }++ if (!res.ok) {+ throw new BadRequestException("Email could not be verified.");+ }++ if (res.skipped) {+ throw new ConflictException("Email is already verified.");+ }++ return true;+ }++ async requestPhoneVerificationCode(phone: string) {+ try {+ await sendPhoneVerificationCode(phone);+ } catch (err) {+ throw new BadRequestException("Could not send verification code to this phone number.");+ }++ return true;+ }++ async verifyPhone(userId: number, phone: string, code: string, teamId?: number) {+ const result = await verifyPhoneNumber(phone, code, userId, teamId);++ if (result) {+ return teamId+ ? await this.teamsVerifiedResourcesRepository.getTeamVerifiedPhoneNumber(userId, phone, teamId)+ : await this.usersVerifiedResourcesRepository.getUserVerifiedPhoneNumber(userId, phone);+ }++ throw new BadRequestException("Could not verify phone number.");+ }++ async verifyEmail(userId: number, email: string, code: string, teamId?: number) {+ const isValidToken = await verifyEmailCodeHandler({+ ctx: { user: { id: userId } },+ input: { email, code, teamId },+ });+ if (isValidToken) {+ const verifiedEmail = teamId+ ? await this.teamsVerifiedResourcesRepository.getTeamVerifiedEmail(userId, email, teamId)+ : await this.usersVerifiedResourcesRepository.getUserVerifiedEmail(userId, email);+ return verifiedEmail;+ }+ throw new BadRequestException("Invalid Verification Code");+ }++ async getUserVerifiedEmailById(userId: number, id: number) {+ return this.usersVerifiedResourcesRepository.getUserVerifiedEmailById(userId, id);+ }++ async getTeamVerifiedEmailById(teamId: number, id: number) {+ return this.teamsVerifiedResourcesRepository.getTeamVerifiedEmailById(id, teamId);+ }++ async getVerifiedEmail(userId: number, email: string) {+ return this.usersVerifiedResourcesRepository.getUserVerifiedEmail(userId, email);+ }++ async getUserVerifiedEmails(userId: number, skip = 0, take = 250) {+ return this.usersVerifiedResourcesRepository.getUserVerifiedEmails(userId, skip, take);+ }++ async getTeamVerifiedEmails(teamId: number, skip = 0, take = 250) {+ return this.teamsVerifiedResourcesRepository.getTeamVerifiedEmails(teamId, skip, take);+ }++ async getUserVerifiedPhoneNumberById(userId: number, id: number) {+ return this.usersVerifiedResourcesRepository.getUserVerifiedPhoneNumberById(userId, id);+ }++ async getTeamVerifiedPhoneNumberById(teamId: number, id: number) {+ return this.teamsVerifiedResourcesRepository.getTeamVerifiedPhoneNumberById(id, teamId);+ }++ async getUserVerifiedPhoneNumber(userId: number, phoneNumber: string) {+ return this.usersVerifiedResourcesRepository.getUserVerifiedEmail(userId, phoneNumber);+ }++ async getTeamVerifiedPhoneNumber(userId: number, phoneNumber: string, teamId: number) {+ return this.teamsVerifiedResourcesRepository.getTeamVerifiedPhoneNumber(userId, phoneNumber, teamId);+ }++ async getUserVerifiedPhoneNumbers(userId: number, skip = 0, take = 250) {+ return this.usersVerifiedResourcesRepository.getUserVerifiedPhoneNumbers(userId, skip, take);+ }++ async getTeamVerifiedPhoneNumbers(teamId: number, skip = 0, take = 250) {+ return this.teamsVerifiedResourcesRepository.getTeamVerifiedPhoneNumbers(teamId, skip, take);+ }+}diff --git a/apps/api/v2/src/modules/verified-resources/teams-verified-resources.repository.ts b/apps/api/v2/src/modules/verified-resources/teams-verified-resources.repository.tsnew file mode 100644index 00000000000..b638dbcefe6--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/teams-verified-resources.repository.ts@@ -0,0 +1,66 @@+import { PrismaReadService } from "@/modules/prisma/prisma-read.service";+import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";+import { Injectable } from "@nestjs/common";++@Injectable()+export class TeamsVerifiedResourcesRepository {+ constructor(private readonly dbRead: PrismaReadService, private readonly dbWrite: PrismaWriteService) {}++ async getTeamVerifiedEmails(teamId: number, skip = 0, take = 250) {+ return this.dbRead.prisma.verifiedEmail.findMany({+ where: {+ teamId,+ },+ skip,+ take,+ });+ }++ async getTeamVerifiedPhoneNumbers(teamId: number, skip = 0, take = 250) {+ return this.dbRead.prisma.verifiedNumber.findMany({+ where: {+ teamId,+ },+ skip,+ take,+ });+ }++ async getTeamVerifiedEmail(userId: number, email: string, teamId: number) {+ return this.dbRead.prisma.verifiedEmail.findFirstOrThrow({+ where: {+ userId,+ email,+ teamId,+ },+ });+ }++ async getTeamVerifiedPhoneNumber(userId: number, phone: string, teamId: number) {+ return this.dbRead.prisma.verifiedNumber.findFirstOrThrow({+ where: {+ userId,+ phoneNumber: phone,+ teamId,+ },+ });+ }++ async getTeamVerifiedEmailById(id: number, teamId: number) {+ return this.dbRead.prisma.verifiedEmail.findFirst({+ where: {+ id,+ teamId,+ },+ });+ }++ async getTeamVerifiedPhoneNumberById(id: number, teamId: number) {+ return this.dbRead.prisma.verifiedNumber.findFirst({+ where: {+ id,+ teamId,+ },+ });+ }+}diff --git a/apps/api/v2/src/modules/verified-resources/users-verified-resources.repository.ts b/apps/api/v2/src/modules/verified-resources/users-verified-resources.repository.tsnew file mode 100644index 00000000000..713f9680d88--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/users-verified-resources.repository.ts@@ -0,0 +1,64 @@+import { PrismaReadService } from "@/modules/prisma/prisma-read.service";+import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";+import { Injectable } from "@nestjs/common";++@Injectable()+export class UsersVerifiedResourcesRepository {+ constructor(private readonly dbRead: PrismaReadService, private readonly dbWrite: PrismaWriteService) {}++ async getUserVerifiedEmails(userId: number, skip = 0, take = 250) {+ return this.dbRead.prisma.verifiedEmail.findMany({+ where: {+ userId,+ },+ skip,+ take,+ });+ }++ async getUserVerifiedPhoneNumber(userId: number, phone: string) {+ return this.dbRead.prisma.verifiedNumber.findFirstOrThrow({+ where: {+ userId,+ phoneNumber: phone,+ },+ });+ }++ async getUserVerifiedPhoneNumbers(userId: number, skip = 0, take = 250) {+ return this.dbRead.prisma.verifiedNumber.findMany({+ where: {+ userId,+ },+ skip,+ take,+ });+ }++ async getUserVerifiedEmail(userId: number, email: string) {+ return this.dbRead.prisma.verifiedEmail.findFirstOrThrow({+ where: {+ userId,+ email,+ },+ });+ }++ async getUserVerifiedEmailById(userId: number, id: number) {+ return this.dbRead.prisma.verifiedEmail.findFirst({+ where: {+ userId,+ id,+ },+ });+ }++ async getUserVerifiedPhoneNumberById(userId: number, id: number) {+ return this.dbRead.prisma.verifiedNumber.findFirst({+ where: {+ userId,+ id,+ },+ });+ }+}diff --git a/apps/api/v2/src/modules/verified-resources/verified-resources.module.ts b/apps/api/v2/src/modules/verified-resources/verified-resources.module.tsnew file mode 100644index 00000000000..b40c2d32d6b--- /dev/null+++ b/apps/api/v2/src/modules/verified-resources/verified-resources.module.ts@@ -0,0 +1,39 @@+import { AppsRepository } from "@/modules/apps/apps.repository";+import { CredentialsRepository } from "@/modules/credentials/credentials.repository";+import { MembershipsRepository } from "@/modules/memberships/memberships.repository";+import { OrganizationsRepository } from "@/modules/organizations/index/organizations.repository";+import { OrganizationsTeamsRepository } from "@/modules/organizations/teams/index/organizations-teams.repository";+import { OrgTeamsVerifiedResourcesController } from "@/modules/organizations/teams/verified-resources/org-teams-verified-resources.controller";+import { PrismaModule } from "@/modules/prisma/prisma.module";+import { RedisModule } from "@/modules/redis/redis.module";+import { StripeService } from "@/modules/stripe/stripe.service";+import { TeamsVerifiedResourcesController } from "@/modules/teams/verified-resources/teams-verified-resources.controller";+import { UsersRepository } from "@/modules/users/users.repository";+import { UserVerifiedResourcesController } from "@/modules/verified-resources/controllers/users-verified-resources.controller";+import { VerifiedResourcesService } from "@/modules/verified-resources/services/verified-resources.service";+import { TeamsVerifiedResourcesRepository } from "@/modules/verified-resources/teams-verified-resources.repository";+import { UsersVerifiedResourcesRepository } from "@/modules/verified-resources/users-verified-resources.repository";+import { Module } from "@nestjs/common";++@Module({+ imports: [PrismaModule, RedisModule],+ controllers: [+ UserVerifiedResourcesController,+ TeamsVerifiedResourcesController,+ OrgTeamsVerifiedResourcesController,+ ],+ providers: [+ VerifiedResourcesService,+ UsersVerifiedResourcesRepository,+ TeamsVerifiedResourcesRepository,+ MembershipsRepository,+ OrganizationsTeamsRepository,+ OrganizationsRepository,+ StripeService,+ AppsRepository,+ CredentialsRepository,+ UsersRepository,+ ],+ exports: [VerifiedResourcesService],+})+export class VerifiedResourcesModule {}diff --git a/apps/api/v2/swagger/documentation.json b/apps/api/v2/swagger/documentation.jsonindex dd6a2dbc12b..6ae330759ad 100644--- a/apps/api/v2/swagger/documentation.json+++ b/apps/api/v2/swagger/documentation.json@@ -9315,73 +9315,97 @@]}},- "/v2/organizations/{orgId}/teams/{teamId}/stripe/connect": {- "get": {- "operationId": "OrganizationsStripeController_getTeamStripeConnectUrl",- "summary": "Get stripe connect URL for a team",+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/verification-code/request": {+ "post": {+ "operationId": "OrgTeamsVerifiedResourcesController_requestEmailVerificationCode",+ "summary": "Request Email Verification Code",+ "description": "Sends a verification code to the email.","parameters": [{"name": "Authorization",- "required": true,"in": "header",- "schema": {- "type": "string"- }- },- {- "name": "teamId",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {"type": "string"}- },- {- "name": "orgId",- "required": true,- "in": "path",- "schema": {- "type": "string"+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/RequestEmailVerificationInput"+ }}- },- {- "name": "returnTo",- "required": true,- "in": "query",- "schema": {- "type": "string"+ }+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/RequestEmailVerificationOutput"+ }+ }}- },+ }+ },+ "tags": [+ "Organization Team Verified Resources"+ ]+ }+ },+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/verification-code/request": {+ "post": {+ "operationId": "OrgTeamsVerifiedResourcesController_requestPhoneVerificationCode",+ "summary": "Request Phone Number Verification Code",+ "description": "Sends a verification code to the phone number.",+ "parameters": [{- "name": "onErrorReturnTo",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "query","schema": {"type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/RequestPhoneVerificationInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripConnectOutputResponseDto"+ "$ref": "#/components/schemas/RequestPhoneVerificationOutput"}}}}},"tags": [- "Organizations/Teams Stripe"+ "Organization Team Verified Resources"]}},- "/v2/organizations/{orgId}/teams/{teamId}/stripe/check": {- "get": {- "operationId": "OrganizationsStripeController_checkTeamStripeConnection",- "summary": "Check team stripe connection",+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/verification-code/verify": {+ "post": {+ "operationId": "OrgTeamsVerifiedResourcesController_verifyEmail",+ "summary": "Verify an email for an org team.",+ "description": "Use code to verify an email","parameters": [{"name": "teamId",@@ -9390,145 +9414,193 @@"schema": {"type": "number"}+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/VerifyEmailInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"}}}}},"tags": [- "Organizations/Teams Stripe"+ "Organization Team Verified Resources"]}},- "/v2/organizations/{orgId}/teams/{teamId}/stripe/save": {- "get": {- "operationId": "OrganizationsStripeController_save",- "summary": "Save stripe credentials",+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/verification-code/verify": {+ "post": {+ "operationId": "OrgTeamsVerifiedResourcesController_verifyPhoneNumber",+ "summary": "Verify a phone number for an org team.",+ "description": "Use code to verify a phone number","parameters": [{- "name": "state",+ "name": "teamId","required": true,- "in": "query",+ "in": "path","schema": {- "type": "string"+ "type": "number"}},{- "name": "code",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "query","schema": {"type": "string"}- },- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/VerifyPhoneInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"+ "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"}}}}},"tags": [- "Organizations/Teams Stripe"+ "Organization Team Verified Resources"]}},- "/v2/routing-forms/{routingFormId}/calculate-slots": {- "post": {- "operationId": "RoutingFormsController_calculateSlotsBasedOnRoutingFormResponse",- "summary": "Calculate slots based on routing form response",- "description": "It will not actually save the response just return the routed event type and slots when it can be booked.",+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails": {+ "get": {+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedEmails",+ "summary": "Get list of verified emails of an org team.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string"+ "type": "number"}},{- "name": "start",- "required": true,+ "name": "take",+ "required": false,"in": "query",- "description": "\n Time starting from which available slots should be checked.\n \n Must be in UTC timezone as ISO 8601 datestring.\n \n You can pass date without hours which defaults to start of day or specify hours:\n 2024-08-13 (will have hours 00:00:00 aka at very beginning of the date) or you can specify hours manually like 2024-08-13T09:00:00Z\n ",- "example": "2050-09-05",+ "description": "The number of items to return",+ "example": 10,"schema": {- "type": "string"+ "type": "number"}},{- "name": "end",- "required": true,+ "name": "skip",+ "required": false,"in": "query",- "description": "\n Time until which available slots should be checked.\n \n Must be in UTC timezone as ISO 8601 datestring.\n \n You can pass date without hours which defaults to end of day or specify hours:\n 2024-08-20 (will have hours 23:59:59 aka at the very end of the date) or you can specify hours manually like 2024-08-20T18:00:00Z",- "example": "2050-09-06",+ "description": "The number of items to skip",+ "example": 0,"schema": {- "type": "string"+ "type": "number"}},{- "name": "timeZone",- "required": false,- "in": "query",- "description": "Time zone in which the available slots should be returned. Defaults to UTC.",- "example": "Europe/Rome",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,"schema": {"type": "string"}+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/TeamVerifiedEmailsOutput"+ }+ }+ }+ }+ },+ "tags": [+ "Organization Team Verified Resources"+ ]+ }+ },+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phone-numbers": {+ "get": {+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedPhoneNumbers",+ "summary": "Get list of verified phone numbers of an org team.",+ "parameters": [+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }},{- "name": "duration",+ "name": "take","required": false,"in": "query",- "description": "If event type has multiple possible durations then you can specify the desired duration here. Also, if you are fetching slots for a dynamic event then you can specify the duration her which defaults to 30, meaning that returned slots will be each 30 minutes long.",- "example": "60",+ "description": "The number of items to return",+ "example": 10,"schema": {"type": "number"}},{- "name": "format",+ "name": "skip","required": false,"in": "query",- "description": "Format of slot times in response. Use 'range' to get start and end times.",- "example": "range",+ "description": "The number of items to skip",+ "example": 0,"schema": {- "enum": [- "range",- "time"- ],- "type": "string"+ "type": "number"}},{- "name": "routingFormId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {"type": "string"}@@ -9540,91 +9612,93 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/ResponseSlotsOutput"+ "$ref": "#/components/schemas/TeamVerifiedPhonesOutput"}}}}},"tags": [- "Routing forms"+ "Organization Team Verified Resources"]}},- "/v2/schedules": {- "post": {- "operationId": "SchedulesController_2024_06_11_createSchedule",- "summary": "Create a schedule",- "description": "\n Create a schedule for the authenticated user.\n\n The point of creating schedules is for event types to be available at specific times.\n\n The first goal of schedules is to have a default schedule. If you are platform customer and created managed users, then it is important to note that each managed user should have a default schedule.\n 1. If you passed `timeZone` when creating managed user, then the default schedule from Monday to Friday from 9AM to 5PM will be created with that timezone. The managed user can then change the default schedule via the `AvailabilitySettings` atom.\n 2. If you did not, then we assume you want the user to have this specific schedule right away. You should create a default schedule by specifying\n `\"isDefault\": true` in the request body. Until the user has a default schedule the user can't be booked nor manage their schedule via the AvailabilitySettings atom.\n\n The second goal of schedules is to create another schedule that event types can point to. This is useful for when an event is booked because availability is not checked against the default schedule but instead against that specific schedule.\n After creating a non-default schedule, you can update an event type to point to that schedule via the PATCH `event-types/{eventTypeId}` endpoint.\n\n When specifying start time and end time for each day use the 24 hour format e.g. 08:00, 15:00 etc.\n ",+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/{id}": {+ "get": {+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedEmailById",+ "summary": "Get verified email of an org team by id.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "name": "id","required": true,+ "in": "path","schema": {- "type": "string"+ "type": "number"}},{- "name": "cal-api-version",+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization","in": "header",- "description": "Must be set to 2024-06-11",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {- "type": "string",- "default": "2024-06-11"+ "type": "string"}}],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/CreateScheduleInput_2024_06_11"- }- }- }- },"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateScheduleOutput_2024_06_11"+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"}}}}},"tags": [- "Schedules"+ "Organization Team Verified Resources"]- },+ }+ },+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phone-numbers/{id}": {"get": {- "operationId": "SchedulesController_2024_06_11_getSchedules",- "summary": "Get all schedules",- "description": "Get all schedules of the authenticated user.",+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedPhoneById",+ "summary": "Get verified phone number of an org team by id.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string"+ "type": "number"}},{- "name": "cal-api-version",+ "name": "id",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization","in": "header",- "description": "Must be set to 2024-06-11",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {- "type": "string",- "default": "2024-06-11"+ "type": "string"}}],@@ -9634,40 +9708,60 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"+ "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"}}}}},"tags": [- "Schedules"+ "Organization Team Verified Resources"]}},- "/v2/schedules/default": {+ "/v2/organizations/{orgId}/teams/{teamId}/stripe/connect": {"get": {- "operationId": "SchedulesController_2024_06_11_getDefaultSchedule",- "summary": "Get default schedule",- "description": "Get the default schedule of the authenticated user.",+ "operationId": "OrganizationsStripeController_getTeamStripeConnectUrl",+ "summary": "Get stripe connect URL for a team","parameters": [{"name": "Authorization",+ "required": true,"in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "teamId","required": true,+ "in": "path","schema": {"type": "string"}},{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-06-11",+ "name": "orgId","required": true,+ "in": "path","schema": {- "type": "string",- "default": "2024-06-11"+ "type": "string"+ }+ },+ {+ "name": "returnTo",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "onErrorReturnTo",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"}}],@@ -9677,43 +9771,24 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetDefaultScheduleOutput_2024_06_11"+ "$ref": "#/components/schemas/StripConnectOutputResponseDto"}}}}},"tags": [- "Schedules"+ "Organizations/Teams Stripe"]}},- "/v2/schedules/{scheduleId}": {+ "/v2/organizations/{orgId}/teams/{teamId}/stripe/check": {"get": {- "operationId": "SchedulesController_2024_06_11_getSchedule",- "summary": "Get a schedule",+ "operationId": "OrganizationsStripeController_checkTeamStripeConnection",+ "summary": "Check team stripe connection","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-06-11",- "required": true,- "schema": {- "type": "string",- "default": "2024-06-11"- }- },- {- "name": "scheduleId",+ "name": "teamId","required": true,"in": "path","schema": {@@ -9727,104 +9802,140 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetScheduleOutput_2024_06_11"+ "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"}}}}},"tags": [- "Schedules"+ "Organizations/Teams Stripe"]- },- "patch": {- "operationId": "SchedulesController_2024_06_11_updateSchedule",- "summary": "Update a schedule",+ }+ },+ "/v2/organizations/{orgId}/teams/{teamId}/stripe/save": {+ "get": {+ "operationId": "OrganizationsStripeController_save",+ "summary": "Save stripe credentials","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "name": "state","required": true,+ "in": "query","schema": {"type": "string"}},{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-06-11",+ "name": "code","required": true,+ "in": "query","schema": {- "type": "string",- "default": "2024-06-11"+ "type": "string"}},{- "name": "scheduleId",+ "name": "teamId","required": true,"in": "path","schema": {- "type": "string"+ "type": "number"}}],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/UpdateScheduleInput_2024_06_11"- }- }- }- },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateScheduleOutput_2024_06_11"+ "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"}}}}},"tags": [- "Schedules"+ "Organizations/Teams Stripe"]- },- "delete": {- "operationId": "SchedulesController_2024_06_11_deleteSchedule",- "summary": "Delete a schedule",+ }+ },+ "/v2/routing-forms/{routingFormId}/calculate-slots": {+ "post": {+ "operationId": "RoutingFormsController_calculateSlotsBasedOnRoutingFormResponse",+ "summary": "Calculate slots based on routing form response",+ "description": "It will not actually save the response just return the routed event type and slots when it can be booked.","parameters": [{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_","required": true,"schema": {"type": "string"}},{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-06-11",+ "name": "start","required": true,+ "in": "query",+ "description": "\n Time starting from which available slots should be checked.\n \n Must be in UTC timezone as ISO 8601 datestring.\n \n You can pass date without hours which defaults to start of day or specify hours:\n 2024-08-13 (will have hours 00:00:00 aka at very beginning of the date) or you can specify hours manually like 2024-08-13T09:00:00Z\n ",+ "example": "2050-09-05","schema": {- "type": "string",- "default": "2024-06-11"+ "type": "string"}},{- "name": "scheduleId",+ "name": "end","required": true,- "in": "path",+ "in": "query",+ "description": "\n Time until which available slots should be checked.\n \n Must be in UTC timezone as ISO 8601 datestring.\n \n You can pass date without hours which defaults to end of day or specify hours:\n 2024-08-20 (will have hours 23:59:59 aka at the very end of the date) or you can specify hours manually like 2024-08-20T18:00:00Z",+ "example": "2050-09-06",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "timeZone",+ "required": false,+ "in": "query",+ "description": "Time zone in which the available slots should be returned. Defaults to UTC.",+ "example": "Europe/Rome",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "duration",+ "required": false,+ "in": "query",+ "description": "If event type has multiple possible durations then you can specify the desired duration here. Also, if you are fetching slots for a dynamic event then you can specify the duration her which defaults to 30, meaning that returned slots will be each 30 minutes long.",+ "example": "60","schema": {"type": "number"}+ },+ {+ "name": "format",+ "required": false,+ "in": "query",+ "description": "Format of slot times in response. Use 'range' to get start and end times.",+ "example": "range",+ "schema": {+ "enum": [+ "range",+ "time"+ ],+ "type": "string"+ }+ },+ {+ "name": "routingFormId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }}],"responses": {@@ -9833,21 +9944,22 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/DeleteScheduleOutput_2024_06_11"+ "$ref": "#/components/schemas/ResponseSlotsOutput"}}}}},"tags": [- "Schedules"+ "Routing forms"]}},- "/v2/selected-calendars": {+ "/v2/schedules": {"post": {- "operationId": "SelectedCalendarsController_addSelectedCalendar",- "summary": "Add a selected calendar",+ "operationId": "SchedulesController_2024_06_11_createSchedule",+ "summary": "Create a schedule",+ "description": "\n Create a schedule for the authenticated user.\n\n The point of creating schedules is for event types to be available at specific times.\n\n The first goal of schedules is to have a default schedule. If you are platform customer and created managed users, then it is important to note that each managed user should have a default schedule.\n 1. If you passed `timeZone` when creating managed user, then the default schedule from Monday to Friday from 9AM to 5PM will be created with that timezone. The managed user can then change the default schedule via the `AvailabilitySettings` atom.\n 2. If you did not, then we assume you want the user to have this specific schedule right away. You should create a default schedule by specifying\n `\"isDefault\": true` in the request body. Until the user has a default schedule the user can't be booked nor manage their schedule via the AvailabilitySettings atom.\n\n The second goal of schedules is to create another schedule that event types can point to. This is useful for when an event is booked because availability is not checked against the default schedule but instead against that specific schedule.\n After creating a non-default schedule, you can update an event type to point to that schedule via the PATCH `event-types/{eventTypeId}` endpoint.\n\n When specifying start time and end time for each day use the 24 hour format e.g. 08:00, 15:00 etc.\n ","parameters": [{"name": "Authorization",@@ -9857,6 +9969,16 @@"schema": {"type": "string"}+ },+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-06-11"+ }}],"requestBody": {@@ -9864,7 +9986,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/SelectedCalendarsInputDto"+ "$ref": "#/components/schemas/CreateScheduleInput_2024_06_11"}}}@@ -9875,20 +9997,21 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"+ "$ref": "#/components/schemas/CreateScheduleOutput_2024_06_11"}}}}},"tags": [- "Selected Calendars"+ "Schedules"]},- "delete": {- "operationId": "SelectedCalendarsController_deleteSelectedCalendar",- "summary": "Delete a selected calendar",- "parameters": [+ "get": {+ "operationId": "SchedulesController_2024_06_11_getSchedules",+ "summary": "Get all schedules",+ "description": "Get all schedules of the authenticated user.",+ "parameters": [{"name": "Authorization","in": "header",@@ -9899,35 +10022,56 @@}},{- "name": "integration",+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11","required": true,- "in": "query","schema": {- "type": "string"+ "type": "string",+ "default": "2024-06-11"}- },- {- "name": "externalId",- "required": true,- "in": "query",- "schema": {- "type": "string"+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"+ }+ }}- },+ }+ },+ "tags": [+ "Schedules"+ ]+ }+ },+ "/v2/schedules/default": {+ "get": {+ "operationId": "SchedulesController_2024_06_11_getDefaultSchedule",+ "summary": "Get default schedule",+ "description": "Get the default schedule of the authenticated user.",+ "parameters": [{- "name": "credentialId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "query","schema": {"type": "string"}},{- "name": "delegationCredentialId",- "required": false,- "in": "query",+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11",+ "required": true,"schema": {- "type": "string"+ "type": "string",+ "default": "2024-06-11"}}],@@ -9937,162 +10081,422 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"+ "$ref": "#/components/schemas/GetDefaultScheduleOutput_2024_06_11"}}}}},"tags": [- "Selected Calendars"+ "Schedules"]}},- "/v2/slots": {+ "/v2/schedules/{scheduleId}": {"get": {- "operationId": "SlotsController_2024_09_04_getAvailableSlots",- "summary": "Find out when is an event type ready to be booked.",- "description": "\n There are 4 ways to get available slots for event type of an individual user:\n\n 1. By event type id. Event type id can be of user and team event types. Example '/v2/slots?eventTypeId=10&start=2050-09-05&end=2050-09-06&timeZone=Europe/Rome'\n\n 2. By event type slug + username. Example '/v2/slots?eventTypeSlug=intro&username=bob&start=2050-09-05&end=2050-09-06'\n\n 3. By event type slug + username + organization slug when searching within an organization. Example '/v2/slots?organizationSlug=org-slug&eventTypeSlug=intro&username=bob&start=2050-09-05&end=2050-09-06'\n\n 4. By usernames only (used for dynamic event type - there is no specific event but you want to know when 2 or more people are available). Example '/v2/slots?usernames=alice,bob&username=bob&organizationSlug=org-slug&start=2050-09-05&end=2050-09-06'. As you see you also need to provide the slug of the organization to which each user in the 'usernames' array belongs.\n\n And 3 ways to get available slots for team event type:\n\n 1. By team event type id. Example '/v2/slots?eventTypeId=10&start=2050-09-05&end=2050-09-06&timeZone=Europe/Rome'\n\n 2. By team event type slug + team slug. Example '/v2/slots?eventTypeSlug=intro&teamSlug=team-slug&start=2050-09-05&end=2050-09-06'\n\n 3. By team event type slug + team slug + organization slug when searching within an organization. Example '/v2/slots?organizationSlug=org-slug&eventTypeSlug=intro&teamSlug=team-slug&start=2050-09-05&end=2050-09-06'\n\n All of them require \"start\" and \"end\" query parameters which define the time range for which available slots should be checked.\n Optional parameters are:\n - timeZone: Time zone in which the available slots should be returned. Defaults to UTC.\n - duration: Only use for event types that allow multiple durations or for dynamic event types. If not passed for multiple duration event types defaults to default duration. For dynamic event types defaults to 30 aka each returned slot is 30 minutes long. So duration=60 means that returned slots will be each 60 minutes long.\n - slotFormat: Format of the slots. By default return is an object where each key is date and value is array of slots as string. If you want to get start and end of each slot use \"range\" as value.\n ",+ "operationId": "SchedulesController_2024_06_11_getSchedule",+ "summary": "Get a schedule","parameters": [{- "name": "cal-api-version",+ "name": "Authorization","in": "header",- "description": "Must be set to 2024-09-04",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {- "type": "string",- "default": "2024-09-04"+ "type": "string"}},{- "name": "start",+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11","required": true,- "in": "query",- "description": "\n Time starting from which available slots should be checked.\n\n Must be in UTC timezone as ISO 8601 datestring.\n\n You can pass date without hours which defaults to start of day or specify hours:\n 2024-08-13 (will have hours 00:00:00 aka at very beginning of the date) or you can specify hours manually like 2024-08-13T09:00:00Z.",- "example": "2050-09-05",- "schema": {}+ "schema": {+ "type": "string",+ "default": "2024-06-11"+ }},{- "name": "end",+ "name": "scheduleId","required": true,- "in": "query",- "description": "\n Time until which available slots should be checked.\n\n Must be in UTC timezone as ISO 8601 datestring.\n\n You can pass date without hours which defaults to end of day or specify hours:\n 2024-08-20 (will have hours 23:59:59 aka at the very end of the date) or you can specify hours manually like 2024-08-20T18:00:00Z.",- "example": "2050-09-06",- "schema": {}- },- {- "name": "organizationSlug",- "required": false,- "in": "query",- "description": "The slug of the organization to which user with username belongs or team with teamSlug belongs.",- "example": "org-slug",- "schema": {}- },- {- "name": "teamSlug",- "required": false,- "in": "query",- "description": "The slug of the team who owns event type with eventTypeSlug - used when slots are checked for team event type.",- "example": "team-slug",- "schema": {}- },- {- "name": "username",- "required": false,- "in": "query",- "description": "The username of the user who owns event type with eventTypeSlug - used when slots are checked for individual user event type.",- "example": "bob",- "schema": {}- },- {- "name": "eventTypeSlug",- "required": false,- "in": "query",- "description": "The slug of the event type for which available slots should be checked. If slug is provided then username or teamSlug must be provided too and if relevant organizationSlug too.",- "example": "event-type-slug",- "schema": {}- },- {- "name": "eventTypeId",- "required": false,- "in": "query",- "description": "The ID of the event type for which available slots should be checked.",- "example": "100",- "schema": {}- },- {- "name": "usernames",- "required": false,- "in": "query",- "description": "The usernames for which available slots should be checked separated by a comma.\n\n Checking slots by usernames is used mainly for dynamic events where there is no specific event but we just want to know when 2 or more people are available.\n\n Must contain at least 2 usernames.",- "example": "alice,bob",- "schema": {}- },+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GetScheduleOutput_2024_06_11"+ }+ }+ }+ }+ },+ "tags": [+ "Schedules"+ ]+ },+ "patch": {+ "operationId": "SchedulesController_2024_06_11_updateSchedule",+ "summary": "Update a schedule",+ "parameters": [{- "name": "slotFormat",- "required": false,- "in": "query",- "description": "Format of slot times in response. Use 'range' to get start and end times. Use 'time' or omit this query parameter to get only start time.",- "example": "range",- "schema": {}+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }},{- "name": "duration",- "required": false,- "in": "query",- "description": "If event type has multiple possible durations then you can specify the desired duration here. Also, if you are fetching slots for a dynamic event then you can specify the duration her which defaults to 30, meaning that returned slots will be each 30 minutes long.",- "example": "60",- "schema": {}+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-06-11"+ }},{- "name": "timeZone",- "required": false,- "in": "query",- "description": "Time zone in which the available slots should be returned. Defaults to UTC.",- "example": "Europe/Rome",- "schema": {}+ "name": "scheduleId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/UpdateScheduleInput_2024_06_11"+ }+ }+ }+ },"responses": {"200": {- "description": "A map of available slots indexed by date, where each date is associated with an array of time slots. If format=range is specified, each slot will be an object with start and end properties denoting start and end of the slot.\n For seated slots each object will have attendeesCount and bookingUid properties.",+ "description": "","content": {"application/json": {"schema": {- "oneOf": [- {- "type": "object",- "title": "Default format (or with format=time)",- "additionalProperties": {- "type": "array",- "items": {- "type": "string"- }- },- "example": {- "status": "success",- "data": {- "2050-09-05": [- {- "start": "2050-09-05T09:00:00.000+02:00"- },- {- "start": "2050-09-05T10:00:00.000+02:00"- }- ],- "2050-09-06": [- {- "start": "2050-09-06T09:00:00.000+02:00"- },- {- "start": "2050-09-06T10:00:00.000+02:00"- }- ]- }- }- },- {- "type": "object",+ "$ref": "#/components/schemas/UpdateScheduleOutput_2024_06_11"+ }+ }+ }+ }+ },+ "tags": [+ "Schedules"+ ]+ },+ "delete": {+ "operationId": "SchedulesController_2024_06_11_deleteSchedule",+ "summary": "Delete a schedule",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-06-11"+ }+ },+ {+ "name": "scheduleId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/DeleteScheduleOutput_2024_06_11"+ }+ }+ }+ }+ },+ "tags": [+ "Schedules"+ ]+ }+ },+ "/v2/selected-calendars": {+ "post": {+ "operationId": "SelectedCalendarsController_addSelectedCalendar",+ "summary": "Add a selected calendar",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/SelectedCalendarsInputDto"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": [+ "Selected Calendars"+ ]+ },+ "delete": {+ "operationId": "SelectedCalendarsController_deleteSelectedCalendar",+ "summary": "Delete a selected calendar",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "integration",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "externalId",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "credentialId",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "delegationCredentialId",+ "required": false,+ "in": "query",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": [+ "Selected Calendars"+ ]+ }+ },+ "/v2/slots": {+ "get": {+ "operationId": "SlotsController_2024_09_04_getAvailableSlots",+ "summary": "Find out when is an event type ready to be booked.",+ "description": "\n There are 4 ways to get available slots for event type of an individual user:\n\n 1. By event type id. Event type id can be of user and team event types. Example '/v2/slots?eventTypeId=10&start=2050-09-05&end=2050-09-06&timeZone=Europe/Rome'\n\n 2. By event type slug + username. Example '/v2/slots?eventTypeSlug=intro&username=bob&start=2050-09-05&end=2050-09-06'\n\n 3. By event type slug + username + organization slug when searching within an organization. Example '/v2/slots?organizationSlug=org-slug&eventTypeSlug=intro&username=bob&start=2050-09-05&end=2050-09-06'\n\n 4. By usernames only (used for dynamic event type - there is no specific event but you want to know when 2 or more people are available). Example '/v2/slots?usernames=alice,bob&username=bob&organizationSlug=org-slug&start=2050-09-05&end=2050-09-06'. As you see you also need to provide the slug of the organization to which each user in the 'usernames' array belongs.\n\n And 3 ways to get available slots for team event type:\n\n 1. By team event type id. Example '/v2/slots?eventTypeId=10&start=2050-09-05&end=2050-09-06&timeZone=Europe/Rome'\n\n 2. By team event type slug + team slug. Example '/v2/slots?eventTypeSlug=intro&teamSlug=team-slug&start=2050-09-05&end=2050-09-06'\n\n 3. By team event type slug + team slug + organization slug when searching within an organization. Example '/v2/slots?organizationSlug=org-slug&eventTypeSlug=intro&teamSlug=team-slug&start=2050-09-05&end=2050-09-06'\n\n All of them require \"start\" and \"end\" query parameters which define the time range for which available slots should be checked.\n Optional parameters are:\n - timeZone: Time zone in which the available slots should be returned. Defaults to UTC.\n - duration: Only use for event types that allow multiple durations or for dynamic event types. If not passed for multiple duration event types defaults to default duration. For dynamic event types defaults to 30 aka each returned slot is 30 minutes long. So duration=60 means that returned slots will be each 60 minutes long.\n - slotFormat: Format of the slots. By default return is an object where each key is date and value is array of slots as string. If you want to get start and end of each slot use \"range\" as value.\n ",+ "parameters": [+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-09-04",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-09-04"+ }+ },+ {+ "name": "start",+ "required": true,+ "in": "query",+ "description": "\n Time starting from which available slots should be checked.\n\n Must be in UTC timezone as ISO 8601 datestring.\n\n You can pass date without hours which defaults to start of day or specify hours:\n 2024-08-13 (will have hours 00:00:00 aka at very beginning of the date) or you can specify hours manually like 2024-08-13T09:00:00Z.",+ "example": "2050-09-05",+ "schema": {}+ },+ {+ "name": "end",+ "required": true,+ "in": "query",+ "description": "\n Time until which available slots should be checked.\n\n Must be in UTC timezone as ISO 8601 datestring.\n\n You can pass date without hours which defaults to end of day or specify hours:\n 2024-08-20 (will have hours 23:59:59 aka at the very end of the date) or you can specify hours manually like 2024-08-20T18:00:00Z.",+ "example": "2050-09-06",+ "schema": {}+ },+ {+ "name": "organizationSlug",+ "required": false,+ "in": "query",+ "description": "The slug of the organization to which user with username belongs or team with teamSlug belongs.",+ "example": "org-slug",+ "schema": {}+ },+ {+ "name": "teamSlug",+ "required": false,+ "in": "query",+ "description": "The slug of the team who owns event type with eventTypeSlug - used when slots are checked for team event type.",+ "example": "team-slug",+ "schema": {}+ },+ {+ "name": "username",+ "required": false,+ "in": "query",+ "description": "The username of the user who owns event type with eventTypeSlug - used when slots are checked for individual user event type.",+ "example": "bob",+ "schema": {}+ },+ {+ "name": "eventTypeSlug",+ "required": false,+ "in": "query",+ "description": "The slug of the event type for which available slots should be checked. If slug is provided then username or teamSlug must be provided too and if relevant organizationSlug too.",+ "example": "event-type-slug",+ "schema": {}+ },+ {+ "name": "eventTypeId",+ "required": false,+ "in": "query",+ "description": "The ID of the event type for which available slots should be checked.",+ "example": "100",+ "schema": {}+ },+ {+ "name": "usernames",+ "required": false,+ "in": "query",+ "description": "The usernames for which available slots should be checked separated by a comma.\n\n Checking slots by usernames is used mainly for dynamic events where there is no specific event but we just want to know when 2 or more people are available.\n\n Must contain at least 2 usernames.",+ "example": "alice,bob",+ "schema": {}+ },+ {+ "name": "slotFormat",+ "required": false,+ "in": "query",+ "description": "Format of slot times in response. Use 'range' to get start and end times. Use 'time' or omit this query parameter to get only start time.",+ "example": "range",+ "schema": {}+ },+ {+ "name": "duration",+ "required": false,+ "in": "query",+ "description": "If event type has multiple possible durations then you can specify the desired duration here. Also, if you are fetching slots for a dynamic event then you can specify the duration her which defaults to 30, meaning that returned slots will be each 30 minutes long.",+ "example": "60",+ "schema": {}+ },+ {+ "name": "timeZone",+ "required": false,+ "in": "query",+ "description": "Time zone in which the available slots should be returned. Defaults to UTC.",+ "example": "Europe/Rome",+ "schema": {}+ }+ ],+ "responses": {+ "200": {+ "description": "A map of available slots indexed by date, where each date is associated with an array of time slots. If format=range is specified, each slot will be an object with start and end properties denoting start and end of the slot.\n For seated slots each object will have attendeesCount and bookingUid properties.",+ "content": {+ "application/json": {+ "schema": {+ "oneOf": [+ {+ "type": "object",+ "title": "Default format (or with format=time)",+ "additionalProperties": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ "example": {+ "status": "success",+ "data": {+ "2050-09-05": [+ {+ "start": "2050-09-05T09:00:00.000+02:00"+ },+ {+ "start": "2050-09-05T10:00:00.000+02:00"+ }+ ],+ "2050-09-06": [+ {+ "start": "2050-09-06T09:00:00.000+02:00"+ },+ {+ "start": "2050-09-06T10:00:00.000+02:00"+ }+ ]+ }+ }+ },+ {+ "type": "object","title": "Range format (when format=range)","additionalProperties": {"type": "array",@@ -10141,91 +10545,628 @@}},"tags": [- "Slots"+ "Slots"+ ]+ }+ },+ "/v2/slots/reservations": {+ "post": {+ "operationId": "SlotsController_2024_09_04_reserveSlot",+ "summary": "Reserve a slot",+ "description": "Make a slot not available for others to book for a certain period of time. If you authenticate using oAuth credentials, api key or access token\n then you can also specify custom duration for how long the slot should be reserved for (defaults to 5 minutes).",+ "parameters": [+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-09-04",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-09-04"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": false,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "x-cal-client-id",+ "in": "header",+ "description": "For platform customers - OAuth client ID",+ "required": false,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ReserveSlotInput_2024_09_04"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"+ }+ }+ }+ }+ },+ "tags": [+ "Slots"+ ]+ }+ },+ "/v2/slots/reservations/{uid}": {+ "get": {+ "operationId": "SlotsController_2024_09_04_getReservedSlot",+ "summary": "Get reserved slot",+ "parameters": [+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-09-04",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-09-04"+ }+ },+ {+ "name": "uid",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GetReservedSlotOutput_2024_09_04"+ }+ }+ }+ }+ },+ "tags": [+ "Slots"+ ]+ },+ "patch": {+ "operationId": "SlotsController_2024_09_04_updateReservedSlot",+ "summary": "Updated reserved a slot",+ "parameters": [+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-09-04",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-09-04"+ }+ },+ {+ "name": "uid",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ReserveSlotInput_2024_09_04"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"+ }+ }+ }+ }+ },+ "tags": [+ "Slots"+ ]+ },+ "delete": {+ "operationId": "SlotsController_2024_09_04_deleteReservedSlot",+ "summary": "Delete a reserved slot",+ "parameters": [+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-09-04",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-09-04"+ }+ },+ {+ "name": "uid",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "example": {+ "status": "success"+ }+ }+ }+ }+ }+ },+ "tags": [+ "Slots"+ ]+ }+ },+ "/v2/stripe/connect": {+ "get": {+ "operationId": "StripeController_redirect",+ "summary": "Get stripe connect URL",+ "parameters": [+ {+ "name": "Authorization",+ "required": true,+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/StripConnectOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": [+ "Stripe"+ ]+ }+ },+ "/v2/stripe/save": {+ "get": {+ "operationId": "StripeController_save",+ "summary": "Save stripe credentials",+ "parameters": [+ {+ "name": "state",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "code",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": [+ "Stripe"+ ]+ }+ },+ "/v2/stripe/check": {+ "get": {+ "operationId": "StripeController_check",+ "summary": "Check stripe connection",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": [+ "Stripe"+ ]+ }+ },+ "/v2/teams": {+ "post": {+ "operationId": "TeamsController_createTeam",+ "summary": "Create a team",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamInput"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamOutput"+ }+ }+ }+ }+ },+ "tags": [+ "Teams"+ ]+ },+ "get": {+ "operationId": "TeamsController_getTeams",+ "summary": "Get teams",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GetTeamsOutput"+ }+ }+ }+ }+ },+ "tags": [+ "Teams"+ ]+ }+ },+ "/v2/teams/{teamId}": {+ "get": {+ "operationId": "TeamsController_getTeam",+ "summary": "Get a team",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GetTeamOutput"+ }+ }+ }+ }+ },+ "tags": [+ "Teams"+ ]+ },+ "patch": {+ "operationId": "TeamsController_updateTeam",+ "summary": "Update a team",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/UpdateOrgTeamDto"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/UpdateTeamOutput"+ }+ }+ }+ }+ },+ "tags": [+ "Teams"+ ]+ },+ "delete": {+ "operationId": "TeamsController_deleteTeam",+ "summary": "Delete a team",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/OrgTeamOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": [+ "Teams"+ ]+ }+ },+ "/v2/teams/{teamId}/event-types": {+ "post": {+ "operationId": "TeamsEventTypesController_createTeamEventType",+ "summary": "Create an event type",+ "parameters": [+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamEventTypeInput_2024_06_14"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamEventTypeOutput"+ }+ }+ }+ }+ },+ "tags": [+ "Teams / Event Types"]- }- },- "/v2/slots/reservations": {- "post": {- "operationId": "SlotsController_2024_09_04_reserveSlot",- "summary": "Reserve a slot",- "description": "Make a slot not available for others to book for a certain period of time. If you authenticate using oAuth credentials, api key or access token\n then you can also specify custom duration for how long the slot should be reserved for (defaults to 5 minutes).",+ },+ "get": {+ "operationId": "TeamsEventTypesController_getTeamEventTypes",+ "summary": "Get a team event type","parameters": [{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-09-04",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string",- "default": "2024-09-04"+ "type": "number"}},{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "name": "eventSlug","required": false,+ "in": "query",+ "description": "Slug of team event type to return.","schema": {"type": "string"}},{- "name": "x-cal-client-id",- "in": "header",- "description": "For platform customers - OAuth client ID",+ "name": "hostsLimit","required": false,+ "in": "query",+ "description": "Specifies the maximum number of hosts to include in the response. This limit helps optimize performance. If not provided, all Hosts will be fetched.","schema": {- "type": "string"+ "type": "number"}}],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ReserveSlotInput_2024_09_04"- }- }- }- },"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"+ "$ref": "#/components/schemas/GetTeamEventTypesOutput"}}}}},"tags": [- "Slots"+ "Teams / Event Types"]}},- "/v2/slots/reservations/{uid}": {+ "/v2/teams/{teamId}/event-types/{eventTypeId}": {"get": {- "operationId": "SlotsController_2024_09_04_getReservedSlot",- "summary": "Get reserved slot",+ "operationId": "TeamsEventTypesController_getTeamEventType",+ "summary": "Get an event type","parameters": [{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-09-04",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string",- "default": "2024-09-04"+ "type": "number"}},{- "name": "uid",+ "name": "eventTypeId","required": true,"in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,"schema": {"type": "string"}@@ -10237,34 +11178,41 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetReservedSlotOutput_2024_09_04"+ "$ref": "#/components/schemas/GetTeamEventTypeOutput"}}}}},"tags": [- "Slots"+ "Teams / Event Types"]},"patch": {- "operationId": "SlotsController_2024_09_04_updateReservedSlot",- "summary": "Updated reserved a slot",+ "operationId": "TeamsEventTypesController_updateTeamEventType",+ "summary": "Update a team event type","parameters": [{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-09-04",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string",- "default": "2024-09-04"+ "type": "number"}},{- "name": "uid",+ "name": "eventTypeId","required": true,"in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,"schema": {"type": "string"}@@ -10275,7 +11223,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/ReserveSlotInput_2024_09_04"+ "$ref": "#/components/schemas/UpdateTeamEventTypeInput_2024_06_14"}}}@@ -10286,34 +11234,41 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"+ "$ref": "#/components/schemas/UpdateTeamEventTypeOutput"}}}}},"tags": [- "Slots"+ "Teams / Event Types"]},"delete": {- "operationId": "SlotsController_2024_09_04_deleteReservedSlot",- "summary": "Delete a reserved slot",+ "operationId": "TeamsEventTypesController_deleteTeamEventType",+ "summary": "Delete a team event type","parameters": [{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-09-04",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string",- "default": "2024-09-04"+ "type": "number"}},{- "name": "uid",+ "name": "eventTypeId","required": true,"in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,"schema": {"type": "string"}@@ -10325,71 +11280,163 @@"content": {"application/json": {"schema": {- "type": "object",- "example": {- "status": "success"- }+ "$ref": "#/components/schemas/DeleteTeamEventTypeOutput"}}}}},"tags": [- "Slots"+ "Teams / Event Types"]}},- "/v2/stripe/connect": {- "get": {- "operationId": "StripeController_redirect",- "summary": "Get stripe connect URL",+ "/v2/teams/{teamId}/event-types/{eventTypeId}/create-phone-call": {+ "post": {+ "operationId": "TeamsEventTypesController_createPhoneCall",+ "summary": "Create a phone call","parameters": [{- "name": "Authorization",+ "name": "eventTypeId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "orgId","required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreatePhoneCallInput"+ }+ }+ }+ },"responses": {- "200": {+ "201": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripConnectOutputResponseDto"+ "$ref": "#/components/schemas/CreatePhoneCallOutput"}}}}},"tags": [- "Stripe"+ "Teams / Event Types"]}},- "/v2/stripe/save": {+ "/v2/teams/{teamId}/memberships": {+ "post": {+ "operationId": "TeamsMembershipsController_createTeamMembership",+ "summary": "Create a membership",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamMembershipInput"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamMembershipOutput"+ }+ }+ }+ }+ },+ "tags": [+ "Teams / Memberships"+ ]+ },"get": {- "operationId": "StripeController_save",- "summary": "Save stripe credentials",+ "operationId": "TeamsMembershipsController_getTeamMemberships",+ "summary": "Get all memberships","parameters": [{- "name": "state",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_","required": true,- "in": "query","schema": {"type": "string"}},{- "name": "code",+ "name": "teamId","required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "take",+ "required": false,+ "in": "query",+ "description": "The number of items to return",+ "example": 10,+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "skip",+ "required": false,"in": "query",+ "description": "The number of items to skip",+ "example": 0,"schema": {- "type": "string"+ "type": "number"}}],@@ -10399,30 +11446,46 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"+ "$ref": "#/components/schemas/GetTeamMembershipsOutput"}}}}},"tags": [- "Stripe"+ "Teams / Memberships"]}},- "/v2/stripe/check": {+ "/v2/teams/{teamId}/memberships/{membershipId}": {"get": {- "operationId": "StripeController_check",- "summary": "Check stripe connection",+ "operationId": "TeamsMembershipsController_getTeamMembership",+ "summary": "Get a membership","parameters": [{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_","required": true,"schema": {"type": "string"}+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "membershipId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }}],"responses": {@@ -10431,21 +11494,19 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"+ "$ref": "#/components/schemas/GetTeamMembershipOutput"}}}}},"tags": [- "Stripe"+ "Teams / Memberships"]- }- },- "/v2/teams": {- "post": {- "operationId": "TeamsController_createTeam",- "summary": "Create a team",+ },+ "patch": {+ "operationId": "TeamsMembershipsController_updateTeamMembership",+ "summary": "Create a membership","parameters": [{"name": "Authorization",@@ -10455,6 +11516,22 @@"schema": {"type": "string"}+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "membershipId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }}],"requestBody": {@@ -10462,30 +11539,30 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamInput"+ "$ref": "#/components/schemas/UpdateTeamMembershipInput"}}}},"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamOutput"+ "$ref": "#/components/schemas/UpdateTeamMembershipOutput"}}}}},"tags": [- "Teams"+ "Teams / Memberships"]},- "get": {- "operationId": "TeamsController_getTeams",- "summary": "Get teams",+ "delete": {+ "operationId": "TeamsMembershipsController_deleteTeamMembership",+ "summary": "Delete a membership","parameters": [{"name": "Authorization",@@ -10495,6 +11572,22 @@"schema": {"type": "string"}+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "membershipId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }}],"responses": {@@ -10503,76 +11596,74 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamsOutput"+ "$ref": "#/components/schemas/DeleteTeamMembershipOutput"}}}}},"tags": [- "Teams"+ "Teams / Memberships"]}},- "/v2/teams/{teamId}": {- "get": {- "operationId": "TeamsController_getTeam",- "summary": "Get a team",+ "/v2/teams/{teamId}/verified-resources/emails/verification-code/request": {+ "post": {+ "operationId": "TeamsVerifiedResourcesController_requestEmailVerificationCode",+ "summary": "Request Email Verification Code",+ "description": "Sends a verification code to the Email.","parameters": [{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"}- },- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/RequestEmailVerificationInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamOutput"+ "$ref": "#/components/schemas/RequestEmailVerificationOutput"}}}}},"tags": [- "Teams"+ "Teams Verified Resources"]- },- "patch": {- "operationId": "TeamsController_updateTeam",- "summary": "Update a team",+ }+ },+ "/v2/teams/{teamId}/verified-resources/phones/verification-code/request": {+ "post": {+ "operationId": "TeamsVerifiedResourcesController_requestPhoneVerificationCode",+ "summary": "Request Phone Number Verification Code",+ "description": "Sends a verification code to the phone number.","parameters": [{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"}- },- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }}],"requestBody": {@@ -10580,7 +11671,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateOrgTeamDto"+ "$ref": "#/components/schemas/RequestPhoneVerificationInput"}}}@@ -10591,59 +11682,73 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateTeamOutput"+ "$ref": "#/components/schemas/RequestPhoneVerificationOutput"}}}}},"tags": [- "Teams"+ "Teams Verified Resources"]- },- "delete": {- "operationId": "TeamsController_deleteTeam",- "summary": "Delete a team",+ }+ },+ "/v2/teams/{teamId}/verified-resources/emails/verification-code/verify": {+ "post": {+ "operationId": "TeamsVerifiedResourcesController_verifyEmail",+ "summary": "Verify an email for a team.",+ "description": "Use code to verify an email","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string"+ "type": "number"}},{- "name": "teamId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {- "type": "number"+ "type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/VerifyEmailInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/OrgTeamOutputResponseDto"+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"}}}}},"tags": [- "Teams"+ "Teams Verified Resources"]}},- "/v2/teams/{teamId}/event-types": {+ "/v2/teams/{teamId}/verified-resources/phones/verification-code/verify": {"post": {- "operationId": "TeamsEventTypesController_createTeamEventType",- "summary": "Create an event type",+ "operationId": "TeamsVerifiedResourcesController_verifyPhoneNumber",+ "summary": "Verify a phone number for an org team.",+ "description": "Use code to verify a phone number","parameters": [{"name": "teamId",@@ -10656,7 +11761,7 @@{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"@@ -10668,30 +11773,92 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamEventTypeInput_2024_06_14"+ "$ref": "#/components/schemas/VerifyPhoneInput"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"+ }}}}- },+ },+ "tags": [+ "Teams Verified Resources"+ ]+ }+ },+ "/v2/teams/{teamId}/verified-resources/emails": {+ "get": {+ "operationId": "TeamsVerifiedResourcesController_getVerifiedEmails",+ "summary": "Get list of verified emails of a team.",+ "parameters": [+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "take",+ "required": false,+ "in": "query",+ "description": "The number of items to return",+ "example": 10,+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "skip",+ "required": false,+ "in": "query",+ "description": "The number of items to skip",+ "example": 0,+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamEventTypeOutput"+ "$ref": "#/components/schemas/TeamVerifiedEmailsOutput"}}}}},"tags": [- "Teams / Event Types"+ "Teams Verified Resources"]- },+ }+ },+ "/v2/teams/{teamId}/verified-resources/phone-numbers": {"get": {- "operationId": "TeamsEventTypesController_getTeamEventTypes",- "summary": "Get a team event type",+ "operationId": "TeamsVerifiedResourcesController_getVerifiedPhoneNumbers",+ "summary": "Get list of verified phone numbers of a team.","parameters": [{"name": "teamId",@@ -10702,22 +11869,33 @@}},{- "name": "eventSlug",+ "name": "take","required": false,"in": "query",- "description": "Slug of team event type to return.",+ "description": "The number of items to return",+ "example": 10,"schema": {- "type": "string"+ "type": "number"}},{- "name": "hostsLimit",+ "name": "skip","required": false,"in": "query",- "description": "Specifies the maximum number of hosts to include in the response. This limit helps optimize performance. If not provided, all Hosts will be fetched.",+ "description": "The number of items to skip",+ "example": 0,"schema": {"type": "number"}+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }}],"responses": {@@ -10726,24 +11904,24 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamEventTypesOutput"+ "$ref": "#/components/schemas/TeamVerifiedPhonesOutput"}}}}},"tags": [- "Teams / Event Types"+ "Teams Verified Resources"]}},- "/v2/teams/{teamId}/event-types/{eventTypeId}": {+ "/v2/teams/{teamId}/verified-resources/emails/{id}": {"get": {- "operationId": "TeamsEventTypesController_getTeamEventType",- "summary": "Get an event type",+ "operationId": "TeamsVerifiedResourcesController_getVerifiedEmailById",+ "summary": "Get verified email of a team by id.","parameters": [{- "name": "teamId",+ "name": "id","required": true,"in": "path","schema": {@@ -10751,7 +11929,7 @@}},{- "name": "eventTypeId",+ "name": "teamId","required": true,"in": "path","schema": {@@ -10761,7 +11939,7 @@{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"@@ -10774,19 +11952,21 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamEventTypeOutput"+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"}}}}},"tags": [- "Teams / Event Types"+ "Teams Verified Resources"]- },- "patch": {- "operationId": "TeamsEventTypesController_updateTeamEventType",- "summary": "Update a team event type",+ }+ },+ "/v2/teams/{teamId}/verified-resources/phone-numbers/{id}": {+ "get": {+ "operationId": "TeamsVerifiedResourcesController_getVerifiedPhoneById",+ "summary": "Get verified phone number of a team by id.","parameters": [{"name": "teamId",@@ -10797,7 +11977,7 @@}},{- "name": "eventTypeId",+ "name": "id","required": true,"in": "path","schema": {@@ -10807,7 +11987,40 @@{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"+ }+ }+ }+ }+ },+ "tags": [+ "Teams Verified Resources"+ ]+ }+ },+ "/v2/verified-resources/emails/verification-code/request": {+ "post": {+ "operationId": "UserVerifiedResourcesController_requestEmailVerificationCode",+ "summary": "Request Email Verification Code",+ "description": "Sends a verification code to the email.",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"@@ -10819,7 +12032,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateTeamEventTypeInput_2024_06_14"+ "$ref": "#/components/schemas/RequestEmailVerificationInput"}}}@@ -10830,88 +12043,70 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateTeamEventTypeOutput"+ "$ref": "#/components/schemas/RequestEmailVerificationOutput"}}}}},"tags": [- "Teams / Event Types"+ "Verified Resources"]- },- "delete": {- "operationId": "TeamsEventTypesController_deleteTeamEventType",- "summary": "Delete a team event type",+ }+ },+ "/v2/verified-resources/phones/verification-code/request": {+ "post": {+ "operationId": "UserVerifiedResourcesController_requestPhoneVerificationCode",+ "summary": "Request Phone Number Verification Code",+ "description": "Sends a verification code to the phone number.","parameters": [- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }- },- {- "name": "eventTypeId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }- },{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/RequestPhoneVerificationInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/DeleteTeamEventTypeOutput"+ "$ref": "#/components/schemas/RequestPhoneVerificationOutput"}}}}},"tags": [- "Teams / Event Types"+ "Verified Resources"]}},- "/v2/teams/{teamId}/event-types/{eventTypeId}/create-phone-call": {+ "/v2/verified-resources/emails/verification-code/verify": {"post": {- "operationId": "TeamsEventTypesController_createPhoneCall",- "summary": "Create a phone call",+ "operationId": "UserVerifiedResourcesController_verifyEmail",+ "summary": "Verify an email.",+ "description": "Use code to verify an email","parameters": [- {- "name": "eventTypeId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }- },- {- "name": "orgId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }- },{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"@@ -10923,49 +12118,42 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreatePhoneCallInput"+ "$ref": "#/components/schemas/VerifyEmailInput"}}}},"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreatePhoneCallOutput"+ "$ref": "#/components/schemas/UserVerifiedEmailOutput"}}}}},"tags": [- "Teams / Event Types"+ "Verified Resources"]}},- "/v2/teams/{teamId}/memberships": {+ "/v2/verified-resources/phones/verification-code/verify": {"post": {- "operationId": "TeamsMembershipsController_createTeamMembership",- "summary": "Create a membership",+ "operationId": "UserVerifiedResourcesController_verifyPhoneNumber",+ "summary": "Verify a phone number.",+ "description": "Use code to verify a phone number","parameters": [{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"}- },- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }}],"requestBody": {@@ -10973,48 +12161,33 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamMembershipInput"+ "$ref": "#/components/schemas/VerifyPhoneInput"}}}},"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamMembershipOutput"+ "$ref": "#/components/schemas/UserVerifiedPhoneOutput"}}}}},"tags": [- "Teams / Memberships"+ "Verified Resources"]- },+ }+ },+ "/v2/verified-resources/emails": {"get": {- "operationId": "TeamsMembershipsController_getTeamMemberships",- "summary": "Get all memberships",+ "operationId": "UserVerifiedResourcesController_getVerifiedEmails",+ "summary": "Get list of verified emails.","parameters": [- {- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }- },{"name": "take","required": false,@@ -11034,6 +12207,15 @@"schema": {"type": "number"}+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }}],"responses": {@@ -11042,45 +12224,49 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamMembershipsOutput"+ "$ref": "#/components/schemas/UserVerifiedEmailsOutput"}}}}},"tags": [- "Teams / Memberships"+ "Verified Resources"]}},- "/v2/teams/{teamId}/memberships/{membershipId}": {+ "/v2/verified-resources/phone-numbers": {"get": {- "operationId": "TeamsMembershipsController_getTeamMembership",- "summary": "Get a membership",+ "operationId": "UserVerifiedResourcesController_getVerifiedPhoneNumbers",+ "summary": "Get list of verified phone numbers.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",- "required": true,+ "name": "take",+ "required": false,+ "in": "query",+ "description": "The number of items to return",+ "example": 10,"schema": {- "type": "string"+ "type": "number"}},{- "name": "teamId",- "required": true,- "in": "path",+ "name": "skip",+ "required": false,+ "in": "query",+ "description": "The number of items to skip",+ "example": 0,"schema": {"type": "number"}},{- "name": "membershipId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {- "type": "number"+ "type": "string"}}],@@ -11090,31 +12276,24 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamMembershipOutput"+ "$ref": "#/components/schemas/UserVerifiedPhonesOutput"}}}}},"tags": [- "Teams / Memberships"+ "Verified Resources"]- },- "patch": {- "operationId": "TeamsMembershipsController_updateTeamMembership",- "summary": "Create a membership",+ }+ },+ "/v2/verified-resources/emails/{id}": {+ "get": {+ "operationId": "UserVerifiedResourcesController_getVerifiedEmailById",+ "summary": "Get verified email by id.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "teamId",+ "name": "id","required": true,"in": "path","schema": {@@ -11122,55 +12301,39 @@}},{- "name": "membershipId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {- "type": "number"+ "type": "string"}}],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/UpdateTeamMembershipInput"- }- }- }- },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateTeamMembershipOutput"+ "$ref": "#/components/schemas/UserVerifiedEmailOutput"}}}}},"tags": [- "Teams / Memberships"+ "Verified Resources"]- },- "delete": {- "operationId": "TeamsMembershipsController_deleteTeamMembership",- "summary": "Delete a membership",+ }+ },+ "/v2/verified-resources/phone-numbers/{id}": {+ "get": {+ "operationId": "UserVerifiedResourcesController_getVerifiedPhoneById",+ "summary": "Get verified phone number by id.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "teamId",+ "name": "id","required": true,"in": "path","schema": {@@ -11178,11 +12341,12 @@}},{- "name": "membershipId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {- "type": "number"+ "type": "string"}}],@@ -11192,14 +12356,14 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/DeleteTeamMembershipOutput"+ "$ref": "#/components/schemas/UserVerifiedPhoneOutput"}}}}},"tags": [- "Teams / Memberships"+ "Verified Resources"]}},@@ -22942,36 +24106,265 @@}}},- "CalendarLink": {+ "CalendarLink": {+ "type": "object",+ "properties": {+ "label": {+ "type": "string",+ "description": "The label of the calendar link"+ },+ "link": {+ "type": "string",+ "description": "The link to the calendar"+ }+ },+ "required": [+ "label",+ "link"+ ]+ },+ "CalendarLinksOutput_2024_08_13": {+ "type": "object",+ "properties": {+ "status": {+ "type": "object",+ "description": "The status of the request, always 'success' for successful responses",+ "example": "success"+ },+ "data": {+ "description": "Calendar links for the booking",+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/CalendarLink"+ }+ }+ },+ "required": [+ "status",+ "data"+ ]+ },+ "CreateTeamMembershipInput": {+ "type": "object",+ "properties": {+ "userId": {+ "type": "number"+ },+ "accepted": {+ "type": "boolean",+ "default": false+ },+ "role": {+ "type": "string",+ "default": "MEMBER",+ "enum": [+ "MEMBER",+ "OWNER",+ "ADMIN"+ ]+ },+ "disableImpersonation": {+ "type": "boolean",+ "default": false+ }+ },+ "required": [+ "userId"+ ]+ },+ "CreateTeamMembershipOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": [+ "success",+ "error"+ ]+ },+ "data": {+ "$ref": "#/components/schemas/TeamMembershipOutput"+ }+ },+ "required": [+ "status",+ "data"+ ]+ },+ "GetTeamMembershipOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": [+ "success",+ "error"+ ]+ },+ "data": {+ "$ref": "#/components/schemas/TeamMembershipOutput"+ }+ },+ "required": [+ "status",+ "data"+ ]+ },+ "GetTeamMembershipsOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": [+ "success",+ "error"+ ]+ },+ "data": {+ "$ref": "#/components/schemas/TeamMembershipOutput"+ }+ },+ "required": [+ "status",+ "data"+ ]+ },+ "UpdateTeamMembershipInput": {+ "type": "object",+ "properties": {+ "accepted": {+ "type": "boolean"+ },+ "role": {+ "type": "string",+ "enum": [+ "MEMBER",+ "OWNER",+ "ADMIN"+ ]+ },+ "disableImpersonation": {+ "type": "boolean"+ }+ }+ },+ "UpdateTeamMembershipOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": [+ "success",+ "error"+ ]+ },+ "data": {+ "$ref": "#/components/schemas/TeamMembershipOutput"+ }+ },+ "required": [+ "status",+ "data"+ ]+ },+ "DeleteTeamMembershipOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": [+ "success",+ "error"+ ]+ },+ "data": {+ "$ref": "#/components/schemas/TeamMembershipOutput"+ }+ },+ "required": [+ "status",+ "data"+ ]+ },+ "UserWebhookOutputDto": {+ "type": "object",+ "properties": {+ "payloadTemplate": {+ "type": "string",+ "description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information",+ "example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}"+ },+ "userId": {+ "type": "number"+ },+ "id": {+ "type": "number"+ },+ "triggers": {+ "type": "array",+ "items": {+ "type": "object"+ }+ },+ "subscriberUrl": {+ "type": "string"+ },+ "active": {+ "type": "boolean"+ },+ "secret": {+ "type": "string"+ }+ },+ "required": [+ "payloadTemplate",+ "userId",+ "id",+ "triggers",+ "subscriberUrl",+ "active"+ ]+ },+ "UserWebhookOutputResponseDto": {"type": "object","properties": {- "label": {+ "status": {"type": "string",- "description": "The label of the calendar link"+ "example": "success",+ "enum": [+ "success",+ "error"+ ]},- "link": {- "type": "string",- "description": "The link to the calendar"+ "data": {+ "$ref": "#/components/schemas/UserWebhookOutputDto"}},"required": [- "label",- "link"+ "status",+ "data"]},- "CalendarLinksOutput_2024_08_13": {+ "UserWebhooksOutputResponseDto": {"type": "object","properties": {"status": {- "type": "object",- "description": "The status of the request, always 'success' for successful responses",- "example": "success"+ "type": "string",+ "example": "success",+ "enum": [+ "success",+ "error"+ ]},"data": {- "description": "Calendar links for the booking","type": "array","items": {- "$ref": "#/components/schemas/CalendarLink"+ "$ref": "#/components/schemas/UserWebhookOutputDto"}}},@@ -22980,35 +24373,46 @@"data"]},- "CreateTeamMembershipInput": {+ "EventTypeWebhookOutputDto": {"type": "object","properties": {- "userId": {+ "payloadTemplate": {+ "type": "string",+ "description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information",+ "example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}"+ },+ "eventTypeId": {"type": "number"},- "accepted": {- "type": "boolean",- "default": false+ "id": {+ "type": "number"},- "role": {- "type": "string",- "default": "MEMBER",- "enum": [- "MEMBER",- "OWNER",- "ADMIN"- ]+ "triggers": {+ "type": "array",+ "items": {+ "type": "object"+ }},- "disableImpersonation": {- "type": "boolean",- "default": false+ "subscriberUrl": {+ "type": "string"+ },+ "active": {+ "type": "boolean"+ },+ "secret": {+ "type": "string"}},"required": [- "userId"+ "payloadTemplate",+ "eventTypeId",+ "id",+ "triggers",+ "subscriberUrl",+ "active"]},- "CreateTeamMembershipOutput": {+ "EventTypeWebhookOutputResponseDto": {"type": "object","properties": {"status": {@@ -23020,7 +24424,7 @@]},"data": {- "$ref": "#/components/schemas/TeamMembershipOutput"+ "$ref": "#/components/schemas/EventTypeWebhookOutputDto"}},"required": [@@ -23028,7 +24432,7 @@"data"]},- "GetTeamMembershipOutput": {+ "EventTypeWebhooksOutputResponseDto": {"type": "object","properties": {"status": {@@ -23040,7 +24444,10 @@]},"data": {- "$ref": "#/components/schemas/TeamMembershipOutput"+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/EventTypeWebhookOutputDto"+ }}},"required": [@@ -23048,7 +24455,7 @@"data"]},- "GetTeamMembershipsOutput": {+ "DeleteManyWebhooksOutputResponseDto": {"type": "object","properties": {"status": {@@ -23060,7 +24467,7 @@]},"data": {- "$ref": "#/components/schemas/TeamMembershipOutput"+ "type": "string"}},"required": [@@ -23068,26 +24475,46 @@"data"]},- "UpdateTeamMembershipInput": {+ "OAuthClientWebhookOutputDto": {"type": "object","properties": {- "accepted": {- "type": "boolean"- },- "role": {+ "payloadTemplate": {"type": "string",- "enum": [- "MEMBER",- "OWNER",- "ADMIN"- ]+ "description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information",+ "example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}"},- "disableImpersonation": {+ "oAuthClientId": {+ "type": "string"+ },+ "id": {+ "type": "number"+ },+ "triggers": {+ "type": "array",+ "items": {+ "type": "object"+ }+ },+ "subscriberUrl": {+ "type": "string"+ },+ "active": {"type": "boolean"+ },+ "secret": {+ "type": "string"}- }+ },+ "required": [+ "payloadTemplate",+ "oAuthClientId",+ "id",+ "triggers",+ "subscriberUrl",+ "active"+ ]},- "UpdateTeamMembershipOutput": {+ "OAuthClientWebhookOutputResponseDto": {"type": "object","properties": {"status": {@@ -23099,7 +24526,7 @@]},"data": {- "$ref": "#/components/schemas/TeamMembershipOutput"+ "$ref": "#/components/schemas/OAuthClientWebhookOutputDto"}},"required": [@@ -23107,7 +24534,7 @@"data"]},- "DeleteTeamMembershipOutput": {+ "OAuthClientWebhooksOutputResponseDto": {"type": "object","properties": {"status": {@@ -23119,7 +24546,10 @@]},"data": {- "$ref": "#/components/schemas/TeamMembershipOutput"+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/OAuthClientWebhookOutputDto"+ }}},"required": [@@ -23127,46 +24557,120 @@"data"]},- "UserWebhookOutputDto": {+ "DestinationCalendarsInputBodyDto": {"type": "object","properties": {- "payloadTemplate": {+ "integration": {"type": "string",- "description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information",- "example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}"+ "example": "apple_calendar",+ "description": "The calendar service you want to integrate, as returned by the /calendars endpoint",+ "enum": [+ "apple_calendar",+ "google_calendar",+ "office365_calendar"+ ]},- "userId": {- "type": "number"+ "externalId": {+ "type": "string",+ "example": "https://caldav.icloud.com/26962146906/calendars/1644422A-1945-4438-BBC0-4F0Q23A57R7S/",+ "description": "Unique identifier used to represent the specific calendar, as returned by the /calendars endpoint"},- "id": {+ "delegationCredentialId": {+ "type": "string"+ }+ },+ "required": [+ "integration",+ "externalId"+ ]+ },+ "DestinationCalendarsOutputDto": {+ "type": "object",+ "properties": {+ "userId": {"type": "number"},- "triggers": {- "type": "array",- "items": {- "type": "object"- }+ "integration": {+ "type": "string"},- "subscriberUrl": {+ "externalId": {"type": "string"},- "active": {- "type": "boolean"+ "credentialId": {+ "type": "number",+ "nullable": true+ }+ },+ "required": [+ "userId",+ "integration",+ "externalId",+ "credentialId"+ ]+ },+ "DestinationCalendarsOutputResponseDto": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": [+ "success",+ "error"+ ]},- "secret": {- "type": "string"+ "data": {+ "$ref": "#/components/schemas/DestinationCalendarsOutputDto"+ }+ },+ "required": [+ "status",+ "data"+ ]+ },+ "RequestEmailVerificationInput": {+ "type": "object",+ "properties": {+ "email": {+ "type": "string",+ "description": "Email to verify.",+ "example": "[email protected]"+ }+ },+ "required": [+ "email"+ ]+ },+ "RequestEmailVerificationOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": [+ "success",+ "error"+ ]+ }+ },+ "required": [+ "status"+ ]+ },+ "RequestPhoneVerificationInput": {+ "type": "object",+ "properties": {+ "phone": {+ "type": "string",+ "description": "Phone number to verify.",+ "example": "+372 5555 6666"}},"required": [- "payloadTemplate",- "userId",- "id",- "triggers",- "subscriberUrl",- "active"+ "phone"]},- "UserWebhookOutputResponseDto": {+ "RequestPhoneVerificationOutput": {"type": "object","properties": {"status": {@@ -23176,79 +24680,165 @@"success","error"]- },- "data": {- "$ref": "#/components/schemas/UserWebhookOutputDto"}},"required": [- "status",- "data"+ "status"]},- "UserWebhooksOutputResponseDto": {+ "VerifyEmailInput": {"type": "object","properties": {- "status": {+ "email": {"type": "string",- "example": "success",- "enum": [- "success",- "error"- ]+ "description": "Email to verify.",+ "example": "[email protected]"},- "data": {+ "code": {+ "type": "string",+ "description": "verification code sent to the email to verify",+ "example": "1ABG2C"+ }+ },+ "required": [+ "email",+ "code"+ ]+ },+ "WorkingHours": {+ "type": "object",+ "properties": {+ "days": {"type": "array","items": {- "$ref": "#/components/schemas/UserWebhookOutputDto"+ "type": "number"}+ },+ "startTime": {+ "type": "number"+ },+ "endTime": {+ "type": "number"+ },+ "userId": {+ "type": "number",+ "nullable": true}},"required": [- "status",- "data"+ "days",+ "startTime",+ "endTime"]},- "EventTypeWebhookOutputDto": {+ "AvailabilityModel": {"type": "object","properties": {- "payloadTemplate": {- "type": "string",- "description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information",- "example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}"+ "id": {+ "type": "number"+ },+ "userId": {+ "type": "number",+ "nullable": true},"eventTypeId": {- "type": "number"+ "type": "number",+ "nullable": true+ },+ "days": {+ "type": "array",+ "items": {+ "type": "number"+ }+ },+ "startTime": {+ "format": "date-time",+ "type": "string"+ },+ "endTime": {+ "format": "date-time",+ "type": "string"+ },+ "date": {+ "format": "date-time",+ "type": "string",+ "nullable": true},+ "scheduleId": {+ "type": "number",+ "nullable": true+ }+ },+ "required": [+ "id",+ "days",+ "startTime",+ "endTime"+ ]+ },+ "ScheduleOutput": {+ "type": "object",+ "properties": {"id": {"type": "number"},- "triggers": {+ "name": {+ "type": "string"+ },+ "isManaged": {+ "type": "boolean"+ },+ "workingHours": {"type": "array","items": {- "type": "object"+ "$ref": "#/components/schemas/WorkingHours"}},- "subscriberUrl": {+ "schedule": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/AvailabilityModel"+ }+ },+ "availability": {+ "items": {+ "type": "array"+ },+ "type": "array"+ },+ "timeZone": {"type": "string"},- "active": {+ "dateOverrides": {+ "type": "array",+ "items": {+ "type": "object"+ }+ },+ "isDefault": {"type": "boolean"},- "secret": {- "type": "string"+ "isLastSchedule": {+ "type": "boolean"+ },+ "readOnly": {+ "type": "boolean"}},"required": [- "payloadTemplate",- "eventTypeId","id",- "triggers",- "subscriberUrl",- "active"+ "name",+ "isManaged",+ "workingHours",+ "schedule",+ "availability",+ "timeZone",+ "isDefault",+ "isLastSchedule",+ "readOnly"]},- "EventTypeWebhookOutputResponseDto": {+ "UserVerifiedEmailOutput": {"type": "object","properties": {"status": {@@ -23260,7 +24850,7 @@]},"data": {- "$ref": "#/components/schemas/EventTypeWebhookOutputDto"+ "$ref": "#/components/schemas/ScheduleOutput"}},"required": [@@ -23268,7 +24858,26 @@"data"]},- "EventTypeWebhooksOutputResponseDto": {+ "VerifyPhoneInput": {+ "type": "object",+ "properties": {+ "phone": {+ "type": "string",+ "description": "phone number to verify.",+ "example": "+37255556666"+ },+ "code": {+ "type": "string",+ "description": "verification code sent to the phone number to verify",+ "example": "1ABG2C"+ }+ },+ "required": [+ "phone",+ "code"+ ]+ },+ "UserVerifiedPhoneOutput": {"type": "object","properties": {"status": {@@ -23280,10 +24889,7 @@]},"data": {- "type": "array",- "items": {- "$ref": "#/components/schemas/EventTypeWebhookOutputDto"- }+ "$ref": "#/components/schemas/ScheduleOutput"}},"required": [@@ -23291,7 +24897,7 @@"data"]},- "DeleteManyWebhooksOutputResponseDto": {+ "UserVerifiedEmailsOutput": {"type": "object","properties": {"status": {@@ -23303,7 +24909,7 @@]},"data": {- "type": "string"+ "$ref": "#/components/schemas/ScheduleOutput"}},"required": [@@ -23311,46 +24917,27 @@"data"]},- "OAuthClientWebhookOutputDto": {+ "UserVerifiedPhonesOutput": {"type": "object","properties": {- "payloadTemplate": {+ "status": {"type": "string",- "description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information",- "example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}"- },- "oAuthClientId": {- "type": "string"- },- "id": {- "type": "number"- },- "triggers": {- "type": "array",- "items": {- "type": "object"- }- },- "subscriberUrl": {- "type": "string"- },- "active": {- "type": "boolean"+ "example": "success",+ "enum": [+ "success",+ "error"+ ]},- "secret": {- "type": "string"+ "data": {+ "$ref": "#/components/schemas/ScheduleOutput"}},"required": [- "payloadTemplate",- "oAuthClientId",- "id",- "triggers",- "subscriberUrl",- "active"+ "status",+ "data"]},- "OAuthClientWebhookOutputResponseDto": {+ "TeamVerifiedEmailOutput": {"type": "object","properties": {"status": {@@ -23362,7 +24949,7 @@]},"data": {- "$ref": "#/components/schemas/OAuthClientWebhookOutputDto"+ "$ref": "#/components/schemas/ScheduleOutput"}},"required": [@@ -23370,7 +24957,7 @@"data"]},- "OAuthClientWebhooksOutputResponseDto": {+ "TeamVerifiedPhoneOutput": {"type": "object","properties": {"status": {@@ -23382,10 +24969,7 @@]},"data": {- "type": "array",- "items": {- "$ref": "#/components/schemas/OAuthClientWebhookOutputDto"- }+ "$ref": "#/components/schemas/ScheduleOutput"}},"required": [@@ -23393,58 +24977,27 @@"data"]},- "DestinationCalendarsInputBodyDto": {+ "TeamVerifiedEmailsOutput": {"type": "object","properties": {- "integration": {+ "status": {"type": "string",- "example": "apple_calendar",- "description": "The calendar service you want to integrate, as returned by the /calendars endpoint",+ "example": "success","enum": [- "apple_calendar",- "google_calendar",- "office365_calendar"+ "success",+ "error"]},- "externalId": {- "type": "string",- "example": "https://caldav.icloud.com/26962146906/calendars/1644422A-1945-4438-BBC0-4F0Q23A57R7S/",- "description": "Unique identifier used to represent the specific calendar, as returned by the /calendars endpoint"- },- "delegationCredentialId": {- "type": "string"- }- },- "required": [- "integration",- "externalId"- ]- },- "DestinationCalendarsOutputDto": {- "type": "object",- "properties": {- "userId": {- "type": "number"- },- "integration": {- "type": "string"- },- "externalId": {- "type": "string"- },- "credentialId": {- "type": "number",- "nullable": true+ "data": {+ "$ref": "#/components/schemas/ScheduleOutput"}},"required": [- "userId",- "integration",- "externalId",- "credentialId"+ "status",+ "data"]},- "DestinationCalendarsOutputResponseDto": {+ "TeamVerifiedPhonesOutput": {"type": "object","properties": {"status": {@@ -23456,7 +25009,7 @@]},"data": {- "$ref": "#/components/schemas/DestinationCalendarsOutputDto"+ "$ref": "#/components/schemas/ScheduleOutput"}},"required": [diff --git a/apps/api/v2/test/fixtures/repository/verified-resources.repository.fixture.ts b/apps/api/v2/test/fixtures/repository/verified-resources.repository.fixture.tsnew file mode 100644index 00000000000..72c8b1722af--- /dev/null+++ b/apps/api/v2/test/fixtures/repository/verified-resources.repository.fixture.ts@@ -0,0 +1,26 @@+import { PrismaReadService } from "@/modules/prisma/prisma-read.service";+import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";+import { TestingModule } from "@nestjs/testing";+import { Prisma } from "@prisma/client";++export class VerifiedResourcesRepositoryFixtures {+ private prismaReadClient: PrismaReadService["prisma"];+ private prismaWriteClient: PrismaWriteService["prisma"];++ constructor(private readonly module: TestingModule) {+ this.prismaReadClient = module.get(PrismaReadService).prisma;+ this.prismaWriteClient = module.get(PrismaWriteService).prisma;+ }++ async createPhone(data: Prisma.VerifiedNumberCreateInput) {+ return this.prismaWriteClient.verifiedNumber.create({ data });+ }++ async deleteEmailById(id: number) {+ return this.prismaWriteClient.verifiedEmail.delete({ where: { id } });+ }++ async deletePhoneById(id: number) {+ return this.prismaWriteClient.verifiedNumber.delete({ where: { id } });+ }+}diff --git a/docs/api-reference/v2/openapi.json b/docs/api-reference/v2/openapi.jsonindex cf5ac9c7781..de1f3d7bec9 100644--- a/docs/api-reference/v2/openapi.json+++ b/docs/api-reference/v2/openapi.json@@ -8872,71 +8872,93 @@"tags": ["OAuth Clients"]}},- "/v2/organizations/{orgId}/teams/{teamId}/stripe/connect": {- "get": {- "operationId": "OrganizationsStripeController_getTeamStripeConnectUrl",- "summary": "Get stripe connect URL for a team",+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/verification-code/request": {+ "post": {+ "operationId": "OrgTeamsVerifiedResourcesController_requestEmailVerificationCode",+ "summary": "Request Email Verification Code",+ "description": "Sends a verification code to the email.","parameters": [{"name": "Authorization",- "required": true,"in": "header",- "schema": {- "type": "string"- }- },- {- "name": "teamId",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {"type": "string"}- },- {- "name": "orgId",- "required": true,- "in": "path",- "schema": {- "type": "string"+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/RequestEmailVerificationInput"+ }}- },- {- "name": "returnTo",- "required": true,- "in": "query",- "schema": {- "type": "string"+ }+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/RequestEmailVerificationOutput"+ }+ }}- },+ }+ },+ "tags": ["Organization Team Verified Resources"]+ }+ },+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/verification-code/request": {+ "post": {+ "operationId": "OrgTeamsVerifiedResourcesController_requestPhoneVerificationCode",+ "summary": "Request Phone Number Verification Code",+ "description": "Sends a verification code to the phone number.",+ "parameters": [{- "name": "onErrorReturnTo",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "query","schema": {"type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/RequestPhoneVerificationInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripConnectOutputResponseDto"+ "$ref": "#/components/schemas/RequestPhoneVerificationOutput"}}}}},- "tags": ["Organizations/Teams Stripe"]+ "tags": ["Organization Team Verified Resources"]}},- "/v2/organizations/{orgId}/teams/{teamId}/stripe/check": {- "get": {- "operationId": "OrganizationsStripeController_checkTeamStripeConnection",- "summary": "Check team stripe connection",+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/verification-code/verify": {+ "post": {+ "operationId": "OrgTeamsVerifiedResourcesController_verifyEmail",+ "summary": "Verify an email for an org team.",+ "description": "Use code to verify an email","parameters": [{"name": "teamId",@@ -8945,138 +8967,187 @@"schema": {"type": "number"}+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/VerifyEmailInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"}}}}},- "tags": ["Organizations/Teams Stripe"]+ "tags": ["Organization Team Verified Resources"]}},- "/v2/organizations/{orgId}/teams/{teamId}/stripe/save": {- "get": {- "operationId": "OrganizationsStripeController_save",- "summary": "Save stripe credentials",+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/verification-code/verify": {+ "post": {+ "operationId": "OrgTeamsVerifiedResourcesController_verifyPhoneNumber",+ "summary": "Verify a phone number for an org team.",+ "description": "Use code to verify a phone number","parameters": [{- "name": "state",+ "name": "teamId","required": true,- "in": "query",+ "in": "path","schema": {- "type": "string"+ "type": "number"}},{- "name": "code",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "query","schema": {"type": "string"}- },- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/VerifyPhoneInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"+ "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"}}}}},- "tags": ["Organizations/Teams Stripe"]+ "tags": ["Organization Team Verified Resources"]}},- "/v2/routing-forms/{routingFormId}/calculate-slots": {- "post": {- "operationId": "RoutingFormsController_calculateSlotsBasedOnRoutingFormResponse",- "summary": "Calculate slots based on routing form response",- "description": "It will not actually save the response just return the routed event type and slots when it can be booked.",+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails": {+ "get": {+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedEmails",+ "summary": "Get list of verified emails of an org team.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string"+ "type": "number"}},{- "name": "start",- "required": true,+ "name": "take",+ "required": false,"in": "query",- "description": "\n Time starting from which available slots should be checked.\n \n Must be in UTC timezone as ISO 8601 datestring.\n \n You can pass date without hours which defaults to start of day or specify hours:\n 2024-08-13 (will have hours 00:00:00 aka at very beginning of the date) or you can specify hours manually like 2024-08-13T09:00:00Z\n ",- "example": "2050-09-05",+ "description": "The number of items to return",+ "example": 10,"schema": {- "type": "string"+ "type": "number"}},{- "name": "end",- "required": true,+ "name": "skip",+ "required": false,"in": "query",- "description": "\n Time until which available slots should be checked.\n \n Must be in UTC timezone as ISO 8601 datestring.\n \n You can pass date without hours which defaults to end of day or specify hours:\n 2024-08-20 (will have hours 23:59:59 aka at the very end of the date) or you can specify hours manually like 2024-08-20T18:00:00Z",- "example": "2050-09-06",+ "description": "The number of items to skip",+ "example": 0,"schema": {- "type": "string"+ "type": "number"}},{- "name": "timeZone",- "required": false,- "in": "query",- "description": "Time zone in which the available slots should be returned. Defaults to UTC.",- "example": "Europe/Rome",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,"schema": {"type": "string"}+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/TeamVerifiedEmailsOutput"+ }+ }+ }+ }+ },+ "tags": ["Organization Team Verified Resources"]+ }+ },+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phone-numbers": {+ "get": {+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedPhoneNumbers",+ "summary": "Get list of verified phone numbers of an org team.",+ "parameters": [+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }},{- "name": "duration",+ "name": "take","required": false,"in": "query",- "description": "If event type has multiple possible durations then you can specify the desired duration here. Also, if you are fetching slots for a dynamic event then you can specify the duration her which defaults to 30, meaning that returned slots will be each 30 minutes long.",- "example": "60",+ "description": "The number of items to return",+ "example": 10,"schema": {"type": "number"}},{- "name": "format",+ "name": "skip","required": false,"in": "query",- "description": "Format of slot times in response. Use 'range' to get start and end times.",- "example": "range",+ "description": "The number of items to skip",+ "example": 0,"schema": {- "enum": ["range", "time"],- "type": "string"+ "type": "number"}},{- "name": "routingFormId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {"type": "string"}@@ -9088,87 +9159,89 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/ResponseSlotsOutput"+ "$ref": "#/components/schemas/TeamVerifiedPhonesOutput"}}}}},- "tags": ["Routing forms"]+ "tags": ["Organization Team Verified Resources"]}},- "/v2/schedules": {- "post": {- "operationId": "SchedulesController_2024_06_11_createSchedule",- "summary": "Create a schedule",- "description": "\n Create a schedule for the authenticated user.\n\n The point of creating schedules is for event types to be available at specific times.\n\n The first goal of schedules is to have a default schedule. If you are platform customer and created managed users, then it is important to note that each managed user should have a default schedule.\n 1. If you passed `timeZone` when creating managed user, then the default schedule from Monday to Friday from 9AM to 5PM will be created with that timezone. The managed user can then change the default schedule via the `AvailabilitySettings` atom.\n 2. If you did not, then we assume you want the user to have this specific schedule right away. You should create a default schedule by specifying\n `\"isDefault\": true` in the request body. Until the user has a default schedule the user can't be booked nor manage their schedule via the AvailabilitySettings atom.\n\n The second goal of schedules is to create another schedule that event types can point to. This is useful for when an event is booked because availability is not checked against the default schedule but instead against that specific schedule.\n After creating a non-default schedule, you can update an event type to point to that schedule via the PATCH `event-types/{eventTypeId}` endpoint.\n\n When specifying start time and end time for each day use the 24 hour format e.g. 08:00, 15:00 etc.\n ",+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/{id}": {+ "get": {+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedEmailById",+ "summary": "Get verified email of an org team by id.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "name": "id","required": true,+ "in": "path","schema": {- "type": "string"+ "type": "number"}},{- "name": "cal-api-version",+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization","in": "header",- "description": "Must be set to 2024-06-11",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {- "type": "string",- "default": "2024-06-11"+ "type": "string"}}],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/CreateScheduleInput_2024_06_11"- }- }- }- },"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateScheduleOutput_2024_06_11"+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"}}}}},- "tags": ["Schedules"]- },+ "tags": ["Organization Team Verified Resources"]+ }+ },+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phone-numbers/{id}": {"get": {- "operationId": "SchedulesController_2024_06_11_getSchedules",- "summary": "Get all schedules",- "description": "Get all schedules of the authenticated user.",+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedPhoneById",+ "summary": "Get verified phone number of an org team by id.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string"+ "type": "number"}},{- "name": "cal-api-version",+ "name": "id",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization","in": "header",- "description": "Must be set to 2024-06-11",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {- "type": "string",- "default": "2024-06-11"+ "type": "string"}}],@@ -9178,38 +9251,58 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"+ "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"}}}}},- "tags": ["Schedules"]+ "tags": ["Organization Team Verified Resources"]}},- "/v2/schedules/default": {+ "/v2/organizations/{orgId}/teams/{teamId}/stripe/connect": {"get": {- "operationId": "SchedulesController_2024_06_11_getDefaultSchedule",- "summary": "Get default schedule",- "description": "Get the default schedule of the authenticated user.",+ "operationId": "OrganizationsStripeController_getTeamStripeConnectUrl",+ "summary": "Get stripe connect URL for a team","parameters": [{"name": "Authorization",+ "required": true,"in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "teamId","required": true,+ "in": "path","schema": {"type": "string"}},{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-06-11",+ "name": "orgId","required": true,+ "in": "path","schema": {- "type": "string",- "default": "2024-06-11"+ "type": "string"+ }+ },+ {+ "name": "returnTo",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "onErrorReturnTo",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"}}],@@ -9219,41 +9312,22 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetDefaultScheduleOutput_2024_06_11"+ "$ref": "#/components/schemas/StripConnectOutputResponseDto"}}}}},- "tags": ["Schedules"]+ "tags": ["Organizations/Teams Stripe"]}},- "/v2/schedules/{scheduleId}": {+ "/v2/organizations/{orgId}/teams/{teamId}/stripe/check": {"get": {- "operationId": "SchedulesController_2024_06_11_getSchedule",- "summary": "Get a schedule",+ "operationId": "OrganizationsStripeController_checkTeamStripeConnection",+ "summary": "Check team stripe connection","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-06-11",- "required": true,- "schema": {- "type": "string",- "default": "2024-06-11"- }- },- {- "name": "scheduleId",+ "name": "teamId","required": true,"in": "path","schema": {@@ -9267,100 +9341,133 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetScheduleOutput_2024_06_11"+ "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"}}}}},- "tags": ["Schedules"]- },- "patch": {- "operationId": "SchedulesController_2024_06_11_updateSchedule",- "summary": "Update a schedule",+ "tags": ["Organizations/Teams Stripe"]+ }+ },+ "/v2/organizations/{orgId}/teams/{teamId}/stripe/save": {+ "get": {+ "operationId": "OrganizationsStripeController_save",+ "summary": "Save stripe credentials","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "name": "state","required": true,+ "in": "query","schema": {"type": "string"}},{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-06-11",+ "name": "code","required": true,+ "in": "query","schema": {- "type": "string",- "default": "2024-06-11"+ "type": "string"}},{- "name": "scheduleId",+ "name": "teamId","required": true,"in": "path","schema": {- "type": "string"+ "type": "number"}}],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/UpdateScheduleInput_2024_06_11"- }- }- }- },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateScheduleOutput_2024_06_11"+ "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"}}}}},- "tags": ["Schedules"]- },- "delete": {- "operationId": "SchedulesController_2024_06_11_deleteSchedule",- "summary": "Delete a schedule",+ "tags": ["Organizations/Teams Stripe"]+ }+ },+ "/v2/routing-forms/{routingFormId}/calculate-slots": {+ "post": {+ "operationId": "RoutingFormsController_calculateSlotsBasedOnRoutingFormResponse",+ "summary": "Calculate slots based on routing form response",+ "description": "It will not actually save the response just return the routed event type and slots when it can be booked.","parameters": [{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_","required": true,"schema": {"type": "string"}},{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-06-11",+ "name": "start","required": true,+ "in": "query",+ "description": "\n Time starting from which available slots should be checked.\n \n Must be in UTC timezone as ISO 8601 datestring.\n \n You can pass date without hours which defaults to start of day or specify hours:\n 2024-08-13 (will have hours 00:00:00 aka at very beginning of the date) or you can specify hours manually like 2024-08-13T09:00:00Z\n ",+ "example": "2050-09-05","schema": {- "type": "string",- "default": "2024-06-11"+ "type": "string"}},{- "name": "scheduleId",+ "name": "end","required": true,- "in": "path",+ "in": "query",+ "description": "\n Time until which available slots should be checked.\n \n Must be in UTC timezone as ISO 8601 datestring.\n \n You can pass date without hours which defaults to end of day or specify hours:\n 2024-08-20 (will have hours 23:59:59 aka at the very end of the date) or you can specify hours manually like 2024-08-20T18:00:00Z",+ "example": "2050-09-06",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "timeZone",+ "required": false,+ "in": "query",+ "description": "Time zone in which the available slots should be returned. Defaults to UTC.",+ "example": "Europe/Rome",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "duration",+ "required": false,+ "in": "query",+ "description": "If event type has multiple possible durations then you can specify the desired duration here. Also, if you are fetching slots for a dynamic event then you can specify the duration her which defaults to 30, meaning that returned slots will be each 30 minutes long.",+ "example": "60","schema": {"type": "number"}+ },+ {+ "name": "format",+ "required": false,+ "in": "query",+ "description": "Format of slot times in response. Use 'range' to get start and end times.",+ "example": "range",+ "schema": {+ "enum": ["range", "time"],+ "type": "string"+ }+ },+ {+ "name": "routingFormId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }}],"responses": {@@ -9369,19 +9476,20 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/DeleteScheduleOutput_2024_06_11"+ "$ref": "#/components/schemas/ResponseSlotsOutput"}}}}},- "tags": ["Schedules"]+ "tags": ["Routing forms"]}},- "/v2/selected-calendars": {+ "/v2/schedules": {"post": {- "operationId": "SelectedCalendarsController_addSelectedCalendar",- "summary": "Add a selected calendar",+ "operationId": "SchedulesController_2024_06_11_createSchedule",+ "summary": "Create a schedule",+ "description": "\n Create a schedule for the authenticated user.\n\n The point of creating schedules is for event types to be available at specific times.\n\n The first goal of schedules is to have a default schedule. If you are platform customer and created managed users, then it is important to note that each managed user should have a default schedule.\n 1. If you passed `timeZone` when creating managed user, then the default schedule from Monday to Friday from 9AM to 5PM will be created with that timezone. The managed user can then change the default schedule via the `AvailabilitySettings` atom.\n 2. If you did not, then we assume you want the user to have this specific schedule right away. You should create a default schedule by specifying\n `\"isDefault\": true` in the request body. Until the user has a default schedule the user can't be booked nor manage their schedule via the AvailabilitySettings atom.\n\n The second goal of schedules is to create another schedule that event types can point to. This is useful for when an event is booked because availability is not checked against the default schedule but instead against that specific schedule.\n After creating a non-default schedule, you can update an event type to point to that schedule via the PATCH `event-types/{eventTypeId}` endpoint.\n\n When specifying start time and end time for each day use the 24 hour format e.g. 08:00, 15:00 etc.\n ","parameters": [{"name": "Authorization",@@ -9391,6 +9499,16 @@"schema": {"type": "string"}+ },+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-06-11"+ }}],"requestBody": {@@ -9398,7 +9516,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/SelectedCalendarsInputDto"+ "$ref": "#/components/schemas/CreateScheduleInput_2024_06_11"}}}@@ -9409,17 +9527,18 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"+ "$ref": "#/components/schemas/CreateScheduleOutput_2024_06_11"}}}}},- "tags": ["Selected Calendars"]+ "tags": ["Schedules"]},- "delete": {- "operationId": "SelectedCalendarsController_deleteSelectedCalendar",- "summary": "Delete a selected calendar",+ "get": {+ "operationId": "SchedulesController_2024_06_11_getSchedules",+ "summary": "Get all schedules",+ "description": "Get all schedules of the authenticated user.","parameters": [{"name": "Authorization",@@ -9431,35 +9550,54 @@}},{- "name": "integration",+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11","required": true,- "in": "query","schema": {- "type": "string"- }- },- {- "name": "externalId",- "required": true,- "in": "query",- "schema": {- "type": "string"+ "type": "string",+ "default": "2024-06-11"}- },+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"+ }+ }+ }+ }+ },+ "tags": ["Schedules"]+ }+ },+ "/v2/schedules/default": {+ "get": {+ "operationId": "SchedulesController_2024_06_11_getDefaultSchedule",+ "summary": "Get default schedule",+ "description": "Get the default schedule of the authenticated user.",+ "parameters": [{- "name": "credentialId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "query","schema": {"type": "string"}},{- "name": "delegationCredentialId",- "required": false,- "in": "query",+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11",+ "required": true,"schema": {- "type": "string"+ "type": "string",+ "default": "2024-06-11"}}],@@ -9469,138 +9607,388 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"+ "$ref": "#/components/schemas/GetDefaultScheduleOutput_2024_06_11"}}}}},- "tags": ["Selected Calendars"]+ "tags": ["Schedules"]}},- "/v2/slots": {+ "/v2/schedules/{scheduleId}": {"get": {- "operationId": "SlotsController_2024_09_04_getAvailableSlots",- "summary": "Find out when is an event type ready to be booked.",- "description": "\n There are 4 ways to get available slots for event type of an individual user:\n\n 1. By event type id. Event type id can be of user and team event types. Example '/v2/slots?eventTypeId=10&start=2050-09-05&end=2050-09-06&timeZone=Europe/Rome'\n\n 2. By event type slug + username. Example '/v2/slots?eventTypeSlug=intro&username=bob&start=2050-09-05&end=2050-09-06'\n\n 3. By event type slug + username + organization slug when searching within an organization. Example '/v2/slots?organizationSlug=org-slug&eventTypeSlug=intro&username=bob&start=2050-09-05&end=2050-09-06'\n\n 4. By usernames only (used for dynamic event type - there is no specific event but you want to know when 2 or more people are available). Example '/v2/slots?usernames=alice,bob&username=bob&organizationSlug=org-slug&start=2050-09-05&end=2050-09-06'. As you see you also need to provide the slug of the organization to which each user in the 'usernames' array belongs.\n\n And 3 ways to get available slots for team event type:\n\n 1. By team event type id. Example '/v2/slots?eventTypeId=10&start=2050-09-05&end=2050-09-06&timeZone=Europe/Rome'\n\n 2. By team event type slug + team slug. Example '/v2/slots?eventTypeSlug=intro&teamSlug=team-slug&start=2050-09-05&end=2050-09-06'\n\n 3. By team event type slug + team slug + organization slug when searching within an organization. Example '/v2/slots?organizationSlug=org-slug&eventTypeSlug=intro&teamSlug=team-slug&start=2050-09-05&end=2050-09-06'\n\n All of them require \"start\" and \"end\" query parameters which define the time range for which available slots should be checked.\n Optional parameters are:\n - timeZone: Time zone in which the available slots should be returned. Defaults to UTC.\n - duration: Only use for event types that allow multiple durations or for dynamic event types. If not passed for multiple duration event types defaults to default duration. For dynamic event types defaults to 30 aka each returned slot is 30 minutes long. So duration=60 means that returned slots will be each 60 minutes long.\n - slotFormat: Format of the slots. By default return is an object where each key is date and value is array of slots as string. If you want to get start and end of each slot use \"range\" as value.\n ",+ "operationId": "SchedulesController_2024_06_11_getSchedule",+ "summary": "Get a schedule","parameters": [{- "name": "cal-api-version",+ "name": "Authorization","in": "header",- "description": "Must be set to 2024-09-04",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {- "type": "string",- "default": "2024-09-04"+ "type": "string"}},{- "name": "start",+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11","required": true,- "in": "query",- "description": "\n Time starting from which available slots should be checked.\n\n Must be in UTC timezone as ISO 8601 datestring.\n\n You can pass date without hours which defaults to start of day or specify hours:\n 2024-08-13 (will have hours 00:00:00 aka at very beginning of the date) or you can specify hours manually like 2024-08-13T09:00:00Z.",- "example": "2050-09-05",- "schema": {}+ "schema": {+ "type": "string",+ "default": "2024-06-11"+ }},{- "name": "end",+ "name": "scheduleId","required": true,- "in": "query",- "description": "\n Time until which available slots should be checked.\n\n Must be in UTC timezone as ISO 8601 datestring.\n\n You can pass date without hours which defaults to end of day or specify hours:\n 2024-08-20 (will have hours 23:59:59 aka at the very end of the date) or you can specify hours manually like 2024-08-20T18:00:00Z.",- "example": "2050-09-06",- "schema": {}- },- {- "name": "organizationSlug",- "required": false,- "in": "query",- "description": "The slug of the organization to which user with username belongs or team with teamSlug belongs.",- "example": "org-slug",- "schema": {}- },- {- "name": "teamSlug",- "required": false,- "in": "query",- "description": "The slug of the team who owns event type with eventTypeSlug - used when slots are checked for team event type.",- "example": "team-slug",- "schema": {}- },- {- "name": "username",- "required": false,- "in": "query",- "description": "The username of the user who owns event type with eventTypeSlug - used when slots are checked for individual user event type.",- "example": "bob",- "schema": {}- },+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GetScheduleOutput_2024_06_11"+ }+ }+ }+ }+ },+ "tags": ["Schedules"]+ },+ "patch": {+ "operationId": "SchedulesController_2024_06_11_updateSchedule",+ "summary": "Update a schedule",+ "parameters": [{- "name": "eventTypeSlug",- "required": false,- "in": "query",- "description": "The slug of the event type for which available slots should be checked. If slug is provided then username or teamSlug must be provided too and if relevant organizationSlug too.",- "example": "event-type-slug",- "schema": {}+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }},{- "name": "eventTypeId",- "required": false,- "in": "query",- "description": "The ID of the event type for which available slots should be checked.",- "example": "100",- "schema": {}+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-06-11"+ }},{- "name": "usernames",- "required": false,- "in": "query",- "description": "The usernames for which available slots should be checked separated by a comma.\n\n Checking slots by usernames is used mainly for dynamic events where there is no specific event but we just want to know when 2 or more people are available.\n\n Must contain at least 2 usernames.",- "example": "alice,bob",- "schema": {}- },+ "name": "scheduleId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/UpdateScheduleInput_2024_06_11"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/UpdateScheduleOutput_2024_06_11"+ }+ }+ }+ }+ },+ "tags": ["Schedules"]+ },+ "delete": {+ "operationId": "SchedulesController_2024_06_11_deleteSchedule",+ "summary": "Delete a schedule",+ "parameters": [{- "name": "slotFormat",- "required": false,- "in": "query",- "description": "Format of slot times in response. Use 'range' to get start and end times. Use 'time' or omit this query parameter to get only start time.",- "example": "range",- "schema": {}+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }},{- "name": "duration",- "required": false,- "in": "query",- "description": "If event type has multiple possible durations then you can specify the desired duration here. Also, if you are fetching slots for a dynamic event then you can specify the duration her which defaults to 30, meaning that returned slots will be each 30 minutes long.",- "example": "60",- "schema": {}+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-06-11",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-06-11"+ }},{- "name": "timeZone",- "required": false,- "in": "query",- "description": "Time zone in which the available slots should be returned. Defaults to UTC.",- "example": "Europe/Rome",- "schema": {}+ "name": "scheduleId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }}],"responses": {"200": {- "description": "A map of available slots indexed by date, where each date is associated with an array of time slots. If format=range is specified, each slot will be an object with start and end properties denoting start and end of the slot.\n For seated slots each object will have attendeesCount and bookingUid properties.",+ "description": "","content": {"application/json": {"schema": {- "oneOf": [- {- "type": "object",- "title": "Default format (or with format=time)",- "additionalProperties": {- "type": "array",- "items": {- "type": "string"- }- },- "example": {- "status": "success",+ "$ref": "#/components/schemas/DeleteScheduleOutput_2024_06_11"+ }+ }+ }+ }+ },+ "tags": ["Schedules"]+ }+ },+ "/v2/selected-calendars": {+ "post": {+ "operationId": "SelectedCalendarsController_addSelectedCalendar",+ "summary": "Add a selected calendar",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/SelectedCalendarsInputDto"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": ["Selected Calendars"]+ },+ "delete": {+ "operationId": "SelectedCalendarsController_deleteSelectedCalendar",+ "summary": "Delete a selected calendar",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "integration",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "externalId",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "credentialId",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "delegationCredentialId",+ "required": false,+ "in": "query",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": ["Selected Calendars"]+ }+ },+ "/v2/slots": {+ "get": {+ "operationId": "SlotsController_2024_09_04_getAvailableSlots",+ "summary": "Find out when is an event type ready to be booked.",+ "description": "\n There are 4 ways to get available slots for event type of an individual user:\n\n 1. By event type id. Event type id can be of user and team event types. Example '/v2/slots?eventTypeId=10&start=2050-09-05&end=2050-09-06&timeZone=Europe/Rome'\n\n 2. By event type slug + username. Example '/v2/slots?eventTypeSlug=intro&username=bob&start=2050-09-05&end=2050-09-06'\n\n 3. By event type slug + username + organization slug when searching within an organization. Example '/v2/slots?organizationSlug=org-slug&eventTypeSlug=intro&username=bob&start=2050-09-05&end=2050-09-06'\n\n 4. By usernames only (used for dynamic event type - there is no specific event but you want to know when 2 or more people are available). Example '/v2/slots?usernames=alice,bob&username=bob&organizationSlug=org-slug&start=2050-09-05&end=2050-09-06'. As you see you also need to provide the slug of the organization to which each user in the 'usernames' array belongs.\n\n And 3 ways to get available slots for team event type:\n\n 1. By team event type id. Example '/v2/slots?eventTypeId=10&start=2050-09-05&end=2050-09-06&timeZone=Europe/Rome'\n\n 2. By team event type slug + team slug. Example '/v2/slots?eventTypeSlug=intro&teamSlug=team-slug&start=2050-09-05&end=2050-09-06'\n\n 3. By team event type slug + team slug + organization slug when searching within an organization. Example '/v2/slots?organizationSlug=org-slug&eventTypeSlug=intro&teamSlug=team-slug&start=2050-09-05&end=2050-09-06'\n\n All of them require \"start\" and \"end\" query parameters which define the time range for which available slots should be checked.\n Optional parameters are:\n - timeZone: Time zone in which the available slots should be returned. Defaults to UTC.\n - duration: Only use for event types that allow multiple durations or for dynamic event types. If not passed for multiple duration event types defaults to default duration. For dynamic event types defaults to 30 aka each returned slot is 30 minutes long. So duration=60 means that returned slots will be each 60 minutes long.\n - slotFormat: Format of the slots. By default return is an object where each key is date and value is array of slots as string. If you want to get start and end of each slot use \"range\" as value.\n ",+ "parameters": [+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-09-04",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-09-04"+ }+ },+ {+ "name": "start",+ "required": true,+ "in": "query",+ "description": "\n Time starting from which available slots should be checked.\n\n Must be in UTC timezone as ISO 8601 datestring.\n\n You can pass date without hours which defaults to start of day or specify hours:\n 2024-08-13 (will have hours 00:00:00 aka at very beginning of the date) or you can specify hours manually like 2024-08-13T09:00:00Z.",+ "example": "2050-09-05",+ "schema": {}+ },+ {+ "name": "end",+ "required": true,+ "in": "query",+ "description": "\n Time until which available slots should be checked.\n\n Must be in UTC timezone as ISO 8601 datestring.\n\n You can pass date without hours which defaults to end of day or specify hours:\n 2024-08-20 (will have hours 23:59:59 aka at the very end of the date) or you can specify hours manually like 2024-08-20T18:00:00Z.",+ "example": "2050-09-06",+ "schema": {}+ },+ {+ "name": "organizationSlug",+ "required": false,+ "in": "query",+ "description": "The slug of the organization to which user with username belongs or team with teamSlug belongs.",+ "example": "org-slug",+ "schema": {}+ },+ {+ "name": "teamSlug",+ "required": false,+ "in": "query",+ "description": "The slug of the team who owns event type with eventTypeSlug - used when slots are checked for team event type.",+ "example": "team-slug",+ "schema": {}+ },+ {+ "name": "username",+ "required": false,+ "in": "query",+ "description": "The username of the user who owns event type with eventTypeSlug - used when slots are checked for individual user event type.",+ "example": "bob",+ "schema": {}+ },+ {+ "name": "eventTypeSlug",+ "required": false,+ "in": "query",+ "description": "The slug of the event type for which available slots should be checked. If slug is provided then username or teamSlug must be provided too and if relevant organizationSlug too.",+ "example": "event-type-slug",+ "schema": {}+ },+ {+ "name": "eventTypeId",+ "required": false,+ "in": "query",+ "description": "The ID of the event type for which available slots should be checked.",+ "example": "100",+ "schema": {}+ },+ {+ "name": "usernames",+ "required": false,+ "in": "query",+ "description": "The usernames for which available slots should be checked separated by a comma.\n\n Checking slots by usernames is used mainly for dynamic events where there is no specific event but we just want to know when 2 or more people are available.\n\n Must contain at least 2 usernames.",+ "example": "alice,bob",+ "schema": {}+ },+ {+ "name": "slotFormat",+ "required": false,+ "in": "query",+ "description": "Format of slot times in response. Use 'range' to get start and end times. Use 'time' or omit this query parameter to get only start time.",+ "example": "range",+ "schema": {}+ },+ {+ "name": "duration",+ "required": false,+ "in": "query",+ "description": "If event type has multiple possible durations then you can specify the desired duration here. Also, if you are fetching slots for a dynamic event then you can specify the duration her which defaults to 30, meaning that returned slots will be each 30 minutes long.",+ "example": "60",+ "schema": {}+ },+ {+ "name": "timeZone",+ "required": false,+ "in": "query",+ "description": "Time zone in which the available slots should be returned. Defaults to UTC.",+ "example": "Europe/Rome",+ "schema": {}+ }+ ],+ "responses": {+ "200": {+ "description": "A map of available slots indexed by date, where each date is associated with an array of time slots. If format=range is specified, each slot will be an object with start and end properties denoting start and end of the slot.\n For seated slots each object will have attendeesCount and bookingUid properties.",+ "content": {+ "application/json": {+ "schema": {+ "oneOf": [+ {+ "type": "object",+ "title": "Default format (or with format=time)",+ "additionalProperties": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ "example": {+ "status": "success","data": {"2050-09-05": [{@@ -9680,78 +10068,589 @@"description": "Make a slot not available for others to book for a certain period of time. If you authenticate using oAuth credentials, api key or access token\n then you can also specify custom duration for how long the slot should be reserved for (defaults to 5 minutes).","parameters": [{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-09-04",+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-09-04",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-09-04"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": false,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "x-cal-client-id",+ "in": "header",+ "description": "For platform customers - OAuth client ID",+ "required": false,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ReserveSlotInput_2024_09_04"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"+ }+ }+ }+ }+ },+ "tags": ["Slots"]+ }+ },+ "/v2/slots/reservations/{uid}": {+ "get": {+ "operationId": "SlotsController_2024_09_04_getReservedSlot",+ "summary": "Get reserved slot",+ "parameters": [+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-09-04",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-09-04"+ }+ },+ {+ "name": "uid",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GetReservedSlotOutput_2024_09_04"+ }+ }+ }+ }+ },+ "tags": ["Slots"]+ },+ "patch": {+ "operationId": "SlotsController_2024_09_04_updateReservedSlot",+ "summary": "Updated reserved a slot",+ "parameters": [+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-09-04",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-09-04"+ }+ },+ {+ "name": "uid",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ReserveSlotInput_2024_09_04"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"+ }+ }+ }+ }+ },+ "tags": ["Slots"]+ },+ "delete": {+ "operationId": "SlotsController_2024_09_04_deleteReservedSlot",+ "summary": "Delete a reserved slot",+ "parameters": [+ {+ "name": "cal-api-version",+ "in": "header",+ "description": "Must be set to 2024-09-04",+ "required": true,+ "schema": {+ "type": "string",+ "default": "2024-09-04"+ }+ },+ {+ "name": "uid",+ "required": true,+ "in": "path",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "example": {+ "status": "success"+ }+ }+ }+ }+ }+ },+ "tags": ["Slots"]+ }+ },+ "/v2/stripe/connect": {+ "get": {+ "operationId": "StripeController_redirect",+ "summary": "Get stripe connect URL",+ "parameters": [+ {+ "name": "Authorization",+ "required": true,+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/StripConnectOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": ["Stripe"]+ }+ },+ "/v2/stripe/save": {+ "get": {+ "operationId": "StripeController_save",+ "summary": "Save stripe credentials",+ "parameters": [+ {+ "name": "state",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "code",+ "required": true,+ "in": "query",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": ["Stripe"]+ }+ },+ "/v2/stripe/check": {+ "get": {+ "operationId": "StripeController_check",+ "summary": "Check stripe connection",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": ["Stripe"]+ }+ },+ "/v2/teams": {+ "post": {+ "operationId": "TeamsController_createTeam",+ "summary": "Create a team",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamInput"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamOutput"+ }+ }+ }+ }+ },+ "tags": ["Teams"]+ },+ "get": {+ "operationId": "TeamsController_getTeams",+ "summary": "Get teams",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GetTeamsOutput"+ }+ }+ }+ }+ },+ "tags": ["Teams"]+ }+ },+ "/v2/teams/{teamId}": {+ "get": {+ "operationId": "TeamsController_getTeam",+ "summary": "Get a team",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GetTeamOutput"+ }+ }+ }+ }+ },+ "tags": ["Teams"]+ },+ "patch": {+ "operationId": "TeamsController_updateTeam",+ "summary": "Update a team",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/UpdateOrgTeamDto"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/UpdateTeamOutput"+ }+ }+ }+ }+ },+ "tags": ["Teams"]+ },+ "delete": {+ "operationId": "TeamsController_deleteTeam",+ "summary": "Delete a team",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/OrgTeamOutputResponseDto"+ }+ }+ }+ }+ },+ "tags": ["Teams"]+ }+ },+ "/v2/teams/{teamId}/event-types": {+ "post": {+ "operationId": "TeamsEventTypesController_createTeamEventType",+ "summary": "Create an event type",+ "parameters": [+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamEventTypeInput_2024_06_14"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamEventTypeOutput"+ }+ }+ }+ }+ },+ "tags": ["Teams / Event Types"]+ },+ "get": {+ "operationId": "TeamsEventTypesController_getTeamEventTypes",+ "summary": "Get a team event type",+ "parameters": [+ {+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string",- "default": "2024-09-04"+ "type": "number"}},{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "name": "eventSlug","required": false,+ "in": "query",+ "description": "Slug of team event type to return.","schema": {"type": "string"}},{- "name": "x-cal-client-id",- "in": "header",- "description": "For platform customers - OAuth client ID",+ "name": "hostsLimit","required": false,+ "in": "query",+ "description": "Specifies the maximum number of hosts to include in the response. This limit helps optimize performance. If not provided, all Hosts will be fetched.","schema": {- "type": "string"+ "type": "number"}}],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/ReserveSlotInput_2024_09_04"- }- }- }- },"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"+ "$ref": "#/components/schemas/GetTeamEventTypesOutput"}}}}},- "tags": ["Slots"]+ "tags": ["Teams / Event Types"]}},- "/v2/slots/reservations/{uid}": {+ "/v2/teams/{teamId}/event-types/{eventTypeId}": {"get": {- "operationId": "SlotsController_2024_09_04_getReservedSlot",- "summary": "Get reserved slot",+ "operationId": "TeamsEventTypesController_getTeamEventType",+ "summary": "Get an event type","parameters": [{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-09-04",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string",- "default": "2024-09-04"+ "type": "number"}},{- "name": "uid",+ "name": "eventTypeId","required": true,"in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,"schema": {"type": "string"}@@ -9763,32 +10662,39 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetReservedSlotOutput_2024_09_04"+ "$ref": "#/components/schemas/GetTeamEventTypeOutput"}}}}},- "tags": ["Slots"]+ "tags": ["Teams / Event Types"]},"patch": {- "operationId": "SlotsController_2024_09_04_updateReservedSlot",- "summary": "Updated reserved a slot",+ "operationId": "TeamsEventTypesController_updateTeamEventType",+ "summary": "Update a team event type","parameters": [{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-09-04",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string",- "default": "2024-09-04"+ "type": "number"}},{- "name": "uid",+ "name": "eventTypeId","required": true,"in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,"schema": {"type": "string"}@@ -9799,7 +10705,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/ReserveSlotInput_2024_09_04"+ "$ref": "#/components/schemas/UpdateTeamEventTypeInput_2024_06_14"}}}@@ -9810,32 +10716,39 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"+ "$ref": "#/components/schemas/UpdateTeamEventTypeOutput"}}}}},- "tags": ["Slots"]+ "tags": ["Teams / Event Types"]},"delete": {- "operationId": "SlotsController_2024_09_04_deleteReservedSlot",- "summary": "Delete a reserved slot",+ "operationId": "TeamsEventTypesController_deleteTeamEventType",+ "summary": "Delete a team event type","parameters": [{- "name": "cal-api-version",- "in": "header",- "description": "Must be set to 2024-09-04",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string",- "default": "2024-09-04"+ "type": "number"}},{- "name": "uid",+ "name": "eventTypeId","required": true,"in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,"schema": {"type": "string"}@@ -9847,67 +10760,157 @@"content": {"application/json": {"schema": {- "type": "object",- "example": {- "status": "success"- }+ "$ref": "#/components/schemas/DeleteTeamEventTypeOutput"}}}}},- "tags": ["Slots"]+ "tags": ["Teams / Event Types"]}},- "/v2/stripe/connect": {- "get": {- "operationId": "StripeController_redirect",- "summary": "Get stripe connect URL",+ "/v2/teams/{teamId}/event-types/{eventTypeId}/create-phone-call": {+ "post": {+ "operationId": "TeamsEventTypesController_createPhoneCall",+ "summary": "Create a phone call","parameters": [{- "name": "Authorization",+ "name": "eventTypeId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "orgId","required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreatePhoneCallInput"+ }+ }+ }+ },"responses": {- "200": {+ "201": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripConnectOutputResponseDto"+ "$ref": "#/components/schemas/CreatePhoneCallOutput"}}}}},- "tags": ["Stripe"]+ "tags": ["Teams / Event Types"]}},- "/v2/stripe/save": {+ "/v2/teams/{teamId}/memberships": {+ "post": {+ "operationId": "TeamsMembershipsController_createTeamMembership",+ "summary": "Create a membership",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamMembershipInput"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateTeamMembershipOutput"+ }+ }+ }+ }+ },+ "tags": ["Teams / Memberships"]+ },"get": {- "operationId": "StripeController_save",- "summary": "Save stripe credentials",+ "operationId": "TeamsMembershipsController_getTeamMemberships",+ "summary": "Get all memberships","parameters": [{- "name": "state",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_","required": true,- "in": "query","schema": {"type": "string"}},{- "name": "code",+ "name": "teamId","required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "take",+ "required": false,"in": "query",+ "description": "The number of items to return",+ "example": 10,"schema": {- "type": "string"+ "type": "number"+ }+ },+ {+ "name": "skip",+ "required": false,+ "in": "query",+ "description": "The number of items to skip",+ "example": 0,+ "schema": {+ "type": "number"}}],@@ -9917,28 +10920,44 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"+ "$ref": "#/components/schemas/GetTeamMembershipsOutput"}}}}},- "tags": ["Stripe"]+ "tags": ["Teams / Memberships"]}},- "/v2/stripe/check": {+ "/v2/teams/{teamId}/memberships/{membershipId}": {"get": {- "operationId": "StripeController_check",- "summary": "Check stripe connection",+ "operationId": "TeamsMembershipsController_getTeamMembership",+ "summary": "Get a membership","parameters": [{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_","required": true,"schema": {"type": "string"}+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "membershipId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }}],"responses": {@@ -9947,19 +10966,17 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"+ "$ref": "#/components/schemas/GetTeamMembershipOutput"}}}}},- "tags": ["Stripe"]- }- },- "/v2/teams": {- "post": {- "operationId": "TeamsController_createTeam",- "summary": "Create a team",+ "tags": ["Teams / Memberships"]+ },+ "patch": {+ "operationId": "TeamsMembershipsController_updateTeamMembership",+ "summary": "Create a membership","parameters": [{"name": "Authorization",@@ -9969,6 +10986,22 @@"schema": {"type": "string"}+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "membershipId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }}],"requestBody": {@@ -9976,28 +11009,28 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamInput"+ "$ref": "#/components/schemas/UpdateTeamMembershipInput"}}}},"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamOutput"+ "$ref": "#/components/schemas/UpdateTeamMembershipOutput"}}}}},- "tags": ["Teams"]+ "tags": ["Teams / Memberships"]},- "get": {- "operationId": "TeamsController_getTeams",- "summary": "Get teams",+ "delete": {+ "operationId": "TeamsMembershipsController_deleteTeamMembership",+ "summary": "Delete a membership","parameters": [{"name": "Authorization",@@ -10007,6 +11040,22 @@"schema": {"type": "string"}+ },+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "membershipId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }}],"responses": {@@ -10015,72 +11064,70 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamsOutput"+ "$ref": "#/components/schemas/DeleteTeamMembershipOutput"}}}}},- "tags": ["Teams"]+ "tags": ["Teams / Memberships"]}},- "/v2/teams/{teamId}": {- "get": {- "operationId": "TeamsController_getTeam",- "summary": "Get a team",+ "/v2/teams/{teamId}/verified-resources/emails/verification-code/request": {+ "post": {+ "operationId": "TeamsVerifiedResourcesController_requestEmailVerificationCode",+ "summary": "Request Email Verification Code",+ "description": "Sends a verification code to the Email.","parameters": [{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"}- },- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/RequestEmailVerificationInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamOutput"+ "$ref": "#/components/schemas/RequestEmailVerificationOutput"}}}}},- "tags": ["Teams"]- },- "patch": {- "operationId": "TeamsController_updateTeam",- "summary": "Update a team",+ "tags": ["Teams Verified Resources"]+ }+ },+ "/v2/teams/{teamId}/verified-resources/phones/verification-code/request": {+ "post": {+ "operationId": "TeamsVerifiedResourcesController_requestPhoneVerificationCode",+ "summary": "Request Phone Number Verification Code",+ "description": "Sends a verification code to the phone number.","parameters": [{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"}- },- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }}],"requestBody": {@@ -10088,7 +11135,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateOrgTeamDto"+ "$ref": "#/components/schemas/RequestPhoneVerificationInput"}}}@@ -10099,55 +11146,69 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateTeamOutput"+ "$ref": "#/components/schemas/RequestPhoneVerificationOutput"}}}}},- "tags": ["Teams"]- },- "delete": {- "operationId": "TeamsController_deleteTeam",- "summary": "Delete a team",+ "tags": ["Teams Verified Resources"]+ }+ },+ "/v2/teams/{teamId}/verified-resources/emails/verification-code/verify": {+ "post": {+ "operationId": "TeamsVerifiedResourcesController_verifyEmail",+ "summary": "Verify an email for a team.",+ "description": "Use code to verify an email","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "name": "teamId","required": true,+ "in": "path","schema": {- "type": "string"+ "type": "number"}},{- "name": "teamId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {- "type": "number"+ "type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/VerifyEmailInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/OrgTeamOutputResponseDto"+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"}}}}},- "tags": ["Teams"]+ "tags": ["Teams Verified Resources"]}},- "/v2/teams/{teamId}/event-types": {+ "/v2/teams/{teamId}/verified-resources/phones/verification-code/verify": {"post": {- "operationId": "TeamsEventTypesController_createTeamEventType",- "summary": "Create an event type",+ "operationId": "TeamsVerifiedResourcesController_verifyPhoneNumber",+ "summary": "Verify a phone number for an org team.",+ "description": "Use code to verify a phone number","parameters": [{"name": "teamId",@@ -10160,7 +11221,7 @@{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"@@ -10172,28 +11233,30 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamEventTypeInput_2024_06_14"+ "$ref": "#/components/schemas/VerifyPhoneInput"}}}},"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamEventTypeOutput"+ "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"}}}}},- "tags": ["Teams / Event Types"]- },+ "tags": ["Teams Verified Resources"]+ }+ },+ "/v2/teams/{teamId}/verified-resources/emails": {"get": {- "operationId": "TeamsEventTypesController_getTeamEventTypes",- "summary": "Get a team event type",+ "operationId": "TeamsVerifiedResourcesController_getVerifiedEmails",+ "summary": "Get list of verified emails of a team.","parameters": [{"name": "teamId",@@ -10204,21 +11267,90 @@}},{- "name": "eventSlug",+ "name": "take","required": false,"in": "query",- "description": "Slug of team event type to return.",+ "description": "The number of items to return",+ "example": 10,+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "skip",+ "required": false,+ "in": "query",+ "description": "The number of items to skip",+ "example": 0,+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,"schema": {"type": "string"}+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/TeamVerifiedEmailsOutput"+ }+ }+ }+ }+ },+ "tags": ["Teams Verified Resources"]+ }+ },+ "/v2/teams/{teamId}/verified-resources/phone-numbers": {+ "get": {+ "operationId": "TeamsVerifiedResourcesController_getVerifiedPhoneNumbers",+ "summary": "Get list of verified phone numbers of a team.",+ "parameters": [+ {+ "name": "teamId",+ "required": true,+ "in": "path",+ "schema": {+ "type": "number"+ }},{- "name": "hostsLimit",+ "name": "take","required": false,"in": "query",- "description": "Specifies the maximum number of hosts to include in the response. This limit helps optimize performance. If not provided, all Hosts will be fetched.",+ "description": "The number of items to return",+ "example": 10,+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "skip",+ "required": false,+ "in": "query",+ "description": "The number of items to skip",+ "example": 0,+ "schema": {+ "type": "number"+ }+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,"schema": {- "type": "number"+ "type": "string"}}],@@ -10228,22 +11360,22 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamEventTypesOutput"+ "$ref": "#/components/schemas/TeamVerifiedPhonesOutput"}}}}},- "tags": ["Teams / Event Types"]+ "tags": ["Teams Verified Resources"]}},- "/v2/teams/{teamId}/event-types/{eventTypeId}": {+ "/v2/teams/{teamId}/verified-resources/emails/{id}": {"get": {- "operationId": "TeamsEventTypesController_getTeamEventType",- "summary": "Get an event type",+ "operationId": "TeamsVerifiedResourcesController_getVerifiedEmailById",+ "summary": "Get verified email of a team by id.","parameters": [{- "name": "teamId",+ "name": "id","required": true,"in": "path","schema": {@@ -10251,7 +11383,7 @@}},{- "name": "eventTypeId",+ "name": "teamId","required": true,"in": "path","schema": {@@ -10261,7 +11393,7 @@{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"@@ -10274,17 +11406,19 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamEventTypeOutput"+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"}}}}},- "tags": ["Teams / Event Types"]- },- "patch": {- "operationId": "TeamsEventTypesController_updateTeamEventType",- "summary": "Update a team event type",+ "tags": ["Teams Verified Resources"]+ }+ },+ "/v2/teams/{teamId}/verified-resources/phone-numbers/{id}": {+ "get": {+ "operationId": "TeamsVerifiedResourcesController_getVerifiedPhoneById",+ "summary": "Get verified phone number of a team by id.","parameters": [{"name": "teamId",@@ -10295,7 +11429,7 @@}},{- "name": "eventTypeId",+ "name": "id","required": true,"in": "path","schema": {@@ -10305,7 +11439,38 @@{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"+ }+ }+ }+ }+ },+ "tags": ["Teams Verified Resources"]+ }+ },+ "/v2/verified-resources/emails/verification-code/request": {+ "post": {+ "operationId": "UserVerifiedResourcesController_requestEmailVerificationCode",+ "summary": "Request Email Verification Code",+ "description": "Sends a verification code to the email.",+ "parameters": [+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"@@ -10317,7 +11482,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateTeamEventTypeInput_2024_06_14"+ "$ref": "#/components/schemas/RequestEmailVerificationInput"}}}@@ -10328,84 +11493,66 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateTeamEventTypeOutput"+ "$ref": "#/components/schemas/RequestEmailVerificationOutput"}}}}},- "tags": ["Teams / Event Types"]- },- "delete": {- "operationId": "TeamsEventTypesController_deleteTeamEventType",- "summary": "Delete a team event type",+ "tags": ["Verified Resources"]+ }+ },+ "/v2/verified-resources/phones/verification-code/request": {+ "post": {+ "operationId": "UserVerifiedResourcesController_requestPhoneVerificationCode",+ "summary": "Request Phone Number Verification Code",+ "description": "Sends a verification code to the phone number.","parameters": [- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }- },- {- "name": "eventTypeId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }- },{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/RequestPhoneVerificationInput"+ }+ }+ }+ },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/DeleteTeamEventTypeOutput"+ "$ref": "#/components/schemas/RequestPhoneVerificationOutput"}}}}},- "tags": ["Teams / Event Types"]+ "tags": ["Verified Resources"]}},- "/v2/teams/{teamId}/event-types/{eventTypeId}/create-phone-call": {+ "/v2/verified-resources/emails/verification-code/verify": {"post": {- "operationId": "TeamsEventTypesController_createPhoneCall",- "summary": "Create a phone call",+ "operationId": "UserVerifiedResourcesController_verifyEmail",+ "summary": "Verify an email.",+ "description": "Use code to verify an email","parameters": [- {- "name": "eventTypeId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }- },- {- "name": "orgId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }- },{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"@@ -10417,47 +11564,40 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreatePhoneCallInput"+ "$ref": "#/components/schemas/VerifyEmailInput"}}}},"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreatePhoneCallOutput"+ "$ref": "#/components/schemas/UserVerifiedEmailOutput"}}}}},- "tags": ["Teams / Event Types"]+ "tags": ["Verified Resources"]}},- "/v2/teams/{teamId}/memberships": {+ "/v2/verified-resources/phones/verification-code/verify": {"post": {- "operationId": "TeamsMembershipsController_createTeamMembership",- "summary": "Create a membership",+ "operationId": "UserVerifiedResourcesController_verifyPhoneNumber",+ "summary": "Verify a phone number.",+ "description": "Use code to verify a phone number","parameters": [{"name": "Authorization","in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,"schema": {"type": "string"}- },- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }}],"requestBody": {@@ -10465,46 +11605,31 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamMembershipInput"+ "$ref": "#/components/schemas/VerifyPhoneInput"}}}},"responses": {- "201": {+ "200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CreateTeamMembershipOutput"+ "$ref": "#/components/schemas/UserVerifiedPhoneOutput"}}}}},- "tags": ["Teams / Memberships"]- },+ "tags": ["Verified Resources"]+ }+ },+ "/v2/verified-resources/emails": {"get": {- "operationId": "TeamsMembershipsController_getTeamMemberships",- "summary": "Get all memberships",+ "operationId": "UserVerifiedResourcesController_getVerifiedEmails",+ "summary": "Get list of verified emails.","parameters": [- {- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "teamId",- "required": true,- "in": "path",- "schema": {- "type": "number"- }- },{"name": "take","required": false,@@ -10524,6 +11649,15 @@"schema": {"type": "number"}+ },+ {+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",+ "required": true,+ "schema": {+ "type": "string"+ }}],"responses": {@@ -10532,43 +11666,47 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamMembershipsOutput"+ "$ref": "#/components/schemas/UserVerifiedEmailsOutput"}}}}},- "tags": ["Teams / Memberships"]+ "tags": ["Verified Resources"]}},- "/v2/teams/{teamId}/memberships/{membershipId}": {+ "/v2/verified-resources/phone-numbers": {"get": {- "operationId": "TeamsMembershipsController_getTeamMembership",- "summary": "Get a membership",+ "operationId": "UserVerifiedResourcesController_getVerifiedPhoneNumbers",+ "summary": "Get list of verified phone numbers.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",- "required": true,+ "name": "take",+ "required": false,+ "in": "query",+ "description": "The number of items to return",+ "example": 10,"schema": {- "type": "string"+ "type": "number"}},{- "name": "teamId",- "required": true,- "in": "path",+ "name": "skip",+ "required": false,+ "in": "query",+ "description": "The number of items to skip",+ "example": 0,"schema": {"type": "number"}},{- "name": "membershipId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {- "type": "number"+ "type": "string"}}],@@ -10578,29 +11716,22 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/GetTeamMembershipOutput"+ "$ref": "#/components/schemas/UserVerifiedPhonesOutput"}}}}},- "tags": ["Teams / Memberships"]- },- "patch": {- "operationId": "TeamsMembershipsController_updateTeamMembership",- "summary": "Create a membership",+ "tags": ["Verified Resources"]+ }+ },+ "/v2/verified-resources/emails/{id}": {+ "get": {+ "operationId": "UserVerifiedResourcesController_getVerifiedEmailById",+ "summary": "Get verified email by id.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "teamId",+ "name": "id","required": true,"in": "path","schema": {@@ -10608,53 +11739,37 @@}},{- "name": "membershipId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {- "type": "number"+ "type": "string"}}],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/UpdateTeamMembershipInput"- }- }- }- },"responses": {"200": {"description": "","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/UpdateTeamMembershipOutput"+ "$ref": "#/components/schemas/UserVerifiedEmailOutput"}}}}},- "tags": ["Teams / Memberships"]- },- "delete": {- "operationId": "TeamsMembershipsController_deleteTeamMembership",- "summary": "Delete a membership",+ "tags": ["Verified Resources"]+ }+ },+ "/v2/verified-resources/phone-numbers/{id}": {+ "get": {+ "operationId": "UserVerifiedResourcesController_getVerifiedPhoneById",+ "summary": "Get verified phone number by id.","parameters": [{- "name": "Authorization",- "in": "header",- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "teamId",+ "name": "id","required": true,"in": "path","schema": {@@ -10662,11 +11777,12 @@}},{- "name": "membershipId",+ "name": "Authorization",+ "in": "header",+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token","required": true,- "in": "path","schema": {- "type": "number"+ "type": "string"}}],@@ -10676,13 +11792,13 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/DeleteTeamMembershipOutput"+ "$ref": "#/components/schemas/UserVerifiedPhoneOutput"}}}}},- "tags": ["Teams / Memberships"]+ "tags": ["Verified Resources"]}},"/v2/webhooks": {@@ -21374,6 +22490,318 @@}},"required": ["status", "data"]+ },+ "RequestEmailVerificationInput": {+ "type": "object",+ "properties": {+ "email": {+ "type": "string",+ "description": "Email to verify.",+ "example": "[email protected]"+ }+ },+ "required": ["email"]+ },+ "RequestEmailVerificationOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": ["success", "error"]+ }+ },+ "required": ["status"]+ },+ "RequestPhoneVerificationInput": {+ "type": "object",+ "properties": {+ "phone": {+ "type": "string",+ "description": "Phone number to verify.",+ "example": "+372 5555 6666"+ }+ },+ "required": ["phone"]+ },+ "RequestPhoneVerificationOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": ["success", "error"]+ }+ },+ "required": ["status"]+ },+ "VerifyEmailInput": {+ "type": "object",+ "properties": {+ "email": {+ "type": "string",+ "description": "Email to verify.",+ "example": "[email protected]"+ },+ "code": {+ "type": "string",+ "description": "verification code sent to the email to verify",+ "example": "1ABG2C"+ }+ },+ "required": ["email", "code"]+ },+ "WorkingHours": {+ "type": "object",+ "properties": {+ "days": {+ "type": "array",+ "items": {+ "type": "number"+ }+ },+ "startTime": {+ "type": "number"+ },+ "endTime": {+ "type": "number"+ },+ "userId": {+ "type": "number",+ "nullable": true+ }+ },+ "required": ["days", "startTime", "endTime"]+ },+ "AvailabilityModel": {+ "type": "object",+ "properties": {+ "id": {+ "type": "number"+ },+ "userId": {+ "type": "number",+ "nullable": true+ },+ "eventTypeId": {+ "type": "number",+ "nullable": true+ },+ "days": {+ "type": "array",+ "items": {+ "type": "number"+ }+ },+ "startTime": {+ "format": "date-time",+ "type": "string"+ },+ "endTime": {+ "format": "date-time",+ "type": "string"+ },+ "date": {+ "format": "date-time",+ "type": "string",+ "nullable": true+ },+ "scheduleId": {+ "type": "number",+ "nullable": true+ }+ },+ "required": ["id", "days", "startTime", "endTime"]+ },+ "ScheduleOutput": {+ "type": "object",+ "properties": {+ "id": {+ "type": "number"+ },+ "name": {+ "type": "string"+ },+ "isManaged": {+ "type": "boolean"+ },+ "workingHours": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/WorkingHours"+ }+ },+ "schedule": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/AvailabilityModel"+ }+ },+ "availability": {+ "items": {+ "type": "array"+ },+ "type": "array"+ },+ "timeZone": {+ "type": "string"+ },+ "dateOverrides": {+ "type": "array",+ "items": {+ "type": "object"+ }+ },+ "isDefault": {+ "type": "boolean"+ },+ "isLastSchedule": {+ "type": "boolean"+ },+ "readOnly": {+ "type": "boolean"+ }+ },+ "required": [+ "id",+ "name",+ "isManaged",+ "workingHours",+ "schedule",+ "availability",+ "timeZone",+ "isDefault",+ "isLastSchedule",+ "readOnly"+ ]+ },+ "UserVerifiedEmailOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": ["success", "error"]+ },+ "data": {+ "$ref": "#/components/schemas/ScheduleOutput"+ }+ },+ "required": ["status", "data"]+ },+ "VerifyPhoneInput": {+ "type": "object",+ "properties": {+ "phone": {+ "type": "string",+ "description": "phone number to verify.",+ "example": "+37255556666"+ },+ "code": {+ "type": "string",+ "description": "verification code sent to the phone number to verify",+ "example": "1ABG2C"+ }+ },+ "required": ["phone", "code"]+ },+ "UserVerifiedPhoneOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": ["success", "error"]+ },+ "data": {+ "$ref": "#/components/schemas/ScheduleOutput"+ }+ },+ "required": ["status", "data"]+ },+ "UserVerifiedEmailsOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": ["success", "error"]+ },+ "data": {+ "$ref": "#/components/schemas/ScheduleOutput"+ }+ },+ "required": ["status", "data"]+ },+ "UserVerifiedPhonesOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": ["success", "error"]+ },+ "data": {+ "$ref": "#/components/schemas/ScheduleOutput"+ }+ },+ "required": ["status", "data"]+ },+ "TeamVerifiedEmailOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": ["success", "error"]+ },+ "data": {+ "$ref": "#/components/schemas/ScheduleOutput"+ }+ },+ "required": ["status", "data"]+ },+ "TeamVerifiedPhoneOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": ["success", "error"]+ },+ "data": {+ "$ref": "#/components/schemas/ScheduleOutput"+ }+ },+ "required": ["status", "data"]+ },+ "TeamVerifiedEmailsOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": ["success", "error"]+ },+ "data": {+ "$ref": "#/components/schemas/ScheduleOutput"+ }+ },+ "required": ["status", "data"]+ },+ "TeamVerifiedPhonesOutput": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "example": "success",+ "enum": ["success", "error"]+ },+ "data": {+ "$ref": "#/components/schemas/ScheduleOutput"+ }+ },+ "required": ["status", "data"]}}}diff --git a/packages/platform/libraries/emails.ts b/packages/platform/libraries/emails.tsindex d4f08607613..044ace5a0c3 100644--- a/packages/platform/libraries/emails.ts+++ b/packages/platform/libraries/emails.ts@@ -4,12 +4,17 @@ import AttendeeRequestEmail from "@calcom/emails/templates/attendee-request-emaiimport AttendeeRescheduledEmail from "@calcom/emails/templates/attendee-rescheduled-email";import AttendeeScheduledEmail from "@calcom/emails/templates/attendee-scheduled-email";import AttendeeUpdatedEmail from "@calcom/emails/templates/attendee-updated-email";+import AttendeeVerifyEmail from "@calcom/emails/templates/attendee-verify-email";import OrganizerCancelledEmail from "@calcom/emails/templates/organizer-cancelled-email";import OrganizerReassignedEmail from "@calcom/emails/templates/organizer-reassigned-email";import OrganizerRequestEmail from "@calcom/emails/templates/organizer-request-email";import OrganizerRescheduledEmail from "@calcom/emails/templates/organizer-rescheduled-email";import OrganizerScheduledEmail from "@calcom/emails/templates/organizer-scheduled-email";+import { sendEmailVerificationByCode } from "@calcom/features/auth/lib/verifyEmail";import { sendSignupToOrganizationEmail } from "@calcom/trpc/server/routers/viewer/teams/inviteMember/utils";+import { verifyEmailCodeHandler } from "@calcom/trpc/server/routers/viewer/workflows/verifyEmailCode.handler";++export { AttendeeVerifyEmail };export { AttendeeScheduledEmail };@@ -34,3 +39,7 @@ export { OrganizerRequestEmail };export { AttendeeRequestEmail };export { sendSignupToOrganizationEmail };++export { sendEmailVerificationByCode };++export { verifyEmailCodeHandler };diff --git a/packages/platform/libraries/index.ts b/packages/platform/libraries/index.tsindex 0c410329ea8..0cd3a34c2ee 100644--- a/packages/platform/libraries/index.ts+++ b/packages/platform/libraries/index.ts@@ -4,6 +4,10 @@ import getBookingInfo from "@calcom/features/bookings/lib/getBookingInfo";import handleCancelBooking from "@calcom/features/bookings/lib/handleCancelBooking";import * as newBookingMethods from "@calcom/features/bookings/lib/handleNewBooking";import { getClientSecretFromPayment } from "@calcom/features/ee/payments/pages/getClientSecretFromPayment";+import {+ verifyPhoneNumber,+ sendVerificationCode,+} from "@calcom/features/ee/workflows/lib/reminders/verifyPhoneNumber";import { handleCreatePhoneCall } from "@calcom/features/handleCreatePhoneCall";import handleMarkNoShow from "@calcom/features/handleMarkNoShow";import * as instantMeetingMethods from "@calcom/features/instant-meeting/handleInstantMeeting";@@ -117,3 +121,5 @@ export { getCalendarLinks } from "@calcom/lib/bookings/getCalendarLinks";export { findTeamMembersMatchingAttributeLogic } from "@calcom/lib/raqb/findTeamMembersMatchingAttributeLogic";export type { TFindTeamMembersMatchingAttributeLogicInputSchema } from "@calcom/trpc/server/routers/viewer/attributes/findTeamMembersMatchingAttributeLogic.schema";export { checkAdminOrOwner } from "@calcom/features/auth/lib/checkAdminOrOwner";++export { verifyPhoneNumber, sendVerificationCode };diff --git a/packages/trpc/server/routers/viewer/workflows/verifyEmailCode.handler.ts b/packages/trpc/server/routers/viewer/workflows/verifyEmailCode.handler.tsindex 8f2d6f2602c..e41fad4e0ee 100644--- a/packages/trpc/server/routers/viewer/workflows/verifyEmailCode.handler.ts+++ b/packages/trpc/server/routers/viewer/workflows/verifyEmailCode.handler.ts@@ -10,7 +10,7 @@ import type { TVerifyEmailCodeInputSchema } from "./verifyEmailCode.schema";type VerifyEmailCodeOptions = {ctx: {- user: NonNullable<TrpcSessionUser>;+ user: Pick<NonNullable<TrpcSessionUser>, "id">;};input: TVerifyEmailCodeInputSchema;};