Skip to content

Scheduling infrastructure for absolutely everyone.

feat: api v2 pbac support (#24402)

Lauris Skraucis45278a2195f2
diff --git a/apps/api/v2/src/modules/auth/auth.module.ts b/apps/api/v2/src/modules/auth/auth.module.ts
index 649565f6aa8..e3d427cc6fd 100644
--- a/apps/api/v2/src/modules/auth/auth.module.ts
+++ b/apps/api/v2/src/modules/auth/auth.module.ts
@@ -7,6 +7,7 @@ import { DeploymentsModule } from "@/modules/deployments/deployments.module";
import { MembershipsModule } from "@/modules/memberships/memberships.module";
import { OAuthFlowService } from "@/modules/oauth-clients/services/oauth-flow.service";
import { RedisModule } from "@/modules/redis/redis.module";
+import { RolesModule } from "@/modules/roles/roles.module";
import { TokensModule } from "@/modules/tokens/tokens.module";
import { UsersModule } from "@/modules/users/users.module";
import { Module } from "@nestjs/common";
@@ -21,6 +22,7 @@ import { PassportModule } from "@nestjs/passport";
MembershipsModule,
TokensModule,
DeploymentsModule,
+ RolesModule,
],
providers: [NextAuthGuard, NextAuthStrategy, ApiAuthGuard, ApiAuthStrategy, OAuthFlowService],
exports: [NextAuthGuard, ApiAuthGuard],
diff --git a/apps/api/v2/src/modules/auth/decorators/pbac/pbac.decorator.ts b/apps/api/v2/src/modules/auth/decorators/pbac/pbac.decorator.ts
new file mode 100644
index 00000000000..349af67eb8f
--- /dev/null
+++ b/apps/api/v2/src/modules/auth/decorators/pbac/pbac.decorator.ts
@@ -0,0 +1,5 @@
+import { Reflector } from "@nestjs/core";
+
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+
+export const Pbac = Reflector.createDecorator<PermissionString[]>();
diff --git a/apps/api/v2/src/modules/auth/guards/pbac/pbac.guard.ts b/apps/api/v2/src/modules/auth/guards/pbac/pbac.guard.ts
new file mode 100644
index 00000000000..6845c504a19
--- /dev/null
+++ b/apps/api/v2/src/modules/auth/guards/pbac/pbac.guard.ts
@@ -0,0 +1,177 @@
+import { Pbac } from "@/modules/auth/decorators/pbac/pbac.decorator";
+import { ApiAuthGuardUser } from "@/modules/auth/strategies/api-auth/api-auth.strategy";
+import { PrismaReadService } from "@/modules/prisma/prisma-read.service";
+import { RedisService } from "@/modules/redis/redis.service";
+import {
+ Injectable,
+ CanActivate,
+ ExecutionContext,
+ ForbiddenException,
+ UnauthorizedException,
+ BadRequestException,
+} from "@nestjs/common";
+import { Reflector } from "@nestjs/core";
+import { Request } from "express";
+
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+import { PermissionCheckService, FeaturesRepository } from "@calcom/platform-libraries/pbac";
+
+export const REDIS_PBAC_CACHE_KEY = (teamId: number) => `apiv2:team:${teamId}:has:pbac:guard:pbac`;
+export const REDIS_REQUIRED_PERMISSIONS_CACHE_KEY = (
+ userId: number,
+ teamId: number,
+ requiredPermissions: PermissionString[]
+) =>
+ `apiv2:user:${userId}:team:${teamId}:requiredPermissions:${requiredPermissions
+ .sort()
+ .join(",")}:guard:pbac`;
+
+@Injectable()
+export class PbacGuard implements CanActivate {
+ constructor(
+ private reflector: Reflector,
+ private prismaReadService: PrismaReadService,
+ private readonly redisService: RedisService
+ ) {}
+
+ async canActivate(context: ExecutionContext): Promise<boolean> {
+ const request = context.switchToHttp().getRequest<Request & { pbacAuthorizedRequest?: boolean }>();
+ const user = request.user as ApiAuthGuardUser;
+ const teamId = request.params.teamId;
+ const orgId = request.params.orgId;
+ const requiredPermissions = this.reflector.get(Pbac, context.getHandler());
+
+ const effectiveTeamId = teamId || orgId;
+ if (!user) {
+ throw new UnauthorizedException("PbacGuard - the request does not have an authorized user provided");
+ }
+ if (!effectiveTeamId) {
+ throw new BadRequestException(
+ "PbacGuard - can't check pbac because no teamId or orgId provided within the request url"
+ );
+ }
+
+ if (!requiredPermissions || requiredPermissions.length === 0) {
+ request.pbacAuthorizedRequest = false;
+ return true;
+ }
+
+ const hasPbacEnabled = await this.hasPbacEnabled(Number(effectiveTeamId));
+ if (!hasPbacEnabled) {
+ request.pbacAuthorizedRequest = false;
+ return true;
+ }
+
+ const hasRequiredPermissions = await this.checkUserHasRequiredPermissions(
+ user.id,
+ Number(effectiveTeamId),
+ requiredPermissions
+ );
+
+ if (!hasRequiredPermissions) {
+ request.pbacAuthorizedRequest = false;
+ return true;
+ }
+
+ request.pbacAuthorizedRequest = true;
+ return true;
+ }
+
+ async hasPbacEnabled(teamId: number) {
+ const cachedHasPbacEnabled = await this.getCachePbacEnabled(teamId);
+
+ if (cachedHasPbacEnabled) {
+ return cachedHasPbacEnabled;
+ }
+
+ const pbacFeatureFlag = "pbac";
+ const featuresRepository = new FeaturesRepository(this.prismaReadService.prisma);
+ const hasPbacEnabled = await featuresRepository.checkIfTeamHasFeature(teamId, pbacFeatureFlag);
+
+ if (hasPbacEnabled) {
+ await this.setCachePbacEnabled(teamId, hasPbacEnabled);
+ }
+
+ return hasPbacEnabled;
+ }
+
+ async checkUserHasRequiredPermissions(
+ userId: number,
+ teamId: number,
+ requiredPermissions: PermissionString[]
+ ) {
+ const cachedAccess = await this.getCacheRequiredPermissions(userId, teamId, requiredPermissions);
+
+ if (cachedAccess) {
+ return cachedAccess;
+ }
+
+ const permissionCheckService = new PermissionCheckService();
+ const hasRequiredPermissions = await permissionCheckService.checkPermissions({
+ userId,
+ teamId,
+ permissions: requiredPermissions,
+ fallbackRoles: [],
+ });
+
+ if (hasRequiredPermissions) {
+ await this.setCacheRequiredPermissions(userId, teamId, requiredPermissions, hasRequiredPermissions);
+ }
+
+ return hasRequiredPermissions;
+ }
+
+ private async getCacheRequiredPermissions(
+ userId: number,
+ teamId: number,
+ requiredPermissions: PermissionString[]
+ ): Promise<boolean | null> {
+ return this.redisService.get<boolean>(
+ REDIS_REQUIRED_PERMISSIONS_CACHE_KEY(userId, teamId, requiredPermissions)
+ );
+ }
+
+ private async setCacheRequiredPermissions(
+ userId: number,
+ teamId: number,
+ requiredPermissions: PermissionString[],
+ hasRequired: boolean
+ ): Promise<void> {
+ await this.redisService.set<boolean>(
+ REDIS_REQUIRED_PERMISSIONS_CACHE_KEY(userId, teamId, requiredPermissions),
+ hasRequired,
+ { ttl: 300_000 }
+ );
+ }
+
+ private async getCachePbacEnabled(teamId: number) {
+ const cachedResult = await this.redisService.get<boolean>(REDIS_PBAC_CACHE_KEY(teamId));
+ return cachedResult;
+ }
+
+ private async setCachePbacEnabled(teamId: number, pbacEnabled: boolean) {
+ await this.redisService.set<boolean>(REDIS_PBAC_CACHE_KEY(teamId), pbacEnabled, {
+ ttl: 300_000,
+ });
+ }
+
+ throwForbiddenError(
+ userId: number,
+ teamId: string,
+ orgId: string,
+ requiredPermissions: PermissionString[]
+ ) {
+ let errorMessage = `PbacGuard - user with id=${userId} does not have the minimum required permissions=${requiredPermissions.join(
+ ","
+ )} `;
+ if (teamId) {
+ errorMessage += `within team with id=${teamId}`;
+ }
+ if (orgId) {
+ errorMessage += `within organization with id=${orgId}`;
+ }
+ errorMessage += `.`;
+
+ throw new ForbiddenException(errorMessage);
+ }
+}
diff --git a/apps/api/v2/src/modules/auth/guards/roles/roles.guard.ts b/apps/api/v2/src/modules/auth/guards/roles/roles.guard.ts
index cd56544d4a2..0109f36358a 100644
--- a/apps/api/v2/src/modules/auth/guards/roles/roles.guard.ts
+++ b/apps/api/v2/src/modules/auth/guards/roles/roles.guard.ts
@@ -7,8 +7,6 @@ import { Injectable, CanActivate, ExecutionContext, ForbiddenException, Logger }
import { Reflector } from "@nestjs/core";
import { Request } from "express";
-import type { Team } from "@calcom/prisma/client";
-
@Injectable()
export class RolesGuard implements CanActivate {
private readonly logger = new Logger("RolesGuard Logger");
@@ -19,7 +17,13 @@ export class RolesGuard implements CanActivate {
) {}
async canActivate(context: ExecutionContext): Promise<boolean> {
- const request = context.switchToHttp().getRequest<Request & { team: Team }>();
+ const request = context.switchToHttp().getRequest<Request & { pbacAuthorizedRequest?: boolean }>();
+
+ if (request.pbacAuthorizedRequest === true) {
+ this.logger.debug("PBAC authorized request, skipping legacy role checking");
+ return true;
+ }
+
const teamId = request.params.teamId as string;
const orgId = request.params.orgId as string;
const user = request.user as ApiAuthGuardUser;
diff --git a/apps/api/v2/src/modules/organizations/organizations.module.ts b/apps/api/v2/src/modules/organizations/organizations.module.ts
index 4c725b7f417..58b5347796e 100644
--- a/apps/api/v2/src/modules/organizations/organizations.module.ts
+++ b/apps/api/v2/src/modules/organizations/organizations.module.ts
@@ -39,6 +39,7 @@ import { OrganizationsMembershipRepository } from "@/modules/organizations/membe
import { OrganizationsMembershipOutputService } from "@/modules/organizations/memberships/services/organizations-membership-output.service";
import { OrganizationsMembershipService } from "@/modules/organizations/memberships/services/organizations-membership.service";
import { OrganizationsOrganizationsModule } from "@/modules/organizations/organizations/organizations-organizations.module";
+import { OrganizationsRolesModule } from "@/modules/organizations/roles/organizations-roles.module";
import { OrganizationsSchedulesController } from "@/modules/organizations/schedules/organizations-schedules.controller";
import { OrganizationsSchedulesService } from "@/modules/organizations/schedules/services/organizations-schedules.service";
import { OrganizationsStripeModule } from "@/modules/organizations/stripe/organizations-stripe.module";
@@ -50,6 +51,7 @@ import { OrganizationsTeamsInviteController } from "@/modules/organizations/team
import { OrganizationsTeamsMembershipsController } from "@/modules/organizations/teams/memberships/organizations-teams-memberships.controller";
import { OrganizationsTeamsMembershipsRepository } from "@/modules/organizations/teams/memberships/organizations-teams-memberships.repository";
import { OrganizationsTeamsMembershipsService } from "@/modules/organizations/teams/memberships/services/organizations-teams-memberships.service";
+import { OrganizationsTeamsRolesModule } from "@/modules/organizations/teams/roles/organizations-teams-roles.module";
import { OrganizationsTeamsRoutingFormsModule } from "@/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.module";
import { OrganizationsTeamsSchedulesController } from "@/modules/organizations/teams/schedules/organizations-teams-schedules.controller";
import { OrganizationTeamWorkflowsController } from "@/modules/organizations/teams/workflows/controllers/org-team-workflows.controller";
@@ -96,6 +98,8 @@ import { Module } from "@nestjs/common";
TeamsModule,
OrganizationsDelegationCredentialModule,
OrganizationsOrganizationsModule,
+ OrganizationsRolesModule,
+ OrganizationsTeamsRolesModule,
OrganizationsStripeModule,
OrganizationsTeamsRoutingFormsModule,
MembershipsModule,
diff --git a/apps/api/v2/src/modules/organizations/roles/inputs/base-org-role.input.ts b/apps/api/v2/src/modules/organizations/roles/inputs/base-org-role.input.ts
new file mode 100644
index 00000000000..aee4f5cb3f9
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/inputs/base-org-role.input.ts
@@ -0,0 +1,34 @@
+import { ApiPropertyOptional } from "@nestjs/swagger";
+import { IsArray, IsOptional, IsString, Validate } from "class-validator";
+
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+import { getAllPermissionStringsForScope, Scope } from "@calcom/platform-libraries/pbac";
+
+import { OrgPermissionStringValidator } from "../permissions/inputs/validators/org-permission-string.validator";
+
+export const orgPermissionEnum = [...getAllPermissionStringsForScope(Scope.Organization)] as const;
+
+export class BaseOrgRoleInput {
+ @ApiPropertyOptional({ description: "Color for the role (hex code)" })
+ @IsString()
+ @IsOptional()
+ color?: string;
+
+ @ApiPropertyOptional({ description: "Description of the role" })
+ @IsString()
+ @IsOptional()
+ description?: string;
+
+ @ApiPropertyOptional({
+ description:
+ "Permissions for this role (format: resource.action). On update, this field replaces the entire permission set for the role (full replace). Use granular permission endpoints for one-by-one changes.",
+ enum: orgPermissionEnum,
+ isArray: true,
+ example: ["eventType.read", "eventType.create", "booking.read"],
+ })
+ @IsArray()
+ @IsString({ each: true })
+ @Validate(OrgPermissionStringValidator, { each: true })
+ @IsOptional()
+ permissions?: PermissionString[];
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/inputs/create-org-role.input.ts b/apps/api/v2/src/modules/organizations/roles/inputs/create-org-role.input.ts
new file mode 100644
index 00000000000..75b8397a933
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/inputs/create-org-role.input.ts
@@ -0,0 +1,11 @@
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MinLength } from "class-validator";
+
+import { BaseOrgRoleInput } from "./base-org-role.input";
+
+export class CreateOrgRoleInput extends BaseOrgRoleInput {
+ @ApiProperty({ description: "Name of the role", minLength: 1 })
+ @IsString()
+ @MinLength(1)
+ name!: string;
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/inputs/update-org-role.input.ts b/apps/api/v2/src/modules/organizations/roles/inputs/update-org-role.input.ts
new file mode 100644
index 00000000000..3d9840187a3
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/inputs/update-org-role.input.ts
@@ -0,0 +1,12 @@
+import { ApiPropertyOptional } from "@nestjs/swagger";
+import { IsString, IsOptional, MinLength } from "class-validator";
+
+import { BaseOrgRoleInput } from "./base-org-role.input";
+
+export class UpdateOrgRoleInput extends BaseOrgRoleInput {
+ @ApiPropertyOptional({ description: "Name of the role", minLength: 1 })
+ @IsString()
+ @MinLength(1)
+ @IsOptional()
+ name?: string;
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/organizations-roles.controller.e2e-spec.ts b/apps/api/v2/src/modules/organizations/roles/organizations-roles.controller.e2e-spec.ts
new file mode 100644
index 00000000000..88ef73256ae
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/organizations-roles.controller.e2e-spec.ts
@@ -0,0 +1,638 @@
+import { bootstrap } from "@/app";
+import { AppModule } from "@/app.module";
+import { PbacGuard } from "@/modules/auth/guards/pbac/pbac.guard";
+import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard";
+import { CreateOrgRoleInput } from "@/modules/organizations/roles/inputs/create-org-role.input";
+import { UpdateOrgRoleInput } from "@/modules/organizations/roles/inputs/update-org-role.input";
+import { CreateOrgRoleOutput } from "@/modules/organizations/roles/outputs/create-org-role.output";
+import { DeleteOrgRoleOutput } from "@/modules/organizations/roles/outputs/delete-org-role.output";
+import { GetAllOrgRolesOutput } from "@/modules/organizations/roles/outputs/get-all-org-roles.output";
+import { GetOrgRoleOutput } from "@/modules/organizations/roles/outputs/get-org-role.output";
+import { UpdateOrgRoleOutput } from "@/modules/organizations/roles/outputs/update-org-role.output";
+import { PrismaModule } from "@/modules/prisma/prisma.module";
+import { TokensModule } from "@/modules/tokens/tokens.module";
+import { UsersModule } from "@/modules/users/users.module";
+import { INestApplication } from "@nestjs/common";
+import { NestExpressApplication } from "@nestjs/platform-express";
+import { Test } from "@nestjs/testing";
+import * as request from "supertest";
+import { ApiKeysRepositoryFixture } from "test/fixtures/repository/api-keys.repository.fixture";
+import { FeaturesRepositoryFixture } from "test/fixtures/repository/features.repository.fixture";
+import { MembershipRepositoryFixture } from "test/fixtures/repository/membership.repository.fixture";
+import { OrganizationRepositoryFixture } from "test/fixtures/repository/organization.repository.fixture";
+import { UserRepositoryFixture } from "test/fixtures/repository/users.repository.fixture";
+import { randomString } from "test/utils/randomString";
+
+import { SUCCESS_STATUS } from "@calcom/platform-constants";
+import { RoleService } from "@calcom/platform-libraries/pbac";
+import type { User, Team } from "@calcom/prisma/client";
+import { MembershipRole } from "@calcom/prisma/enums";
+
+describe("Organizations Roles Endpoints", () => {
+ let app: INestApplication;
+
+ let userRepositoryFixture: UserRepositoryFixture;
+ let organizationsRepositoryFixture: OrganizationRepositoryFixture;
+ let membershipRepositoryFixture: MembershipRepositoryFixture;
+ let apiKeysRepositoryFixture: ApiKeysRepositoryFixture;
+ let featuresRepositoryFixture: FeaturesRepositoryFixture;
+ let roleService: RoleService;
+
+ // Test users
+ let legacyOrgAdminUser: User;
+ let legacyOrgMemberUser: User;
+ let pbacOrgUserWithRolePermission: User;
+ let pbacOrgUserWithoutRolePermission: User;
+ let nonOrgUser: User;
+
+ // API Keys
+ let legacyOrgAdminApiKey: string;
+ let legacyOrgMemberApiKey: string;
+ let pbacOrgUserWithRolePermissionApiKey: string;
+ let pbacOrgUserWithoutRolePermissionApiKey: string;
+ let nonOrgUserApiKey: string;
+
+ // Organization
+ let organization: Team;
+ let pbacEnabledOrganization: Team;
+
+ const legacyOrgAdminEmail = `legacy-org-admin-${randomString()}@api.com`;
+ const legacyOrgMemberEmail = `legacy-org-member-${randomString()}@api.com`;
+ const pbacOrgUserWithRolePermissionEmail = `pbac-org-user-with-role-permission-${randomString()}@api.com`;
+ const pbacOrgUserWithoutRolePermissionEmail = `pbac-org-user-without-role-permission-${randomString()}@api.com`;
+ const nonOrgUserEmail = `non-org-user-${randomString()}@api.com`;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ imports: [AppModule, PrismaModule, UsersModule, TokensModule],
+ }).compile();
+
+ userRepositoryFixture = new UserRepositoryFixture(moduleRef);
+ organizationsRepositoryFixture = new OrganizationRepositoryFixture(moduleRef);
+ membershipRepositoryFixture = new MembershipRepositoryFixture(moduleRef);
+ apiKeysRepositoryFixture = new ApiKeysRepositoryFixture(moduleRef);
+ featuresRepositoryFixture = new FeaturesRepositoryFixture(moduleRef);
+ roleService = new RoleService();
+
+ // Create test users
+ legacyOrgAdminUser = await userRepositoryFixture.create({
+ email: legacyOrgAdminEmail,
+ username: legacyOrgAdminEmail,
+ });
+
+ legacyOrgMemberUser = await userRepositoryFixture.create({
+ email: legacyOrgMemberEmail,
+ username: legacyOrgMemberEmail,
+ });
+
+ pbacOrgUserWithRolePermission = await userRepositoryFixture.create({
+ email: pbacOrgUserWithRolePermissionEmail,
+ username: pbacOrgUserWithRolePermissionEmail,
+ });
+
+ pbacOrgUserWithoutRolePermission = await userRepositoryFixture.create({
+ email: pbacOrgUserWithoutRolePermissionEmail,
+ username: pbacOrgUserWithoutRolePermissionEmail,
+ });
+
+ nonOrgUser = await userRepositoryFixture.create({
+ email: nonOrgUserEmail,
+ username: nonOrgUserEmail,
+ });
+
+ // Create organizations
+ organization = await organizationsRepositoryFixture.create({
+ name: `org-roles-test-${randomString()}`,
+ isOrganization: true,
+ });
+
+ pbacEnabledOrganization = await organizationsRepositoryFixture.create({
+ name: `pbac-org-roles-test-${randomString()}`,
+ isOrganization: true,
+ });
+
+ await featuresRepositoryFixture.create({ slug: "pbac", enabled: true });
+ await featuresRepositoryFixture.enableFeatureForTeam(pbacEnabledOrganization.id, "pbac");
+
+ // Create memberships
+ await membershipRepositoryFixture.create({
+ role: "ADMIN",
+ user: { connect: { id: legacyOrgAdminUser.id } },
+ team: { connect: { id: organization.id } },
+ });
+
+ await membershipRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: legacyOrgMemberUser.id } },
+ team: { connect: { id: organization.id } },
+ });
+
+ const pbacOrgUserWithRolePermissionMembership = await membershipRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: pbacOrgUserWithRolePermission.id } },
+ team: { connect: { id: pbacEnabledOrganization.id } },
+ });
+
+ const pbacOrgUserWithoutRolePermissionMembership = await membershipRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: pbacOrgUserWithoutRolePermission.id } },
+ team: { connect: { id: pbacEnabledOrganization.id } },
+ });
+
+ const roleWithPermission = await roleService.createRole({
+ name: "Role Manager",
+ teamId: pbacEnabledOrganization.id,
+ permissions: ["role.create", "role.read", "role.update", "role.delete"],
+ type: "CUSTOM",
+ });
+
+ const roleWithoutPermission = await roleService.createRole({
+ name: "Basic Role",
+ teamId: pbacEnabledOrganization.id,
+ permissions: ["booking.read"],
+ type: "CUSTOM",
+ });
+
+ await roleService.assignRoleToMember(roleWithPermission.id, pbacOrgUserWithRolePermissionMembership.id);
+ await roleService.assignRoleToMember(
+ roleWithoutPermission.id,
+ pbacOrgUserWithoutRolePermissionMembership.id
+ );
+
+ const { keyString: legacyOrgAdminKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ legacyOrgAdminUser.id,
+ null
+ );
+ legacyOrgAdminApiKey = `cal_test_${legacyOrgAdminKeyString}`;
+
+ const { keyString: legacyOrgMemberKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ legacyOrgMemberUser.id,
+ null
+ );
+ legacyOrgMemberApiKey = `cal_test_${legacyOrgMemberKeyString}`;
+
+ const { keyString: pbacOrgUserWithRolePermissionKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ pbacOrgUserWithRolePermission.id,
+ null
+ );
+ pbacOrgUserWithRolePermissionApiKey = `cal_test_${pbacOrgUserWithRolePermissionKeyString}`;
+
+ const { keyString: pbacOrgUserWithoutRolePermissionKeyString } =
+ await apiKeysRepositoryFixture.createApiKey(pbacOrgUserWithoutRolePermission.id, null);
+ pbacOrgUserWithoutRolePermissionApiKey = `cal_test_${pbacOrgUserWithoutRolePermissionKeyString}`;
+
+ const { keyString: nonOrgUserKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ nonOrgUser.id,
+ null
+ );
+ nonOrgUserApiKey = `cal_test_${nonOrgUserKeyString}`;
+
+ app = moduleRef.createNestApplication();
+ bootstrap(app as NestExpressApplication);
+ await app.init();
+ });
+
+ describe("Role Creation Authorization", () => {
+ beforeEach(() => {
+ jest.restoreAllMocks();
+ });
+
+ describe("Positive Tests", () => {
+ it("should allow role creation when organization has PBAC enabled and user has a create permission", async () => {
+ const createRoleInput: CreateOrgRoleInput = {
+ name: "Test Role PBAC",
+ permissions: ["booking.read", "eventType.create"],
+ };
+
+ const pbacSpyCanActivate = jest.spyOn(PbacGuard.prototype, "canActivate");
+ const pbacSpyHasPbacEnabled = jest.spyOn(
+ PbacGuard.prototype as unknown as PbacGuard,
+ "hasPbacEnabled"
+ );
+
+ const rolesSpyCanActivate = jest.spyOn(RolesGuard.prototype, "canActivate");
+ const rolesSpyCheckUserRoleAccess = jest.spyOn(
+ RolesGuard.prototype as unknown as RolesGuard,
+ "checkUserRoleAccess"
+ );
+
+ return request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(createRoleInput)
+ .expect(201)
+ .then(async (response) => {
+ const responseBody: CreateOrgRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data).toBeDefined();
+ expect(responseBody.data.name).toEqual(createRoleInput.name);
+ expect(responseBody.data.permissions).toEqual(createRoleInput.permissions);
+ expect(responseBody.data.organizationId).toEqual(pbacEnabledOrganization.id);
+
+ expect(pbacSpyCanActivate).toHaveBeenCalled();
+ expect(pbacSpyHasPbacEnabled).toHaveBeenCalled();
+ expect(rolesSpyCanActivate).toHaveBeenCalled();
+ const pbacCanActivateResult = await pbacSpyCanActivate.mock.results[0].value;
+ const rolesCanActivateResult = await rolesSpyCanActivate.mock.results[0].value;
+ const hasPbac = await pbacSpyHasPbacEnabled.mock.results[0].value;
+ expect(pbacCanActivateResult).toBe(true);
+ expect(rolesCanActivateResult).toBe(true);
+ expect(hasPbac).toBe(true);
+ expect(rolesSpyCheckUserRoleAccess).not.toHaveBeenCalled();
+ });
+ });
+
+ it("should allow role creation when organization does not have PBAC enabled and user is org admin", async () => {
+ const createRoleInput: CreateOrgRoleInput = {
+ name: "Test Role Legacy Admin",
+ permissions: ["booking.read"],
+ };
+
+ const pbacSpyCanActivate = jest.spyOn(PbacGuard.prototype, "canActivate");
+ const pbacSpyHasPbacEnabled = jest.spyOn(
+ PbacGuard.prototype as unknown as PbacGuard,
+ "hasPbacEnabled"
+ );
+ const rolesSpyCanActivate = jest.spyOn(RolesGuard.prototype, "canActivate");
+ const rolesSpyCheckUserRoleAccess = jest.spyOn(
+ RolesGuard.prototype as unknown as RolesGuard,
+ "checkUserRoleAccess"
+ );
+
+ return request(app.getHttpServer())
+ .post(`/v2/organizations/${organization.id}/roles`)
+ .set("Authorization", `Bearer ${legacyOrgAdminApiKey}`)
+ .send(createRoleInput)
+ .expect(201)
+ .then(async (response) => {
+ const responseBody: CreateOrgRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data).toBeDefined();
+ expect(responseBody.data.name).toEqual(createRoleInput.name);
+ expect(responseBody.data.organizationId).toEqual(organization.id);
+
+ expect(pbacSpyCanActivate).toHaveBeenCalled();
+ expect(rolesSpyCanActivate).toHaveBeenCalled();
+ expect(pbacSpyHasPbacEnabled).toHaveBeenCalled();
+ const pbacCanActivateResult = await pbacSpyCanActivate.mock.results[0].value;
+ const rolesCanActivateResult = await rolesSpyCanActivate.mock.results[0].value;
+ const hasPbac = await pbacSpyHasPbacEnabled.mock.results[0].value;
+ expect(pbacCanActivateResult).toBe(true);
+ expect(rolesCanActivateResult).toBe(true);
+ expect(hasPbac).toBe(false);
+ expect(rolesSpyCheckUserRoleAccess).toHaveBeenCalled();
+ });
+ });
+ });
+
+ describe("Negative Tests", () => {
+ it("should not allow role creation when organization has PBAC enabled but user has no role assigned", async () => {
+ const createRoleInput: CreateOrgRoleInput = {
+ name: "Test Role No Role",
+ permissions: ["booking.read"],
+ };
+
+ const userWithNoRole = await userRepositoryFixture.create({
+ email: `no-role-user-${randomString()}@api.com`,
+ username: `no-role-user-${randomString()}@api.com`,
+ });
+
+ await membershipRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: userWithNoRole.id } },
+ team: { connect: { id: pbacEnabledOrganization.id } },
+ });
+
+ const { keyString: noRoleKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ userWithNoRole.id,
+ null
+ );
+ const noRoleApiKey = `cal_test_${noRoleKeyString}`;
+
+ const response = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${noRoleApiKey}`)
+ .send(createRoleInput);
+ expect(response.status).toBe(403);
+ expect(response.body.error.message).toBe(
+ `RolesGuard - user with id=${userWithNoRole.id} does not have the minimum required role=ORG_ADMIN within organization with id=${pbacEnabledOrganization.id}.`
+ );
+ });
+
+ it("should not allow role creation when organization has PBAC enabled but user role lacks required permission", async () => {
+ const createRoleInput: CreateOrgRoleInput = {
+ name: "Test Role No Permission",
+ permissions: ["booking.read"],
+ };
+
+ const response = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithoutRolePermissionApiKey}`)
+ .send(createRoleInput);
+ expect(response.status).toBe(403);
+ expect(response.body.error.message).toBe(
+ `RolesGuard - user with id=${pbacOrgUserWithoutRolePermission.id} does not have the minimum required role=ORG_ADMIN within organization with id=${pbacEnabledOrganization.id}.`
+ );
+ });
+
+ it("should not allow role creation when organization does not have PBAC enabled and user has no membership", async () => {
+ const createRoleInput: CreateOrgRoleInput = {
+ name: "Test Role No Membership",
+ permissions: ["booking.read"],
+ };
+
+ const response = await request(app.getHttpServer())
+ .post(`/v2/organizations/${organization.id}/roles`)
+ .set("Authorization", `Bearer ${nonOrgUserApiKey}`)
+ .send(createRoleInput);
+ expect(response.status).toBe(403);
+ expect(response.body.error.message).toBe(
+ `RolesGuard - User is not a member of the organization with id=${organization.id}.`
+ );
+ });
+
+ it("should not allow role creation when organization does not have PBAC enabled and user has member membership (not admin)", async () => {
+ const createRoleInput: CreateOrgRoleInput = {
+ name: "Test Role Member Only",
+ permissions: ["booking.read"],
+ };
+
+ const response = await request(app.getHttpServer())
+ .post(`/v2/organizations/${organization.id}/roles`)
+ .set("Authorization", `Bearer ${legacyOrgMemberApiKey}`)
+ .send(createRoleInput);
+ expect(response.status).toBe(403);
+ expect(response.body.error.message).toBe(
+ `RolesGuard - user with id=${legacyOrgMemberUser.id} does not have the minimum required role=ORG_ADMIN within organization with id=${organization.id}.`
+ );
+ });
+ });
+
+ describe("CRUD Role Endpoints", () => {
+ let createdRoleId: string;
+
+ it("should create a role", async () => {
+ const createRoleInput: CreateOrgRoleInput = {
+ name: "CRUD Test Role",
+ permissions: ["booking.read", "eventType.create"],
+ };
+
+ return request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(createRoleInput)
+ .expect(201)
+ .then((response) => {
+ const responseBody: CreateOrgRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data).toBeDefined();
+ expect(responseBody.data.name).toEqual(createRoleInput.name);
+ expect(responseBody.data.permissions).toEqual(createRoleInput.permissions);
+ expect(responseBody.data.organizationId).toEqual(pbacEnabledOrganization.id);
+ createdRoleId = responseBody.data.id;
+ });
+ });
+
+ it("should update role permissions and name", async () => {
+ const updateRoleInput: UpdateOrgRoleInput = {
+ name: "CRUD Test Role Updated",
+ permissions: ["booking.read", "eventType.read"],
+ };
+
+ return request(app.getHttpServer())
+ .patch(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${createdRoleId}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(updateRoleInput)
+ .expect(200)
+ .then((response) => {
+ const responseBody: UpdateOrgRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.id).toEqual(createdRoleId);
+ expect(responseBody.data.name).toEqual(updateRoleInput.name);
+ expect(responseBody.data.permissions).toEqual(updateRoleInput.permissions);
+ expect(responseBody.data.organizationId).toEqual(pbacEnabledOrganization.id);
+ });
+ });
+
+ it("should fetch the role", async () => {
+ return request(app.getHttpServer())
+ .get(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${createdRoleId}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200)
+ .then((response) => {
+ const responseBody: GetOrgRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.id).toEqual(createdRoleId);
+ expect(responseBody.data.organizationId).toEqual(pbacEnabledOrganization.id);
+ });
+ });
+
+ it("should fetch all roles", async () => {
+ return request(app.getHttpServer())
+ .get(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200)
+ .then((response) => {
+ const responseBody: GetAllOrgRolesOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(Array.isArray(responseBody.data)).toBe(true);
+ expect(responseBody.data.find((r) => r.id === createdRoleId)).toBeDefined();
+ const created = responseBody.data.find((r) => r.id === createdRoleId);
+ expect(created?.organizationId).toEqual(pbacEnabledOrganization.id);
+ });
+ });
+
+ it("should delete the role", async () => {
+ return request(app.getHttpServer())
+ .delete(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${createdRoleId}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200)
+ .then((response) => {
+ const responseBody: DeleteOrgRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.id).toEqual(createdRoleId);
+ expect(responseBody.data.organizationId).toEqual(pbacEnabledOrganization.id);
+ });
+ });
+
+ describe("Negative error cases", () => {
+ it("should fail to create a role with a duplicate name (400)", async () => {
+ const name = `dup-role-${randomString()}`;
+
+ const firstCreate: CreateOrgRoleInput = { name, permissions: ["booking.read"] };
+ await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(firstCreate)
+ .expect(201);
+
+ const secondCreate: CreateOrgRoleInput = { name, permissions: ["booking.read"] };
+ const response = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(secondCreate);
+ expect(response.status).toBe(400);
+ expect(response.body.error.message).toBe(`Role with name "${name}" already exists`);
+ });
+
+ it("should fail to create a role with invalid permissions (400)", async () => {
+ const createRoleInput = {
+ name: `invalid-perms-${randomString()}`,
+ permissions: ["invalid"],
+ };
+
+ const response = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(createRoleInput);
+ expect(response.status).toBe(400);
+ expect(response.body.error.message).toBe(
+ "Permission 'invalid' must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')"
+ );
+ });
+
+ it("should return 404 when updating a role not belonging to the organization", async () => {
+ const defaultAdminRoleId = await roleService.getDefaultRoleId(MembershipRole.ADMIN);
+ const updateRoleInput: UpdateOrgRoleInput = {
+ name: `no-update-default-${randomString()}`,
+ permissions: ["booking.read"],
+ };
+
+ const response = await request(app.getHttpServer())
+ .patch(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${defaultAdminRoleId}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(updateRoleInput);
+ expect(response.status).toBe(404);
+ expect(response.body.error.message).toBe(
+ `Role with id ${defaultAdminRoleId} within team id ${pbacEnabledOrganization.id} not found`
+ );
+ });
+
+ it("should return 404 when updating a default (system) role not belonging to the organization", async () => {
+ const defaultAdminRoleId = await roleService.getDefaultRoleId(MembershipRole.ADMIN);
+ const updateRoleInput: UpdateOrgRoleInput = {
+ name: `no-update-default-${randomString()}`,
+ permissions: ["booking.read"],
+ };
+
+ const response = await request(app.getHttpServer())
+ .patch(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${defaultAdminRoleId}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(updateRoleInput);
+ expect(response.status).toBe(404);
+ expect(response.body.error.message).toBe(
+ `Role with id ${defaultAdminRoleId} within team id ${pbacEnabledOrganization.id} not found`
+ );
+ });
+
+ it("should fail to update with invalid permissions (400)", async () => {
+ // Create a fresh role to update
+ const { body: createRes } = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send({ name: `update-invalid-${randomString()}` as string, permissions: ["booking.read"] })
+ .expect(201);
+ const roleId: string = createRes.data.id;
+
+ const updateRoleInput = {
+ name: `update-invalid-${randomString()}`,
+ permissions: ["invalid"],
+ };
+
+ const response = await request(app.getHttpServer())
+ .patch(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${roleId}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(updateRoleInput);
+ expect(response.status).toBe(400);
+ expect(response.body.error.message).toBe(
+ "Permission 'invalid' must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')"
+ );
+ });
+
+ it("should return 404 when updating a role from a different organization", async () => {
+ // Create a role in a different org (legacy/non-PBAC org)
+ const foreignRole = await roleService.createRole({
+ name: `foreign-update-${randomString()}`,
+ teamId: organization.id,
+ permissions: ["booking.read"],
+ type: "CUSTOM",
+ });
+
+ const response = await request(app.getHttpServer())
+ .patch(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${foreignRole.id}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send({ permissions: ["eventType.read"] });
+ expect(response.status).toBe(404);
+ expect(response.body.error.message).toBe(
+ `Role with id ${foreignRole.id} within team id ${pbacEnabledOrganization.id} not found`
+ );
+ });
+
+ it("should return 404 when deleting a role not belonging to the organization", async () => {
+ const defaultMemberRoleId = await roleService.getDefaultRoleId(MembershipRole.MEMBER);
+ const response = await request(app.getHttpServer())
+ .delete(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${defaultMemberRoleId}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`);
+ expect(response.status).toBe(404);
+ expect(response.body.error.message).toBe(
+ `Role with id ${defaultMemberRoleId} within team id ${pbacEnabledOrganization.id} not found`
+ );
+ });
+
+ it("should return 404 when deleting a default (system) role not belonging to the organization", async () => {
+ const defaultMemberRoleId = await roleService.getDefaultRoleId(MembershipRole.MEMBER);
+ const response = await request(app.getHttpServer())
+ .delete(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${defaultMemberRoleId}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`);
+ expect(response.status).toBe(404);
+ expect(response.body.error.message).toBe(
+ `Role with id ${defaultMemberRoleId} within team id ${pbacEnabledOrganization.id} not found`
+ );
+ });
+
+ it("should return 404 when deleting a role from a different organization", async () => {
+ // Create a role in a different org
+ const foreignRole = await roleService.createRole({
+ name: `foreign-delete-${randomString()}`,
+ teamId: organization.id,
+ permissions: ["booking.read"],
+ type: "CUSTOM",
+ });
+
+ const response = await request(app.getHttpServer())
+ .delete(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${foreignRole.id}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`);
+ expect(response.status).toBe(404);
+ expect(response.body.error.message).toBe(
+ `Role with id ${foreignRole.id} within team id ${pbacEnabledOrganization.id} not found`
+ );
+ });
+ });
+ });
+ });
+
+ afterAll(async () => {
+ try {
+ await featuresRepositoryFixture.deleteTeamFeature(pbacEnabledOrganization.id, "pbac");
+
+ await organizationsRepositoryFixture.delete(organization.id);
+ await organizationsRepositoryFixture.delete(pbacEnabledOrganization.id);
+
+ await userRepositoryFixture.deleteByEmail(legacyOrgAdminUser.email);
+ await userRepositoryFixture.deleteByEmail(legacyOrgMemberUser.email);
+ await userRepositoryFixture.deleteByEmail(pbacOrgUserWithRolePermission.email);
+ await userRepositoryFixture.deleteByEmail(pbacOrgUserWithoutRolePermission.email);
+ await userRepositoryFixture.deleteByEmail(nonOrgUser.email);
+
+ try {
+ await featuresRepositoryFixture.deleteBySlug("pbac");
+ } catch (error) {
+ console.error("Cleanup error:", error);
+ }
+ } catch (error) {
+ console.error("Cleanup error:", error);
+ } finally {
+ await app.close();
+ }
+ });
+});
diff --git a/apps/api/v2/src/modules/organizations/roles/organizations-roles.controller.ts b/apps/api/v2/src/modules/organizations/roles/organizations-roles.controller.ts
new file mode 100644
index 00000000000..8a95eab6a10
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/organizations-roles.controller.ts
@@ -0,0 +1,145 @@
+import { API_VERSIONS_VALUES } from "@/lib/api-versions";
+import {
+ OPTIONAL_API_KEY_HEADER,
+ OPTIONAL_X_CAL_CLIENT_ID_HEADER,
+ OPTIONAL_X_CAL_SECRET_KEY_HEADER,
+} from "@/lib/docs/headers";
+import { PlatformPlan } from "@/modules/auth/decorators/billing/platform-plan.decorator";
+import { Pbac } from "@/modules/auth/decorators/pbac/pbac.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 { PbacGuard } from "@/modules/auth/guards/pbac/pbac.guard";
+import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard";
+import { CreateOrgRoleInput } from "@/modules/organizations/roles/inputs/create-org-role.input";
+import { UpdateOrgRoleInput } from "@/modules/organizations/roles/inputs/update-org-role.input";
+import { CreateOrgRoleOutput } from "@/modules/organizations/roles/outputs/create-org-role.output";
+import { DeleteOrgRoleOutput } from "@/modules/organizations/roles/outputs/delete-org-role.output";
+import { GetAllOrgRolesOutput } from "@/modules/organizations/roles/outputs/get-all-org-roles.output";
+import { GetOrgRoleOutput } from "@/modules/organizations/roles/outputs/get-org-role.output";
+import { UpdateOrgRoleOutput } from "@/modules/organizations/roles/outputs/update-org-role.output";
+import { OrganizationsRolesOutputService } from "@/modules/organizations/roles/services/organizations-roles-output.service";
+import { RolesService } from "@/modules/roles/services/roles.service";
+import {
+ Controller,
+ UseGuards,
+ Get,
+ Param,
+ ParseIntPipe,
+ Query,
+ Delete,
+ Patch,
+ Post,
+ Body,
+ HttpCode,
+ HttpStatus,
+} from "@nestjs/common";
+import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
+
+import { SUCCESS_STATUS } from "@calcom/platform-constants";
+import { SkipTakePagination } from "@calcom/platform-types";
+
+@Controller({
+ path: "/v2/organizations/:orgId/roles",
+ version: API_VERSIONS_VALUES,
+})
+@UseGuards(ApiAuthGuard, IsOrgGuard, PbacGuard, RolesGuard, PlatformPlanGuard, IsAdminAPIEnabledGuard)
+@DocsTags("Orgs / Roles")
+@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
+@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
+@ApiHeader(OPTIONAL_API_KEY_HEADER)
+export class OrganizationsRolesController {
+ constructor(
+ private readonly rolesService: RolesService,
+ private readonly rolesOutputService: OrganizationsRolesOutputService
+ ) {}
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.create"])
+ @Post("/")
+ @HttpCode(HttpStatus.CREATED)
+ @ApiOperation({ summary: "Create a new organization role" })
+ async createRole(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Body() body: CreateOrgRoleInput
+ ): Promise<CreateOrgRoleOutput> {
+ const role = await this.rolesService.createRole(orgId, body);
+ return {
+ status: SUCCESS_STATUS,
+ data: this.rolesOutputService.getOrganizationRoleOutput(role),
+ };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.read"])
+ @Get("/:roleId")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Get a specific organization role" })
+ async getRole(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("roleId") roleId: string
+ ): Promise<GetOrgRoleOutput> {
+ const role = await this.rolesService.getRole(orgId, roleId);
+ return {
+ status: SUCCESS_STATUS,
+ data: this.rolesOutputService.getOrganizationRoleOutput(role),
+ };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.read"])
+ @Get("/")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Get all organization roles" })
+ async getAllRoles(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Query() queryParams: SkipTakePagination
+ ): Promise<GetAllOrgRolesOutput> {
+ const { skip, take } = queryParams;
+ const roles = await this.rolesService.getTeamRoles(orgId, skip ?? 0, take ?? 250);
+ return {
+ status: SUCCESS_STATUS,
+ data: this.rolesOutputService.getOrganizationRolesOutput(roles),
+ };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.update"])
+ @Patch("/:roleId")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Update an organization role" })
+ async updateRole(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("roleId") roleId: string,
+ @Body() body: UpdateOrgRoleInput
+ ): Promise<UpdateOrgRoleOutput> {
+ const role = await this.rolesService.updateRole(orgId, roleId, body);
+ return {
+ status: SUCCESS_STATUS,
+ data: this.rolesOutputService.getOrganizationRoleOutput(role),
+ };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.delete"])
+ @Delete("/:roleId")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Delete an organization role" })
+ async deleteRole(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("roleId") roleId: string
+ ): Promise<DeleteOrgRoleOutput> {
+ const role = await this.rolesService.deleteRole(orgId, roleId);
+ return {
+ status: SUCCESS_STATUS,
+ data: this.rolesOutputService.getOrganizationRoleOutput(role),
+ };
+ }
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/organizations-roles.module.ts b/apps/api/v2/src/modules/organizations/roles/organizations-roles.module.ts
new file mode 100644
index 00000000000..a9e1d5ecf87
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/organizations-roles.module.ts
@@ -0,0 +1,17 @@
+import { MembershipsModule } from "@/modules/memberships/memberships.module";
+import { OrganizationsRepository } from "@/modules/organizations/index/organizations.repository";
+import { OrganizationsRolesPermissionsController } from "@/modules/organizations/roles/permissions/organizations-roles-permissions.controller";
+import { PrismaModule } from "@/modules/prisma/prisma.module";
+import { RedisModule } from "@/modules/redis/redis.module";
+import { RolesModule } from "@/modules/roles/roles.module";
+import { StripeModule } from "@/modules/stripe/stripe.module";
+import { Module } from "@nestjs/common";
+
+import { OrganizationsRolesController } from "./organizations-roles.controller";
+
+@Module({
+ imports: [StripeModule, PrismaModule, RedisModule, MembershipsModule, RolesModule],
+ providers: [OrganizationsRepository],
+ controllers: [OrganizationsRolesController, OrganizationsRolesPermissionsController],
+})
+export class OrganizationsRolesModule {}
diff --git a/apps/api/v2/src/modules/organizations/roles/outputs/create-org-role.output.ts b/apps/api/v2/src/modules/organizations/roles/outputs/create-org-role.output.ts
new file mode 100644
index 00000000000..3a6d0629338
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/outputs/create-org-role.output.ts
@@ -0,0 +1,20 @@
+import { OrgRoleOutput } from "@/modules/organizations/roles/outputs/org-role.output";
+import { ApiProperty } from "@nestjs/swagger";
+import { Type } from "class-transformer";
+import { IsEnum, IsNotEmptyObject, ValidateNested } from "class-validator";
+
+import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
+
+export class CreateOrgRoleOutput {
+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])
+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
+
+ @ApiProperty({
+ type: OrgRoleOutput,
+ })
+ @IsNotEmptyObject()
+ @ValidateNested()
+ @Type(() => OrgRoleOutput)
+ data!: OrgRoleOutput;
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/outputs/delete-org-role.output.ts b/apps/api/v2/src/modules/organizations/roles/outputs/delete-org-role.output.ts
new file mode 100644
index 00000000000..191b712ce13
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/outputs/delete-org-role.output.ts
@@ -0,0 +1,20 @@
+import { OrgRoleOutput } from "@/modules/organizations/roles/outputs/org-role.output";
+import { ApiProperty } from "@nestjs/swagger";
+import { Type } from "class-transformer";
+import { IsEnum, IsNotEmptyObject, ValidateNested } from "class-validator";
+
+import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
+
+export class DeleteOrgRoleOutput {
+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])
+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
+
+ @ApiProperty({
+ type: OrgRoleOutput,
+ })
+ @IsNotEmptyObject()
+ @ValidateNested()
+ @Type(() => OrgRoleOutput)
+ data!: OrgRoleOutput;
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/outputs/get-all-org-roles.output.ts b/apps/api/v2/src/modules/organizations/roles/outputs/get-all-org-roles.output.ts
new file mode 100644
index 00000000000..62936ee32a1
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/outputs/get-all-org-roles.output.ts
@@ -0,0 +1,20 @@
+import { OrgRoleOutput } from "@/modules/organizations/roles/outputs/org-role.output";
+import { ApiProperty } from "@nestjs/swagger";
+import { Type } from "class-transformer";
+import { IsEnum, IsArray, ValidateNested } from "class-validator";
+
+import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
+
+export class GetAllOrgRolesOutput {
+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])
+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
+
+ @ApiProperty({
+ type: [OrgRoleOutput],
+ })
+ @IsArray()
+ @ValidateNested({ each: true })
+ @Type(() => OrgRoleOutput)
+ data!: OrgRoleOutput[];
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/outputs/get-org-role.output.ts b/apps/api/v2/src/modules/organizations/roles/outputs/get-org-role.output.ts
new file mode 100644
index 00000000000..481047d8789
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/outputs/get-org-role.output.ts
@@ -0,0 +1,20 @@
+import { OrgRoleOutput } from "@/modules/organizations/roles/outputs/org-role.output";
+import { ApiProperty } from "@nestjs/swagger";
+import { Type } from "class-transformer";
+import { IsEnum, IsNotEmptyObject, ValidateNested } from "class-validator";
+
+import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
+
+export class GetOrgRoleOutput {
+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])
+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
+
+ @ApiProperty({
+ type: OrgRoleOutput,
+ })
+ @IsNotEmptyObject()
+ @ValidateNested()
+ @Type(() => OrgRoleOutput)
+ data!: OrgRoleOutput;
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/outputs/org-role.output.ts b/apps/api/v2/src/modules/organizations/roles/outputs/org-role.output.ts
new file mode 100644
index 00000000000..c2226241ddc
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/outputs/org-role.output.ts
@@ -0,0 +1,71 @@
+import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
+import { Expose } from "class-transformer";
+import { IsString, IsOptional, IsArray, IsEnum, IsDateString, IsNumber } from "class-validator";
+
+import { orgPermissionEnum } from "../inputs/base-org-role.input";
+
+enum RoleTypeEnum {
+ SYSTEM = "SYSTEM",
+ CUSTOM = "CUSTOM",
+}
+
+type RoleType = keyof typeof RoleTypeEnum;
+
+export class OrgRoleOutput {
+ @ApiProperty({ description: "Unique identifier for the role" })
+ @IsString()
+ @Expose()
+ id!: string;
+
+ @ApiProperty({ description: "Name of the role" })
+ @IsString()
+ @Expose()
+ name!: string;
+
+ @ApiPropertyOptional({ description: "Color for the role (hex code)" })
+ @IsString()
+ @IsOptional()
+ @Expose()
+ color?: string | null;
+
+ @ApiPropertyOptional({ description: "Description of the role" })
+ @IsString()
+ @IsOptional()
+ @Expose()
+ description?: string | null;
+
+ @ApiPropertyOptional({ description: "Organization ID this role belongs to" })
+ @IsNumber()
+ @IsOptional()
+ @Expose()
+ organizationId?: number | null;
+
+ @ApiProperty({
+ description: "Type of role",
+ enum: RoleTypeEnum,
+ })
+ @IsEnum(RoleTypeEnum)
+ @Expose()
+ type!: RoleType;
+
+ @ApiProperty({
+ description: "Permissions assigned to this role in 'resource.action' format.",
+ enum: orgPermissionEnum,
+ isArray: true,
+ example: ["booking.read", "eventType.create"],
+ })
+ @IsArray()
+ @IsString({ each: true })
+ @Expose()
+ permissions!: string[];
+
+ @ApiProperty({ description: "When the role was created" })
+ @IsDateString()
+ @Expose()
+ createdAt!: string;
+
+ @ApiProperty({ description: "When the role was last updated" })
+ @IsDateString()
+ @Expose()
+ updatedAt!: string;
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/outputs/update-org-role.output.ts b/apps/api/v2/src/modules/organizations/roles/outputs/update-org-role.output.ts
new file mode 100644
index 00000000000..5288cc55e1d
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/outputs/update-org-role.output.ts
@@ -0,0 +1,20 @@
+import { OrgRoleOutput } from "@/modules/organizations/roles/outputs/org-role.output";
+import { ApiProperty } from "@nestjs/swagger";
+import { Type } from "class-transformer";
+import { IsEnum, IsNotEmptyObject, ValidateNested } from "class-validator";
+
+import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
+
+export class UpdateOrgRoleOutput {
+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])
+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
+
+ @ApiProperty({
+ type: OrgRoleOutput,
+ })
+ @IsNotEmptyObject()
+ @ValidateNested()
+ @Type(() => OrgRoleOutput)
+ data!: OrgRoleOutput;
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/permissions/inputs/create-org-role-permissions.input.ts b/apps/api/v2/src/modules/organizations/roles/permissions/inputs/create-org-role-permissions.input.ts
new file mode 100644
index 00000000000..62f73341131
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/permissions/inputs/create-org-role-permissions.input.ts
@@ -0,0 +1,20 @@
+import { ApiProperty } from "@nestjs/swagger";
+import { IsArray, IsString, Validate } from "class-validator";
+
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+
+import { orgPermissionEnum } from "../../inputs/base-org-role.input";
+import { OrgPermissionStringValidator } from "./validators/org-permission-string.validator";
+
+export class CreateOrgRolePermissionsInput {
+ @ApiProperty({
+ description: "Permissions to add (format: resource.action)",
+ enum: orgPermissionEnum,
+ isArray: true,
+ example: ["eventType.read", "booking.read"],
+ })
+ @IsArray()
+ @IsString({ each: true })
+ @Validate(OrgPermissionStringValidator, { each: true })
+ permissions!: PermissionString[];
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/permissions/inputs/delete-org-role-permissions.query.ts b/apps/api/v2/src/modules/organizations/roles/permissions/inputs/delete-org-role-permissions.query.ts
new file mode 100644
index 00000000000..118b4ef18fb
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/permissions/inputs/delete-org-role-permissions.query.ts
@@ -0,0 +1,33 @@
+import { ApiPropertyOptional } from "@nestjs/swagger";
+import { Transform } from "class-transformer";
+import { ArrayNotEmpty, IsArray, IsOptional, IsString, Validate } from "class-validator";
+
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+
+import { orgPermissionEnum } from "../../inputs/base-org-role.input";
+import { OrgPermissionStringValidator } from "./validators/org-permission-string.validator";
+
+export class DeleteOrgRolePermissionsQuery {
+ @ApiPropertyOptional({
+ description:
+ "Permissions to remove (format: resource.action). Supports comma-separated values as well as repeated query params.",
+ example: "?permissions=eventType.read,booking.read",
+ enum: orgPermissionEnum,
+ isArray: true,
+ })
+ @IsOptional()
+ @Transform(({ value }) => {
+ if (typeof value === "string") {
+ return value
+ .split(",")
+ .map((p: string) => p.trim())
+ .filter((p: string) => p.length > 0);
+ }
+ return value;
+ })
+ @IsArray()
+ @ArrayNotEmpty({ message: "permissions cannot be empty." })
+ @IsString({ each: true })
+ @Validate(OrgPermissionStringValidator, { each: true })
+ permissions?: PermissionString[];
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/permissions/inputs/validators/org-permission-string.validator.spec.ts b/apps/api/v2/src/modules/organizations/roles/permissions/inputs/validators/org-permission-string.validator.spec.ts
new file mode 100644
index 00000000000..61c23b7fd0c
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/permissions/inputs/validators/org-permission-string.validator.spec.ts
@@ -0,0 +1,71 @@
+import { BadRequestException } from "@nestjs/common";
+
+import { OrgPermissionStringValidator } from "./org-permission-string.validator";
+
+describe("PermissionStringValidator", () => {
+ let validator: OrgPermissionStringValidator;
+
+ beforeEach(() => {
+ validator = new OrgPermissionStringValidator();
+ });
+
+ describe("validate", () => {
+ it("should return true for valid permission strings", () => {
+ const validPermissions = [
+ "eventType.read",
+ "eventType.create",
+ "eventType.update",
+ "eventType.delete",
+ "booking.read",
+ "booking.update",
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "team.read",
+ "team.invite",
+ "organization.read",
+ "organization.listMembers",
+ // no wildcards here
+ ];
+
+ validPermissions.forEach((permission) => {
+ expect(validator.validate(permission)).toBe(true);
+ });
+ });
+
+ it("should throw for invalid permission strings", () => {
+ const invalidPermissions = [
+ "invalid", // no dot
+ "invalid.", // no action
+ ".invalid", // no resource
+ "invalid.action", // invalid resource
+ "eventType.invalid", // invalid action
+ "event-type.read", // wrong format (should be eventType)
+ "", // empty string
+ "eventType..read", // double dot
+ "eventType.read.extra", // too many parts
+ ];
+
+ invalidPermissions.forEach((permission) => {
+ expect(() => validator.validate(permission)).toThrow(BadRequestException);
+ });
+ });
+
+ it("should throw for wildcard permission strings", () => {
+ const wildcardPermissions = ["*", "*.read", "eventType.*"];
+
+ wildcardPermissions.forEach((permission) => {
+ expect(() => validator.validate(permission)).toThrow(BadRequestException);
+ });
+ });
+ });
+
+ describe("defaultMessage", () => {
+ it("should return appropriate error message", () => {
+ const message = validator.defaultMessage();
+ expect(message).toContain("Permission must be a valid permission string");
+ expect(message).toContain("resource.action");
+ });
+ });
+});
diff --git a/apps/api/v2/src/modules/organizations/roles/permissions/inputs/validators/org-permission-string.validator.ts b/apps/api/v2/src/modules/organizations/roles/permissions/inputs/validators/org-permission-string.validator.ts
new file mode 100644
index 00000000000..6bd8f8c061e
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/permissions/inputs/validators/org-permission-string.validator.ts
@@ -0,0 +1,23 @@
+import { BadRequestException } from "@nestjs/common";
+import type { ValidatorConstraintInterface } from "class-validator";
+import { ValidatorConstraint } from "class-validator";
+
+import { isValidPermissionStringForScope } from "@calcom/platform-libraries/pbac";
+import { Scope } from "@calcom/platform-libraries/pbac";
+
+@ValidatorConstraint({ name: "orgPermissionStringValidator", async: false })
+export class OrgPermissionStringValidator implements ValidatorConstraintInterface {
+ validate(permission: string) {
+ const isValid = isValidPermissionStringForScope(permission, Scope.Organization);
+ if (!isValid) {
+ throw new BadRequestException(
+ `Permission '${permission}' must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')`
+ );
+ }
+ return true;
+ }
+
+ defaultMessage() {
+ return "Permission must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')";
+ }
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/permissions/organizations-roles-permissions.controller.e2e-spec.ts b/apps/api/v2/src/modules/organizations/roles/permissions/organizations-roles-permissions.controller.e2e-spec.ts
new file mode 100644
index 00000000000..4890e1a2038
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/permissions/organizations-roles-permissions.controller.e2e-spec.ts
@@ -0,0 +1,395 @@
+import { bootstrap } from "@/app";
+import { AppModule } from "@/app.module";
+import { CreateTeamRoleInput } from "@/modules/organizations/teams/roles/inputs/create-team-role.input";
+import type { CreateTeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/create-team-role.output";
+import { PrismaModule } from "@/modules/prisma/prisma.module";
+import { TokensModule } from "@/modules/tokens/tokens.module";
+import { UsersModule } from "@/modules/users/users.module";
+import { INestApplication } from "@nestjs/common";
+import { NestExpressApplication } from "@nestjs/platform-express";
+import { Test } from "@nestjs/testing";
+import * as request from "supertest";
+import { ApiKeysRepositoryFixture } from "test/fixtures/repository/api-keys.repository.fixture";
+import { FeaturesRepositoryFixture } from "test/fixtures/repository/features.repository.fixture";
+import { MembershipRepositoryFixture } from "test/fixtures/repository/membership.repository.fixture";
+import { OrganizationRepositoryFixture } from "test/fixtures/repository/organization.repository.fixture";
+import { UserRepositoryFixture } from "test/fixtures/repository/users.repository.fixture";
+import { randomString } from "test/utils/randomString";
+
+import { SUCCESS_STATUS } from "@calcom/platform-constants";
+import { RoleService } from "@calcom/platform-libraries/pbac";
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+import type { Team, User } from "@calcom/prisma/client";
+import { MembershipRole } from "@calcom/prisma/enums";
+
+describe("Organizations Roles Permissions Endpoints", () => {
+ let app: INestApplication;
+
+ let userRepositoryFixture: UserRepositoryFixture;
+ let organizationsRepositoryFixture: OrganizationRepositoryFixture;
+ let membershipRepositoryFixture: MembershipRepositoryFixture;
+ let apiKeysRepositoryFixture: ApiKeysRepositoryFixture;
+ let featuresRepositoryFixture: FeaturesRepositoryFixture;
+ let roleService: RoleService;
+
+ let pbacOrgUserWithRolePermission: User;
+ let pbacOrgUserWithRolePermissionApiKey: string;
+
+ let pbacEnabledOrganization: Team;
+
+ const pbacUserEmail = `pbac-org-user-with-permissions-${randomString()}@api.com`;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ imports: [AppModule, PrismaModule, UsersModule, TokensModule],
+ }).compile();
+
+ userRepositoryFixture = new UserRepositoryFixture(moduleRef);
+ organizationsRepositoryFixture = new OrganizationRepositoryFixture(moduleRef);
+ membershipRepositoryFixture = new MembershipRepositoryFixture(moduleRef);
+ apiKeysRepositoryFixture = new ApiKeysRepositoryFixture(moduleRef);
+ featuresRepositoryFixture = new FeaturesRepositoryFixture(moduleRef);
+ roleService = new RoleService();
+
+ // Create PBAC org
+ pbacEnabledOrganization = await organizationsRepositoryFixture.create({
+ name: `pbac-org-role-perm-test-${randomString()}`,
+ isOrganization: true,
+ });
+
+ await featuresRepositoryFixture.create({ slug: "pbac", enabled: true });
+ await featuresRepositoryFixture.enableFeatureForTeam(pbacEnabledOrganization.id, "pbac");
+
+ // Create user + membership in org
+ pbacOrgUserWithRolePermission = await userRepositoryFixture.create({
+ email: pbacUserEmail,
+ username: pbacUserEmail,
+ });
+
+ const membership = await membershipRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: pbacOrgUserWithRolePermission.id } },
+ team: { connect: { id: pbacEnabledOrganization.id } },
+ });
+
+ // Create a role that allows role.read and role.update, assign to user
+ const managerRole = await roleService.createRole({
+ name: `role-manager-${randomString()}`,
+ teamId: pbacEnabledOrganization.id,
+ permissions: ["role.create", "role.read", "role.update"],
+ type: "CUSTOM",
+ });
+ await roleService.assignRoleToMember(managerRole.id, membership.id);
+
+ // API key for user
+ const { keyString } = await apiKeysRepositoryFixture.createApiKey(pbacOrgUserWithRolePermission.id, null);
+ pbacOrgUserWithRolePermissionApiKey = `cal_test_${keyString}`;
+
+ app = moduleRef.createNestApplication();
+ bootstrap(app as NestExpressApplication);
+ await app.init();
+ });
+
+ describe("Negative Tests", () => {
+ it("rejects invalid permission on add (400)", async () => {
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `neg-add-invalid-${randomString()}`,
+ permissions: ["booking.read"],
+ };
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const roleId = createRes.body.data.id as string;
+
+ const response = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${roleId}/permissions`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send({ permissions: ["invalid"] });
+ expect(response.status).toBe(400);
+ expect(response.body.error.message).toBe(
+ "Permission 'invalid' must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')"
+ );
+ });
+
+ it("rejects invalid permission on replace (400)", async () => {
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `neg-put-invalid-${randomString()}`,
+ permissions: ["booking.read"],
+ };
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const roleId = createRes.body.data.id as string;
+
+ const response = await request(app.getHttpServer())
+ .put(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${roleId}/permissions`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send({ permissions: ["invalid"] });
+ expect(response.status).toBe(400);
+ expect(response.body.error.message).toBe(
+ "Permission 'invalid' must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')"
+ );
+ });
+
+ it("rejects invalid permission on delete single (400)", async () => {
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `neg-delone-invalid-${randomString()}`,
+ permissions: ["booking.read"],
+ };
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const roleId = createRes.body.data.id as string;
+
+ const response = await request(app.getHttpServer())
+ .delete(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${roleId}/permissions/${"invalid"}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`);
+ expect(response.status).toBe(400);
+ expect(response.body.error.message).toBe(
+ "Permission 'invalid' must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')"
+ );
+ });
+
+ it("rejects invalid permission on bulk delete (400)", async () => {
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `neg-delmany-invalid-${randomString()}`,
+ permissions: ["booking.read", "eventType.create"],
+ };
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const roleId = createRes.body.data.id as string;
+
+ const invalid = "invalid";
+ const res = await request(app.getHttpServer())
+ .delete(
+ `/v2/organizations/${
+ pbacEnabledOrganization.id
+ }/roles/${roleId}/permissions?permissions=${encodeURIComponent(`booking.read,${invalid}`)}`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`);
+
+ expect(res.status).toBe(400);
+ expect(res.body.error.message).toBe(
+ "Permission 'invalid' must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')"
+ );
+ });
+
+ it("returns 404 when modifying permissions for role not belonging to organization", async () => {
+ // Create foreign organization and role
+ const foreignOrg = await organizationsRepositoryFixture.create({
+ name: `foreign-org-${randomString()}`,
+ isOrganization: true,
+ });
+ const foreignRole = await roleService.createRole({
+ name: `foreign-role-${randomString()}`,
+ teamId: foreignOrg.id,
+ permissions: ["booking.read"],
+ type: "CUSTOM",
+ });
+
+ const response = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${foreignRole.id}/permissions`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send({ permissions: ["eventType.read"] });
+ expect(response.status).toBe(404);
+ expect(response.body.error.message).toBe(
+ `Role with id ${foreignRole.id} within team id ${pbacEnabledOrganization.id} not found`
+ );
+
+ await organizationsRepositoryFixture.delete(foreignOrg.id);
+ });
+
+ it("returns 404 when modifying permissions of a default (system) role not belonging to organization", async () => {
+ const defaultMemberRoleId = await roleService.getDefaultRoleId(MembershipRole.MEMBER);
+ const response = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${defaultMemberRoleId}/permissions`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send({ permissions: ["eventType.read"] });
+ expect(response.status).toBe(404);
+ expect(response.body.error.message).toBe(
+ `Role with id ${defaultMemberRoleId} within team id ${pbacEnabledOrganization.id} not found`
+ );
+ });
+ });
+
+ it("lists permissions for a role (GET /)", async () => {
+ const initialPermissions = ["booking.read"] as const;
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `perm-target-role-list-${randomString()}`,
+ permissions: [...initialPermissions],
+ };
+
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const responseBody: CreateTeamRoleOutput = createRes.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.permissions).toEqual(baseRoleInput.permissions);
+ const roleId = responseBody.data.id;
+
+ const listRes = await request(app.getHttpServer())
+ .get(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${roleId}/permissions`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200);
+ expect(listRes.body.status).toEqual(SUCCESS_STATUS);
+ expect(listRes.body.data).toEqual(initialPermissions);
+ });
+
+ it("adds permissions (POST /)", async () => {
+ const initialPermissions = ["booking.read"] as const;
+ const toAdd = ["eventType.create", "eventType.read"] as const;
+ const expected = [...initialPermissions, ...toAdd] as string[];
+
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `perm-target-role-add-${randomString()}`,
+ permissions: [...initialPermissions],
+ };
+
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const responseBody: CreateTeamRoleOutput = createRes.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.permissions).toEqual(baseRoleInput.permissions);
+ const roleId = responseBody.data.id;
+
+ const addRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${roleId}/permissions`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send({ permissions: toAdd })
+ .expect(200);
+ expect(addRes.body.status).toEqual(SUCCESS_STATUS);
+ expect(addRes.body.data).toEqual(expected);
+ });
+
+ it("bulk removes permissions via query (DELETE /)", async () => {
+ const initialPermissions: PermissionString[] = ["booking.read", "eventType.create", "eventType.read"];
+ const toRemove: PermissionString[] = ["eventType.create", "eventType.read"];
+ const expected: PermissionString[] = ["booking.read"];
+
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `perm-target-role-delmany-${randomString()}`,
+ permissions: initialPermissions,
+ };
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const responseBody: CreateTeamRoleOutput = createRes.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.permissions).toEqual(baseRoleInput.permissions);
+ const roleId = responseBody.data.id;
+
+ await request(app.getHttpServer())
+ .delete(
+ `/v2/organizations/${
+ pbacEnabledOrganization.id
+ }/roles/${roleId}/permissions?permissions=${toRemove.join(",")}`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(204);
+
+ const listRes = await request(app.getHttpServer())
+ .get(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${roleId}/permissions`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200);
+ expect(listRes.body.data).toEqual(expected);
+ });
+
+ it("replaces all permissions (PUT /)", async () => {
+ const initialPermissions = ["booking.read"] as const;
+ const replacement = ["booking.read", "eventType.update"] as const;
+
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `perm-target-role-put-${randomString()}`,
+ permissions: [...initialPermissions],
+ };
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const responseBody: CreateTeamRoleOutput = createRes.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.permissions).toEqual(baseRoleInput.permissions);
+ const roleId = responseBody.data.id;
+
+ const putRes = await request(app.getHttpServer())
+ .put(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${roleId}/permissions`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send({ permissions: replacement })
+ .expect(200);
+
+ expect(putRes.body.status).toEqual(SUCCESS_STATUS);
+ expect(putRes.body.data).toEqual(replacement);
+ });
+
+ it("removes a single permission (DELETE /:permission)", async () => {
+ const initialPermissions = ["booking.read", "eventType.update"] as const;
+ const toRemove = "eventType.update" as const;
+ const expected = ["booking.read"] as const;
+
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `perm-target-role-delone-${randomString()}`,
+ permissions: [...initialPermissions],
+ };
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const responseBody: CreateTeamRoleOutput = createRes.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.permissions).toEqual(baseRoleInput.permissions);
+ const roleId = responseBody.data.id;
+
+ await request(app.getHttpServer())
+ .delete(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${roleId}/permissions/${toRemove}`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(204);
+
+ const listRes = await request(app.getHttpServer())
+ .get(`/v2/organizations/${pbacEnabledOrganization.id}/roles/${roleId}/permissions`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200);
+ expect(listRes.body.data).toEqual(expected);
+ });
+
+ afterAll(async () => {
+ try {
+ // Clean up feature flag from organization
+ await featuresRepositoryFixture.deleteTeamFeature(pbacEnabledOrganization.id, "pbac");
+
+ // Clean up org
+ await organizationsRepositoryFixture.delete(pbacEnabledOrganization.id);
+
+ // Clean up user
+ await userRepositoryFixture.deleteByEmail(pbacOrgUserWithRolePermission.email);
+
+ // Clean up feature definition
+ try {
+ await featuresRepositoryFixture.deleteBySlug("pbac");
+ } catch (err) {
+ console.log(err);
+ }
+ } catch (err) {
+ console.log(err);
+ } finally {
+ await app.close();
+ }
+ });
+});
diff --git a/apps/api/v2/src/modules/organizations/roles/permissions/organizations-roles-permissions.controller.ts b/apps/api/v2/src/modules/organizations/roles/permissions/organizations-roles-permissions.controller.ts
new file mode 100644
index 00000000000..97eb19c9ae6
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/permissions/organizations-roles-permissions.controller.ts
@@ -0,0 +1,126 @@
+import { API_VERSIONS_VALUES } from "@/lib/api-versions";
+import {
+ OPTIONAL_API_KEY_HEADER,
+ OPTIONAL_X_CAL_CLIENT_ID_HEADER,
+ OPTIONAL_X_CAL_SECRET_KEY_HEADER,
+} from "@/lib/docs/headers";
+import { PlatformPlan } from "@/modules/auth/decorators/billing/platform-plan.decorator";
+import { Pbac } from "@/modules/auth/decorators/pbac/pbac.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 { PbacGuard } from "@/modules/auth/guards/pbac/pbac.guard";
+import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard";
+import { CreateOrgRolePermissionsInput } from "@/modules/organizations/roles/permissions/inputs/create-org-role-permissions.input";
+import { DeleteOrgRolePermissionsQuery } from "@/modules/organizations/roles/permissions/inputs/delete-org-role-permissions.query";
+import { GetOrgRolePermissionsOutput } from "@/modules/organizations/roles/permissions/outputs/get-org-role-permissions.output";
+import { RolesPermissionsService } from "@/modules/roles/permissions/services/roles-permissions.service";
+import {
+ Body,
+ Controller,
+ Delete,
+ Get,
+ HttpCode,
+ HttpStatus,
+ Param,
+ ParseIntPipe,
+ Put,
+ Query,
+ Post,
+ UseGuards,
+} from "@nestjs/common";
+import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
+
+import { SUCCESS_STATUS } from "@calcom/platform-constants";
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+
+@Controller({
+ path: "/v2/organizations/:orgId/roles/:roleId/permissions",
+ version: API_VERSIONS_VALUES,
+})
+@UseGuards(ApiAuthGuard, IsOrgGuard, PbacGuard, RolesGuard, PlatformPlanGuard, IsAdminAPIEnabledGuard)
+@DocsTags("Orgs / Roles / Permissions")
+@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
+@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
+@ApiHeader(OPTIONAL_API_KEY_HEADER)
+export class OrganizationsRolesPermissionsController {
+ constructor(private readonly rolePermissionsService: RolesPermissionsService) {}
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.update"])
+ @Post("/")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Add permissions to an organization role (single or batch)" })
+ async addPermissions(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("roleId") roleId: string,
+ @Body() body: CreateOrgRolePermissionsInput
+ ): Promise<GetOrgRolePermissionsOutput> {
+ const permissions = await this.rolePermissionsService.addRolePermissions(orgId, roleId, body.permissions);
+ return { status: SUCCESS_STATUS, data: permissions };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.read"])
+ @Get("/")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "List permissions for an organization role" })
+ async listPermissions(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("roleId") roleId: string
+ ): Promise<GetOrgRolePermissionsOutput> {
+ const permissions = await this.rolePermissionsService.getRolePermissions(orgId, roleId);
+ return { status: SUCCESS_STATUS, data: permissions };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.update"])
+ @Put("/")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Replace all permissions for an organization role" })
+ async setPermissions(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("roleId") roleId: string,
+ @Body() body: CreateOrgRolePermissionsInput
+ ): Promise<GetOrgRolePermissionsOutput> {
+ const permissions = await this.rolePermissionsService.setRolePermissions(
+ orgId,
+ roleId,
+ body.permissions || []
+ );
+ return { status: SUCCESS_STATUS, data: permissions };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.update"])
+ @Delete("/:permission")
+ @HttpCode(HttpStatus.NO_CONTENT)
+ @ApiOperation({ summary: "Remove a permission from an organization role" })
+ async removePermission(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("roleId") roleId: string,
+ @Param("permission") permission: PermissionString
+ ): Promise<void> {
+ await this.rolePermissionsService.removeRolePermission(orgId, roleId, permission);
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.update"])
+ @Delete("/")
+ @HttpCode(HttpStatus.NO_CONTENT)
+ @ApiOperation({ summary: "Remove multiple permissions from an organization role" })
+ async removePermissions(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("roleId") roleId: string,
+ @Query() query: DeleteOrgRolePermissionsQuery
+ ): Promise<void> {
+ await this.rolePermissionsService.removeRolePermissions(orgId, roleId, query.permissions || []);
+ }
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/permissions/outputs/get-org-role-permissions.output.ts b/apps/api/v2/src/modules/organizations/roles/permissions/outputs/get-org-role-permissions.output.ts
new file mode 100644
index 00000000000..2927eb636de
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/permissions/outputs/get-org-role-permissions.output.ts
@@ -0,0 +1,14 @@
+import { ApiProperty } from "@nestjs/swagger";
+import { IsArray, IsString } from "class-validator";
+
+import { SUCCESS_STATUS } from "@calcom/platform-constants";
+
+export class GetOrgRolePermissionsOutput {
+ @ApiProperty({ example: SUCCESS_STATUS })
+ status!: typeof SUCCESS_STATUS;
+
+ @ApiProperty({ type: [String] })
+ @IsArray()
+ @IsString({ each: true })
+ data!: string[];
+}
diff --git a/apps/api/v2/src/modules/organizations/roles/services/organizations-roles-output.service.ts b/apps/api/v2/src/modules/organizations/roles/services/organizations-roles-output.service.ts
new file mode 100644
index 00000000000..1a929d9caeb
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/roles/services/organizations-roles-output.service.ts
@@ -0,0 +1,26 @@
+import { OrgRoleOutput } from "@/modules/organizations/roles/outputs/org-role.output";
+import { TeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/team-role.output";
+import { Injectable } from "@nestjs/common";
+
+import type { Role } from "@calcom/platform-libraries/pbac";
+
+@Injectable()
+export class OrganizationsRolesOutputService {
+ getOrganizationRoleOutput(role: Role): OrgRoleOutput {
+ return {
+ id: role.id,
+ name: role.name,
+ color: role.color || null,
+ description: role.description || null,
+ organizationId: role.teamId || null,
+ type: role.type,
+ permissions: role.permissions.map((permission) => `${permission.resource}.${permission.action}`),
+ createdAt: role.createdAt.toISOString(),
+ updatedAt: role.updatedAt.toISOString(),
+ };
+ }
+
+ getOrganizationRolesOutput(roles: Role[]): TeamRoleOutput[] {
+ return roles.map((role) => this.getOrganizationRoleOutput(role));
+ }
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/inputs/base-team-role.input.ts b/apps/api/v2/src/modules/organizations/teams/roles/inputs/base-team-role.input.ts
new file mode 100644
index 00000000000..f0fad18af63
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/inputs/base-team-role.input.ts
@@ -0,0 +1,34 @@
+import { ApiPropertyOptional } from "@nestjs/swagger";
+import { IsArray, IsOptional, IsString, Validate } from "class-validator";
+
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+import { getAllPermissionStringsForScope, Scope } from "@calcom/platform-libraries/pbac";
+
+import { TeamPermissionStringValidator } from "../permissions/inputs/validators/team-permission-string.validator";
+
+export const teamPermissionEnum = [...getAllPermissionStringsForScope(Scope.Team)] as const;
+
+export class BaseTeamRoleInput {
+ @ApiPropertyOptional({ description: "Color for the role (hex code)" })
+ @IsString()
+ @IsOptional()
+ color?: string;
+
+ @ApiPropertyOptional({ description: "Description of the role" })
+ @IsString()
+ @IsOptional()
+ description?: string;
+
+ @ApiPropertyOptional({
+ description:
+ "Permissions for this role (format: resource.action). On update, this field replaces the entire permission set for the role (full replace). Use granular permission endpoints for one-by-one changes.",
+ enum: teamPermissionEnum,
+ isArray: true,
+ example: ["eventType.read", "eventType.create", "booking.read"],
+ })
+ @IsArray()
+ @IsString({ each: true })
+ @Validate(TeamPermissionStringValidator, { each: true })
+ @IsOptional()
+ permissions?: PermissionString[];
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/inputs/create-team-role.input.ts b/apps/api/v2/src/modules/organizations/teams/roles/inputs/create-team-role.input.ts
new file mode 100644
index 00000000000..35a1e56c665
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/inputs/create-team-role.input.ts
@@ -0,0 +1,11 @@
+import { ApiProperty } from "@nestjs/swagger";
+import { IsString, MinLength } from "class-validator";
+
+import { BaseTeamRoleInput } from "./base-team-role.input";
+
+export class CreateTeamRoleInput extends BaseTeamRoleInput {
+ @ApiProperty({ description: "Name of the role", minLength: 1 })
+ @IsString()
+ @MinLength(1)
+ name!: string;
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/inputs/update-team-role.input.ts b/apps/api/v2/src/modules/organizations/teams/roles/inputs/update-team-role.input.ts
new file mode 100644
index 00000000000..7df0cf86d5c
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/inputs/update-team-role.input.ts
@@ -0,0 +1,12 @@
+import { ApiPropertyOptional } from "@nestjs/swagger";
+import { IsString, IsOptional, MinLength } from "class-validator";
+
+import { BaseTeamRoleInput } from "./base-team-role.input";
+
+export class UpdateTeamRoleInput extends BaseTeamRoleInput {
+ @ApiPropertyOptional({ description: "Name of the role", minLength: 1 })
+ @IsString()
+ @MinLength(1)
+ @IsOptional()
+ name?: string;
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/organizations-teams-roles.controller.e2e-spec.ts b/apps/api/v2/src/modules/organizations/teams/roles/organizations-teams-roles.controller.e2e-spec.ts
new file mode 100644
index 00000000000..ab69ce2dd16
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/organizations-teams-roles.controller.e2e-spec.ts
@@ -0,0 +1,469 @@
+import { bootstrap } from "@/app";
+import { AppModule } from "@/app.module";
+import { CreateTeamRoleInput } from "@/modules/organizations/teams/roles/inputs/create-team-role.input";
+import { UpdateTeamRoleInput } from "@/modules/organizations/teams/roles/inputs/update-team-role.input";
+import { CreateTeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/create-team-role.output";
+import { DeleteTeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/delete-team-role.output";
+import { GetAllTeamRolesOutput } from "@/modules/organizations/teams/roles/outputs/get-all-team-roles.output";
+import { GetTeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/get-team-role.output";
+import { UpdateTeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/update-team-role.output";
+import { PrismaModule } from "@/modules/prisma/prisma.module";
+import { TokensModule } from "@/modules/tokens/tokens.module";
+import { UsersModule } from "@/modules/users/users.module";
+import { INestApplication } from "@nestjs/common";
+import { NestExpressApplication } from "@nestjs/platform-express";
+import { Test } from "@nestjs/testing";
+import * as request from "supertest";
+import { ApiKeysRepositoryFixture } from "test/fixtures/repository/api-keys.repository.fixture";
+import { FeaturesRepositoryFixture } from "test/fixtures/repository/features.repository.fixture";
+import { MembershipRepositoryFixture } from "test/fixtures/repository/membership.repository.fixture";
+import { OrganizationRepositoryFixture } from "test/fixtures/repository/organization.repository.fixture";
+import { TeamRepositoryFixture } from "test/fixtures/repository/team.repository.fixture";
+import { UserRepositoryFixture } from "test/fixtures/repository/users.repository.fixture";
+import { randomString } from "test/utils/randomString";
+
+import { SUCCESS_STATUS } from "@calcom/platform-constants";
+import { RoleService } from "@calcom/platform-libraries/pbac";
+import type { User, Team } from "@calcom/prisma/client";
+
+describe("Organizations Roles Endpoints", () => {
+ let app: INestApplication;
+
+ let userRepositoryFixture: UserRepositoryFixture;
+ let organizationsRepositoryFixture: OrganizationRepositoryFixture;
+ let teamRepositoryFixture: TeamRepositoryFixture;
+ let membershipRepositoryFixture: MembershipRepositoryFixture;
+ let apiKeysRepositoryFixture: ApiKeysRepositoryFixture;
+ let featuresRepositoryFixture: FeaturesRepositoryFixture;
+ let roleService: RoleService;
+
+ // Test users
+ let legacyOrgAdminUser: User;
+ let legacyOrgMemberUser: User;
+ let pbacOrgUserWithRolePermission: User;
+ let pbacOrgUserWithoutRolePermission: User;
+ let nonOrgUser: User;
+
+ // API Keys
+ let legacyOrgAdminApiKey: string;
+ let legacyOrgMemberApiKey: string;
+ let pbacOrgUserWithRolePermissionApiKey: string;
+ let pbacOrgUserWithoutRolePermissionApiKey: string;
+ let nonOrgUserApiKey: string;
+
+ // Organization and team
+ let organization: Team;
+ let team: Team;
+ let pbacEnabledOrganization: Team;
+ let pbacEnabledTeam: Team;
+
+ const legacyOrgAdminEmail = `legacy-org-admin-${randomString()}@api.com`;
+ const legacyOrgMemberEmail = `legacy-org-member-${randomString()}@api.com`;
+ const pbacOrgUserWithRolePermissionEmail = `pbac-org-user-with-role-permission-${randomString()}@api.com`;
+ const pbacOrgUserWithoutRolePermissionEmail = `pbac-org-user-without-role-permission-${randomString()}@api.com`;
+ const nonOrgUserEmail = `non-org-user-${randomString()}@api.com`;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ imports: [AppModule, PrismaModule, UsersModule, TokensModule],
+ }).compile();
+
+ userRepositoryFixture = new UserRepositoryFixture(moduleRef);
+ organizationsRepositoryFixture = new OrganizationRepositoryFixture(moduleRef);
+ teamRepositoryFixture = new TeamRepositoryFixture(moduleRef);
+ membershipRepositoryFixture = new MembershipRepositoryFixture(moduleRef);
+ apiKeysRepositoryFixture = new ApiKeysRepositoryFixture(moduleRef);
+ featuresRepositoryFixture = new FeaturesRepositoryFixture(moduleRef);
+ roleService = new RoleService();
+
+ // Create test users
+ legacyOrgAdminUser = await userRepositoryFixture.create({
+ email: legacyOrgAdminEmail,
+ username: legacyOrgAdminEmail,
+ });
+
+ legacyOrgMemberUser = await userRepositoryFixture.create({
+ email: legacyOrgMemberEmail,
+ username: legacyOrgMemberEmail,
+ });
+
+ pbacOrgUserWithRolePermission = await userRepositoryFixture.create({
+ email: pbacOrgUserWithRolePermissionEmail,
+ username: pbacOrgUserWithRolePermissionEmail,
+ });
+
+ pbacOrgUserWithoutRolePermission = await userRepositoryFixture.create({
+ email: pbacOrgUserWithoutRolePermissionEmail,
+ username: pbacOrgUserWithoutRolePermissionEmail,
+ });
+
+ nonOrgUser = await userRepositoryFixture.create({
+ email: nonOrgUserEmail,
+ username: nonOrgUserEmail,
+ });
+
+ // Create organizations and teams
+ organization = await organizationsRepositoryFixture.create({
+ name: `org-roles-test-${randomString()}`,
+ isOrganization: true,
+ });
+
+ team = await teamRepositoryFixture.create({
+ name: `team-roles-test-${randomString()}`,
+ isOrganization: false,
+ parent: { connect: { id: organization.id } },
+ });
+
+ pbacEnabledOrganization = await organizationsRepositoryFixture.create({
+ name: `pbac-org-roles-test-${randomString()}`,
+ isOrganization: true,
+ });
+
+ pbacEnabledTeam = await teamRepositoryFixture.create({
+ name: `pbac-team-roles-test-${randomString()}`,
+ isOrganization: false,
+ parent: { connect: { id: pbacEnabledOrganization.id } },
+ });
+
+ await featuresRepositoryFixture.create({ slug: "pbac", enabled: true });
+ await featuresRepositoryFixture.enableFeatureForTeam(pbacEnabledTeam.id, "pbac");
+
+ // Create memberships
+ await membershipRepositoryFixture.create({
+ role: "ADMIN",
+ user: { connect: { id: legacyOrgAdminUser.id } },
+ team: { connect: { id: organization.id } },
+ });
+
+ await membershipRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: legacyOrgMemberUser.id } },
+ team: { connect: { id: organization.id } },
+ });
+
+ const pbacOrgUserWithRolePermissionMembership = await membershipRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: pbacOrgUserWithRolePermission.id } },
+ team: { connect: { id: pbacEnabledOrganization.id } },
+ });
+
+ const pbacOrgUserWithoutRolePermissionMembership = await membershipRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: pbacOrgUserWithoutRolePermission.id } },
+ team: { connect: { id: pbacEnabledOrganization.id } },
+ });
+
+ const roleWithPermission = await roleService.createRole({
+ name: "Role Manager",
+ teamId: pbacEnabledOrganization.id,
+ permissions: ["role.create", "role.read", "role.update", "role.delete"],
+ type: "CUSTOM",
+ });
+
+ const roleWithoutPermission = await roleService.createRole({
+ name: "Basic Role",
+ teamId: pbacEnabledOrganization.id,
+ permissions: ["booking.read"],
+ type: "CUSTOM",
+ });
+
+ await roleService.assignRoleToMember(roleWithPermission.id, pbacOrgUserWithRolePermissionMembership.id);
+ await roleService.assignRoleToMember(
+ roleWithoutPermission.id,
+ pbacOrgUserWithoutRolePermissionMembership.id
+ );
+
+ const { keyString: legacyOrgAdminKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ legacyOrgAdminUser.id,
+ null
+ );
+ legacyOrgAdminApiKey = `cal_test_${legacyOrgAdminKeyString}`;
+
+ const { keyString: legacyOrgMemberKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ legacyOrgMemberUser.id,
+ null
+ );
+ legacyOrgMemberApiKey = `cal_test_${legacyOrgMemberKeyString}`;
+
+ const { keyString: pbacOrgUserWithRolePermissionKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ pbacOrgUserWithRolePermission.id,
+ null
+ );
+ pbacOrgUserWithRolePermissionApiKey = `cal_test_${pbacOrgUserWithRolePermissionKeyString}`;
+
+ const { keyString: pbacOrgUserWithoutRolePermissionKeyString } =
+ await apiKeysRepositoryFixture.createApiKey(pbacOrgUserWithoutRolePermission.id, null);
+ pbacOrgUserWithoutRolePermissionApiKey = `cal_test_${pbacOrgUserWithoutRolePermissionKeyString}`;
+
+ const { keyString: nonOrgUserKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ nonOrgUser.id,
+ null
+ );
+ nonOrgUserApiKey = `cal_test_${nonOrgUserKeyString}`;
+
+ app = moduleRef.createNestApplication();
+ bootstrap(app as NestExpressApplication);
+ await app.init();
+ });
+
+ describe("Role Creation Authorization", () => {
+ describe("Positive Tests", () => {
+ it("should allow role creation when organization has PBAC enabled and user has a create permission", async () => {
+ const createRoleInput: CreateTeamRoleInput = {
+ name: "Test Role PBAC",
+ permissions: ["booking.read", "eventType.create"],
+ };
+
+ return request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(createRoleInput)
+ .expect(201)
+ .then((response) => {
+ const responseBody: CreateTeamRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data).toBeDefined();
+ expect(responseBody.data.name).toEqual(createRoleInput.name);
+ expect(responseBody.data.permissions).toEqual(createRoleInput.permissions);
+ expect(responseBody.data.teamId).toEqual(pbacEnabledTeam.id);
+ });
+ });
+
+ it("should allow role creation when organization does not have PBAC enabled and user is org admin", async () => {
+ const createRoleInput: CreateTeamRoleInput = {
+ name: "Test Role Legacy Admin",
+ permissions: ["booking.read"],
+ };
+
+ return request(app.getHttpServer())
+ .post(`/v2/organizations/${organization.id}/teams/${team.id}/roles`)
+ .set("Authorization", `Bearer ${legacyOrgAdminApiKey}`)
+ .send(createRoleInput)
+ .expect(201)
+ .then((response) => {
+ const responseBody: CreateTeamRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data).toBeDefined();
+ expect(responseBody.data.name).toEqual(createRoleInput.name);
+ expect(responseBody.data.teamId).toEqual(team.id);
+ });
+ });
+ });
+
+ describe("Negative Tests", () => {
+ it("should not allow role creation when organization has PBAC enabled but user has no role assigned", async () => {
+ const createRoleInput: CreateTeamRoleInput = {
+ name: "Test Role No Role",
+ permissions: ["booking.read"],
+ };
+
+ const userWithNoRole = await userRepositoryFixture.create({
+ email: `no-role-user-${randomString()}@api.com`,
+ username: `no-role-user-${randomString()}@api.com`,
+ });
+
+ await membershipRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: userWithNoRole.id } },
+ team: { connect: { id: pbacEnabledOrganization.id } },
+ });
+
+ const { keyString: noRoleKeyString } = await apiKeysRepositoryFixture.createApiKey(
+ userWithNoRole.id,
+ null
+ );
+ const noRoleApiKey = `cal_test_${noRoleKeyString}`;
+
+ return request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles`)
+ .set("Authorization", `Bearer ${noRoleApiKey}`)
+ .send(createRoleInput)
+ .expect(403);
+ });
+
+ it("should not allow role creation when organization has PBAC enabled but user role lacks required permission", async () => {
+ const createRoleInput: CreateTeamRoleInput = {
+ name: "Test Role No Permission",
+ permissions: ["booking.read"],
+ };
+
+ return request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithoutRolePermissionApiKey}`)
+ .send(createRoleInput)
+ .expect(403);
+ });
+
+ it("should not allow role creation when organization does not have PBAC enabled and user has no membership", async () => {
+ const createRoleInput: CreateTeamRoleInput = {
+ name: "Test Role No Membership",
+ permissions: ["booking.read"],
+ };
+
+ return request(app.getHttpServer())
+ .post(`/v2/organizations/${organization.id}/teams/${team.id}/roles`)
+ .set("Authorization", `Bearer ${nonOrgUserApiKey}`)
+ .send(createRoleInput)
+ .expect(403);
+ });
+
+ it("should not allow role creation when organization does not have PBAC enabled and user has member membership (not admin)", async () => {
+ const createRoleInput: CreateTeamRoleInput = {
+ name: "Test Role Member Only",
+ permissions: ["booking.read"],
+ };
+
+ return request(app.getHttpServer())
+ .post(`/v2/organizations/${organization.id}/teams/${team.id}/roles`)
+ .set("Authorization", `Bearer ${legacyOrgMemberApiKey}`)
+ .send(createRoleInput)
+ .expect(403);
+ });
+ });
+ });
+
+ describe("CRUD Role Endpoints", () => {
+ let createdRoleId: string;
+
+ it("should create a role", async () => {
+ const createRoleInput: CreateTeamRoleInput = {
+ name: "CRUD Test Role",
+ permissions: ["booking.read", "eventType.create"],
+ };
+
+ return request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(createRoleInput)
+ .expect(201)
+ .then((response) => {
+ const responseBody: CreateTeamRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data).toBeDefined();
+ expect(responseBody.data.name).toEqual(createRoleInput.name);
+ expect(responseBody.data.permissions).toEqual(createRoleInput.permissions);
+ expect(responseBody.data.teamId).toEqual(pbacEnabledTeam.id);
+ createdRoleId = responseBody.data.id;
+ });
+ });
+
+ it("should update role permissions and name", async () => {
+ const updateRoleInput: UpdateTeamRoleInput = {
+ name: "CRUD Test Role Updated",
+ permissions: ["booking.read", "eventType.read"],
+ };
+
+ return request(app.getHttpServer())
+ .patch(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles/${createdRoleId}`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(updateRoleInput)
+ .expect(200)
+ .then((response) => {
+ const responseBody: UpdateTeamRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.id).toEqual(createdRoleId);
+ expect(responseBody.data.name).toEqual(updateRoleInput.name);
+ expect(responseBody.data.permissions).toEqual(updateRoleInput.permissions);
+ expect(responseBody.data.teamId).toEqual(pbacEnabledTeam.id);
+ });
+ });
+
+ it("should update only name and keep permissions unchanged", async () => {
+ const updateNameOnly: UpdateTeamRoleInput = {
+ name: "CRUD Test Role Renamed Only",
+ };
+ const expectedPermissions = ["booking.read", "eventType.read"]; // from previous update
+
+ return request(app.getHttpServer())
+ .patch(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles/${createdRoleId}`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(updateNameOnly)
+ .expect(200)
+ .then((response) => {
+ const responseBody: UpdateTeamRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.id).toEqual(createdRoleId);
+ expect(responseBody.data.name).toEqual(updateNameOnly.name);
+ expect(responseBody.data.permissions).toEqual(expectedPermissions);
+ expect(responseBody.data.teamId).toEqual(pbacEnabledTeam.id);
+ });
+ });
+
+ it("should fetch the role", async () => {
+ return request(app.getHttpServer())
+ .get(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles/${createdRoleId}`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200)
+ .then((response) => {
+ const responseBody: GetTeamRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.id).toEqual(createdRoleId);
+ expect(responseBody.data.teamId).toEqual(pbacEnabledTeam.id);
+ });
+ });
+
+ it("should fetch all roles", async () => {
+ return request(app.getHttpServer())
+ .get(`/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200)
+ .then((response) => {
+ const responseBody: GetAllTeamRolesOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(Array.isArray(responseBody.data)).toBe(true);
+ expect(responseBody.data.find((r) => r.id === createdRoleId)).toBeDefined();
+ const created = responseBody.data.find((r) => r.id === createdRoleId);
+ expect(created?.teamId).toEqual(pbacEnabledTeam.id);
+ });
+ });
+
+ it("should delete the role", async () => {
+ return request(app.getHttpServer())
+ .delete(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles/${createdRoleId}`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200)
+ .then((response) => {
+ const responseBody: DeleteTeamRoleOutput = response.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.id).toEqual(createdRoleId);
+ expect(responseBody.data.teamId).toEqual(pbacEnabledTeam.id);
+ });
+ });
+ });
+
+ afterAll(async () => {
+ try {
+ await featuresRepositoryFixture.deleteTeamFeature(pbacEnabledTeam.id, "pbac");
+
+ await teamRepositoryFixture.delete(team.id);
+ await teamRepositoryFixture.delete(pbacEnabledTeam.id);
+
+ await organizationsRepositoryFixture.delete(organization.id);
+ await organizationsRepositoryFixture.delete(pbacEnabledOrganization.id);
+
+ await userRepositoryFixture.deleteByEmail(legacyOrgAdminUser.email);
+ await userRepositoryFixture.deleteByEmail(legacyOrgMemberUser.email);
+ await userRepositoryFixture.deleteByEmail(pbacOrgUserWithRolePermission.email);
+ await userRepositoryFixture.deleteByEmail(pbacOrgUserWithoutRolePermission.email);
+ await userRepositoryFixture.deleteByEmail(nonOrgUser.email);
+
+ try {
+ await featuresRepositoryFixture.deleteBySlug("pbac");
+ } catch (error) {
+ console.error("Cleanup error:", error);
+ }
+ } catch (error) {
+ console.error("Cleanup error:", error);
+ } finally {
+ await app.close();
+ }
+ });
+});
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/organizations-teams-roles.controller.ts b/apps/api/v2/src/modules/organizations/teams/roles/organizations-teams-roles.controller.ts
new file mode 100644
index 00000000000..8b150a91037
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/organizations-teams-roles.controller.ts
@@ -0,0 +1,159 @@
+import { API_VERSIONS_VALUES } from "@/lib/api-versions";
+import {
+ OPTIONAL_API_KEY_HEADER,
+ OPTIONAL_X_CAL_CLIENT_ID_HEADER,
+ OPTIONAL_X_CAL_SECRET_KEY_HEADER,
+} from "@/lib/docs/headers";
+import { PlatformPlan } from "@/modules/auth/decorators/billing/platform-plan.decorator";
+import { Pbac } from "@/modules/auth/decorators/pbac/pbac.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 { PbacGuard } from "@/modules/auth/guards/pbac/pbac.guard";
+import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard";
+import { IsTeamInOrg } from "@/modules/auth/guards/teams/is-team-in-org.guard";
+import { CreateTeamRoleInput } from "@/modules/organizations/teams/roles/inputs/create-team-role.input";
+import { UpdateTeamRoleInput } from "@/modules/organizations/teams/roles/inputs/update-team-role.input";
+import { CreateTeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/create-team-role.output";
+import { DeleteTeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/delete-team-role.output";
+import { GetAllTeamRolesOutput } from "@/modules/organizations/teams/roles/outputs/get-all-team-roles.output";
+import { GetTeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/get-team-role.output";
+import { UpdateTeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/update-team-role.output";
+import { TeamRolesOutputService } from "@/modules/organizations/teams/roles/services/team-roles-output.service";
+import { RolesService } from "@/modules/roles/services/roles.service";
+import {
+ Controller,
+ UseGuards,
+ Get,
+ Param,
+ ParseIntPipe,
+ Query,
+ Delete,
+ Patch,
+ Post,
+ Body,
+ HttpCode,
+ HttpStatus,
+} from "@nestjs/common";
+import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
+
+import { SUCCESS_STATUS } from "@calcom/platform-constants";
+import { SkipTakePagination } from "@calcom/platform-types";
+
+@Controller({
+ path: "/v2/organizations/:orgId/teams/:teamId/roles",
+ version: API_VERSIONS_VALUES,
+})
+@UseGuards(
+ ApiAuthGuard,
+ IsOrgGuard,
+ PbacGuard,
+ RolesGuard,
+ IsTeamInOrg,
+ PlatformPlanGuard,
+ IsAdminAPIEnabledGuard
+)
+@DocsTags("Orgs / Teams / Roles")
+@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
+@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
+@ApiHeader(OPTIONAL_API_KEY_HEADER)
+export class OrganizationsTeamsRolesController {
+ constructor(
+ private readonly rolesService: RolesService,
+ private readonly rolesOutputService: TeamRolesOutputService
+ ) {}
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.create"])
+ @Post("/")
+ @HttpCode(HttpStatus.CREATED)
+ @ApiOperation({ summary: "Create a new organization team role" })
+ async createRole(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("teamId", ParseIntPipe) teamId: number,
+ @Body() body: CreateTeamRoleInput
+ ): Promise<CreateTeamRoleOutput> {
+ const role = await this.rolesService.createRole(teamId, body);
+ return {
+ status: SUCCESS_STATUS,
+ data: this.rolesOutputService.getTeamRoleOutput(role),
+ };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.read"])
+ @Get("/:roleId")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Get a specific organization team role" })
+ async getRole(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("teamId", ParseIntPipe) teamId: number,
+ @Param("roleId") roleId: string
+ ): Promise<GetTeamRoleOutput> {
+ const role = await this.rolesService.getRole(teamId, roleId);
+ return {
+ status: SUCCESS_STATUS,
+ data: this.rolesOutputService.getTeamRoleOutput(role),
+ };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.read"])
+ @Get("/")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Get all organization team roles" })
+ async getAllRoles(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("teamId", ParseIntPipe) teamId: number,
+ @Query() queryParams: SkipTakePagination
+ ): Promise<GetAllTeamRolesOutput> {
+ const { skip, take } = queryParams;
+ const roles = await this.rolesService.getTeamRoles(teamId, skip ?? 0, take ?? 250);
+ return {
+ status: SUCCESS_STATUS,
+ data: this.rolesOutputService.getTeamRolesOutput(roles),
+ };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.update"])
+ @Patch("/:roleId")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Update an organization team role" })
+ async updateRole(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("teamId", ParseIntPipe) teamId: number,
+ @Param("roleId") roleId: string,
+ @Body() body: UpdateTeamRoleInput
+ ): Promise<UpdateTeamRoleOutput> {
+ const role = await this.rolesService.updateRole(teamId, roleId, body);
+ return {
+ status: SUCCESS_STATUS,
+ data: this.rolesOutputService.getTeamRoleOutput(role),
+ };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.delete"])
+ @Delete("/:roleId")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Delete an organization team role" })
+ async deleteRole(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("teamId", ParseIntPipe) teamId: number,
+ @Param("roleId") roleId: string
+ ): Promise<DeleteTeamRoleOutput> {
+ const role = await this.rolesService.deleteRole(teamId, roleId);
+ return {
+ status: SUCCESS_STATUS,
+ data: this.rolesOutputService.getTeamRoleOutput(role),
+ };
+ }
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/organizations-teams-roles.module.ts b/apps/api/v2/src/modules/organizations/teams/roles/organizations-teams-roles.module.ts
new file mode 100644
index 00000000000..7321539306a
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/organizations-teams-roles.module.ts
@@ -0,0 +1,18 @@
+import { MembershipsModule } from "@/modules/memberships/memberships.module";
+import { OrganizationsRepository } from "@/modules/organizations/index/organizations.repository";
+import { OrganizationsTeamsRepository } from "@/modules/organizations/teams/index/organizations-teams.repository";
+import { OrganizationsTeamsRolesPermissionsController } from "@/modules/organizations/teams/roles/permissions/organizations-teams-roles-permissions.controller";
+import { PrismaModule } from "@/modules/prisma/prisma.module";
+import { RedisModule } from "@/modules/redis/redis.module";
+import { RolesModule } from "@/modules/roles/roles.module";
+import { StripeModule } from "@/modules/stripe/stripe.module";
+import { Module } from "@nestjs/common";
+
+import { OrganizationsTeamsRolesController } from "./organizations-teams-roles.controller";
+
+@Module({
+ imports: [StripeModule, PrismaModule, RedisModule, MembershipsModule, RolesModule],
+ providers: [OrganizationsRepository, OrganizationsTeamsRepository],
+ controllers: [OrganizationsTeamsRolesController, OrganizationsTeamsRolesPermissionsController],
+})
+export class OrganizationsTeamsRolesModule {}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/outputs/create-team-role.output.ts b/apps/api/v2/src/modules/organizations/teams/roles/outputs/create-team-role.output.ts
new file mode 100644
index 00000000000..77fa4d5f867
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/outputs/create-team-role.output.ts
@@ -0,0 +1,20 @@
+import { TeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/team-role.output";
+import { ApiProperty } from "@nestjs/swagger";
+import { Type } from "class-transformer";
+import { IsEnum, IsNotEmptyObject, ValidateNested } from "class-validator";
+
+import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
+
+export class CreateTeamRoleOutput {
+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])
+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
+
+ @ApiProperty({
+ type: TeamRoleOutput,
+ })
+ @IsNotEmptyObject()
+ @ValidateNested()
+ @Type(() => TeamRoleOutput)
+ data!: TeamRoleOutput;
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/outputs/delete-team-role.output.ts b/apps/api/v2/src/modules/organizations/teams/roles/outputs/delete-team-role.output.ts
new file mode 100644
index 00000000000..fae7ca6d23c
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/outputs/delete-team-role.output.ts
@@ -0,0 +1,20 @@
+import { TeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/team-role.output";
+import { ApiProperty } from "@nestjs/swagger";
+import { Type } from "class-transformer";
+import { IsEnum, IsNotEmptyObject, ValidateNested } from "class-validator";
+
+import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
+
+export class DeleteTeamRoleOutput {
+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])
+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
+
+ @ApiProperty({
+ type: TeamRoleOutput,
+ })
+ @IsNotEmptyObject()
+ @ValidateNested()
+ @Type(() => TeamRoleOutput)
+ data!: TeamRoleOutput;
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/outputs/get-all-team-roles.output.ts b/apps/api/v2/src/modules/organizations/teams/roles/outputs/get-all-team-roles.output.ts
new file mode 100644
index 00000000000..404088d5c91
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/outputs/get-all-team-roles.output.ts
@@ -0,0 +1,20 @@
+import { TeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/team-role.output";
+import { ApiProperty } from "@nestjs/swagger";
+import { Type } from "class-transformer";
+import { IsEnum, IsArray, ValidateNested } from "class-validator";
+
+import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
+
+export class GetAllTeamRolesOutput {
+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])
+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
+
+ @ApiProperty({
+ type: [TeamRoleOutput],
+ })
+ @IsArray()
+ @ValidateNested({ each: true })
+ @Type(() => TeamRoleOutput)
+ data!: TeamRoleOutput[];
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/outputs/get-team-role.output.ts b/apps/api/v2/src/modules/organizations/teams/roles/outputs/get-team-role.output.ts
new file mode 100644
index 00000000000..8a0b52835b8
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/outputs/get-team-role.output.ts
@@ -0,0 +1,20 @@
+import { TeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/team-role.output";
+import { ApiProperty } from "@nestjs/swagger";
+import { Type } from "class-transformer";
+import { IsEnum, IsNotEmptyObject, ValidateNested } from "class-validator";
+
+import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
+
+export class GetTeamRoleOutput {
+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])
+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
+
+ @ApiProperty({
+ type: TeamRoleOutput,
+ })
+ @IsNotEmptyObject()
+ @ValidateNested()
+ @Type(() => TeamRoleOutput)
+ data!: TeamRoleOutput;
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/outputs/team-role.output.ts b/apps/api/v2/src/modules/organizations/teams/roles/outputs/team-role.output.ts
new file mode 100644
index 00000000000..98c56d2d3c7
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/outputs/team-role.output.ts
@@ -0,0 +1,71 @@
+import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
+import { Expose } from "class-transformer";
+import { IsString, IsOptional, IsArray, IsEnum, IsDateString, IsNumber } from "class-validator";
+
+import { teamPermissionEnum } from "../inputs/base-team-role.input";
+
+enum RoleTypeEnum {
+ SYSTEM = "SYSTEM",
+ CUSTOM = "CUSTOM",
+}
+
+type RoleType = keyof typeof RoleTypeEnum;
+
+export class TeamRoleOutput {
+ @ApiProperty({ description: "Unique identifier for the role" })
+ @IsString()
+ @Expose()
+ id!: string;
+
+ @ApiProperty({ description: "Name of the role" })
+ @IsString()
+ @Expose()
+ name!: string;
+
+ @ApiPropertyOptional({ description: "Color for the role (hex code)" })
+ @IsString()
+ @IsOptional()
+ @Expose()
+ color?: string | null;
+
+ @ApiPropertyOptional({ description: "Description of the role" })
+ @IsString()
+ @IsOptional()
+ @Expose()
+ description?: string | null;
+
+ @ApiPropertyOptional({ description: "Team ID this role belongs to" })
+ @IsNumber()
+ @IsOptional()
+ @Expose()
+ teamId?: number | null;
+
+ @ApiProperty({
+ description: "Type of role",
+ enum: RoleTypeEnum,
+ })
+ @IsEnum(RoleTypeEnum)
+ @Expose()
+ type!: RoleType;
+
+ @ApiProperty({
+ description: "Permissions assigned to this role in 'resource.action' format.",
+ enum: teamPermissionEnum,
+ isArray: true,
+ example: ["booking.read", "eventType.create"],
+ })
+ @IsArray()
+ @IsString({ each: true })
+ @Expose()
+ permissions!: string[];
+
+ @ApiProperty({ description: "When the role was created" })
+ @IsDateString()
+ @Expose()
+ createdAt!: string;
+
+ @ApiProperty({ description: "When the role was last updated" })
+ @IsDateString()
+ @Expose()
+ updatedAt!: string;
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/outputs/update-team-role.output.ts b/apps/api/v2/src/modules/organizations/teams/roles/outputs/update-team-role.output.ts
new file mode 100644
index 00000000000..bea1e365d28
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/outputs/update-team-role.output.ts
@@ -0,0 +1,20 @@
+import { TeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/team-role.output";
+import { ApiProperty } from "@nestjs/swagger";
+import { Type } from "class-transformer";
+import { IsEnum, IsNotEmptyObject, ValidateNested } from "class-validator";
+
+import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
+
+export class UpdateTeamRoleOutput {
+ @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
+ @IsEnum([SUCCESS_STATUS, ERROR_STATUS])
+ status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
+
+ @ApiProperty({
+ type: TeamRoleOutput,
+ })
+ @IsNotEmptyObject()
+ @ValidateNested()
+ @Type(() => TeamRoleOutput)
+ data!: TeamRoleOutput;
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/create-team-role-permissions.input.ts b/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/create-team-role-permissions.input.ts
new file mode 100644
index 00000000000..0ae5a2acee0
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/create-team-role-permissions.input.ts
@@ -0,0 +1,20 @@
+import { ApiProperty } from "@nestjs/swagger";
+import { IsArray, IsString, Validate } from "class-validator";
+
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+
+import { teamPermissionEnum } from "../../inputs/base-team-role.input";
+import { TeamPermissionStringValidator } from "./validators/team-permission-string.validator";
+
+export class CreateTeamRolePermissionsInput {
+ @ApiProperty({
+ description: "Permissions to add (format: resource.action)",
+ enum: teamPermissionEnum,
+ isArray: true,
+ example: ["eventType.read", "booking.read"],
+ })
+ @IsArray()
+ @IsString({ each: true })
+ @Validate(TeamPermissionStringValidator, { each: true })
+ permissions!: PermissionString[];
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/delete-team-role-permissions.query.ts b/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/delete-team-role-permissions.query.ts
new file mode 100644
index 00000000000..12c0af36736
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/delete-team-role-permissions.query.ts
@@ -0,0 +1,33 @@
+import { ApiPropertyOptional } from "@nestjs/swagger";
+import { Transform } from "class-transformer";
+import { ArrayNotEmpty, IsArray, IsOptional, IsString, Validate } from "class-validator";
+
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+
+import { teamPermissionEnum } from "../../inputs/base-team-role.input";
+import { TeamPermissionStringValidator } from "./validators/team-permission-string.validator";
+
+export class DeleteTeamRolePermissionsQuery {
+ @ApiPropertyOptional({
+ description:
+ "Permissions to remove (format: resource.action). Supports comma-separated values as well as repeated query params.",
+ example: "?permissions=eventType.read,booking.read",
+ enum: teamPermissionEnum,
+ isArray: true,
+ })
+ @IsOptional()
+ @Transform(({ value }) => {
+ if (typeof value === "string") {
+ return value
+ .split(",")
+ .map((p: string) => p.trim())
+ .filter((p: string) => p.length > 0);
+ }
+ return value;
+ })
+ @IsArray()
+ @ArrayNotEmpty({ message: "permissions cannot be empty." })
+ @IsString({ each: true })
+ @Validate(TeamPermissionStringValidator, { each: true })
+ permissions?: PermissionString[];
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/validators/team-permission-string.validator.spec.ts b/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/validators/team-permission-string.validator.spec.ts
new file mode 100644
index 00000000000..d603355df11
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/validators/team-permission-string.validator.spec.ts
@@ -0,0 +1,88 @@
+import { BadRequestException } from "@nestjs/common";
+
+import { TeamPermissionStringValidator } from "./team-permission-string.validator";
+
+describe("PermissionStringValidator", () => {
+ let validator: TeamPermissionStringValidator;
+
+ beforeEach(() => {
+ validator = new TeamPermissionStringValidator();
+ });
+
+ describe("validate", () => {
+ it("should return true for valid permission strings", () => {
+ const validPermissions = [
+ "eventType.read",
+ "eventType.create",
+ "eventType.update",
+ "eventType.delete",
+ "booking.read",
+ "booking.update",
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "team.read",
+ "team.invite",
+ ];
+
+ validPermissions.forEach((permission) => {
+ expect(validator.validate(permission)).toBe(true);
+ });
+ });
+
+ it("should throw for wildcard permission strings", () => {
+ const wildcardPermissions = ["*", "*.read", "eventType.*"];
+
+ wildcardPermissions.forEach((permission) => {
+ expect(() => validator.validate(permission)).toThrow(BadRequestException);
+ });
+ });
+
+ it("should throw for invalid permission strings", () => {
+ const invalidPermissions = [
+ "invalid", // no dot
+ "invalid.", // no action
+ ".invalid", // no resource
+ "invalid.action", // invalid resource
+ "eventType.invalid", // invalid action
+ "event-type.read", // wrong format (should be eventType)
+ "", // empty string
+ "eventType..read", // double dot
+ "eventType.read.extra", // too many parts
+ ];
+
+ invalidPermissions.forEach((permission) => {
+ expect(() => validator.validate(permission)).toThrow(BadRequestException);
+ });
+ });
+
+ it("should throw for organization-scoped permission strings", () => {
+ // These are explicitly marked with scope: [Scope.Organization] in permission-registry
+ const orgScoped = [
+ "organization.create",
+ "organization.read",
+ "organization.listMembers",
+ "organization.listMembersPrivate",
+ "organization.invite",
+ "organization.remove",
+ "organization.manageBilling",
+ "organization.changeMemberRole",
+ "organization.impersonate",
+ "organization.update",
+ ];
+
+ orgScoped.forEach((permission) => {
+ expect(() => validator.validate(permission)).toThrow(BadRequestException);
+ });
+ });
+ });
+
+ describe("defaultMessage", () => {
+ it("should return appropriate error message", () => {
+ const message = validator.defaultMessage();
+ expect(message).toContain("Permission must be a valid permission string");
+ expect(message).toContain("resource.action");
+ });
+ });
+});
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/validators/team-permission-string.validator.ts b/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/validators/team-permission-string.validator.ts
new file mode 100644
index 00000000000..674a6235455
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/permissions/inputs/validators/team-permission-string.validator.ts
@@ -0,0 +1,23 @@
+import { BadRequestException } from "@nestjs/common";
+import type { ValidatorConstraintInterface } from "class-validator";
+import { ValidatorConstraint } from "class-validator";
+
+import { isValidPermissionStringForScope } from "@calcom/platform-libraries/pbac";
+import { Scope } from "@calcom/platform-libraries/pbac";
+
+@ValidatorConstraint({ name: "teamPermissionStringValidator", async: false })
+export class TeamPermissionStringValidator implements ValidatorConstraintInterface {
+ validate(permission: string) {
+ const isValid = isValidPermissionStringForScope(permission, Scope.Team);
+ if (!isValid) {
+ throw new BadRequestException(
+ `Permission '${permission}' must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')`
+ );
+ }
+ return true;
+ }
+
+ defaultMessage() {
+ return "Permission must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')";
+ }
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/permissions/organizations-teams-roles-permissions.controller.e2e-spec.ts b/apps/api/v2/src/modules/organizations/teams/roles/permissions/organizations-teams-roles-permissions.controller.e2e-spec.ts
new file mode 100644
index 00000000000..a7a949b94d1
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/permissions/organizations-teams-roles-permissions.controller.e2e-spec.ts
@@ -0,0 +1,287 @@
+import { bootstrap } from "@/app";
+import { AppModule } from "@/app.module";
+import { CreateTeamRoleInput } from "@/modules/organizations/teams/roles/inputs/create-team-role.input";
+import type { CreateTeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/create-team-role.output";
+import { PrismaModule } from "@/modules/prisma/prisma.module";
+import { TokensModule } from "@/modules/tokens/tokens.module";
+import { UsersModule } from "@/modules/users/users.module";
+import { INestApplication } from "@nestjs/common";
+import { NestExpressApplication } from "@nestjs/platform-express";
+import { Test } from "@nestjs/testing";
+import * as request from "supertest";
+import { ApiKeysRepositoryFixture } from "test/fixtures/repository/api-keys.repository.fixture";
+import { FeaturesRepositoryFixture } from "test/fixtures/repository/features.repository.fixture";
+import { MembershipRepositoryFixture } from "test/fixtures/repository/membership.repository.fixture";
+import { OrganizationRepositoryFixture } from "test/fixtures/repository/organization.repository.fixture";
+import { TeamRepositoryFixture } from "test/fixtures/repository/team.repository.fixture";
+import { UserRepositoryFixture } from "test/fixtures/repository/users.repository.fixture";
+import { randomString } from "test/utils/randomString";
+
+import { SUCCESS_STATUS } from "@calcom/platform-constants";
+import { RoleService } from "@calcom/platform-libraries/pbac";
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+import type { Team, User } from "@calcom/prisma/client";
+
+describe("Organizations Teams Roles Permissions Endpoints", () => {
+ let app: INestApplication;
+
+ let userRepositoryFixture: UserRepositoryFixture;
+ let organizationsRepositoryFixture: OrganizationRepositoryFixture;
+ let teamRepositoryFixture: TeamRepositoryFixture;
+ let membershipRepositoryFixture: MembershipRepositoryFixture;
+ let apiKeysRepositoryFixture: ApiKeysRepositoryFixture;
+ let featuresRepositoryFixture: FeaturesRepositoryFixture;
+ let roleService: RoleService;
+
+ let pbacOrgUserWithRolePermission: User;
+ let pbacOrgUserWithRolePermissionApiKey: string;
+
+ let pbacEnabledOrganization: Team;
+ let pbacEnabledTeam: Team;
+
+ const pbacUserEmail = `pbac-org-user-with-permissions-${randomString()}@api.com`;
+
+ beforeAll(async () => {
+ const moduleRef = await Test.createTestingModule({
+ imports: [AppModule, PrismaModule, UsersModule, TokensModule],
+ }).compile();
+
+ userRepositoryFixture = new UserRepositoryFixture(moduleRef);
+ organizationsRepositoryFixture = new OrganizationRepositoryFixture(moduleRef);
+ teamRepositoryFixture = new TeamRepositoryFixture(moduleRef);
+ membershipRepositoryFixture = new MembershipRepositoryFixture(moduleRef);
+ apiKeysRepositoryFixture = new ApiKeysRepositoryFixture(moduleRef);
+ featuresRepositoryFixture = new FeaturesRepositoryFixture(moduleRef);
+ roleService = new RoleService();
+
+ // Create PBAC org/team
+ pbacEnabledOrganization = await organizationsRepositoryFixture.create({
+ name: `pbac-org-role-perm-test-${randomString()}`,
+ isOrganization: true,
+ });
+
+ pbacEnabledTeam = await teamRepositoryFixture.create({
+ name: `pbac-team-role-perm-test-${randomString()}`,
+ isOrganization: false,
+ parent: { connect: { id: pbacEnabledOrganization.id } },
+ });
+
+ await featuresRepositoryFixture.create({ slug: "pbac", enabled: true });
+ await featuresRepositoryFixture.enableFeatureForTeam(pbacEnabledTeam.id, "pbac");
+
+ // Create user + membership in org
+ pbacOrgUserWithRolePermission = await userRepositoryFixture.create({
+ email: pbacUserEmail,
+ username: pbacUserEmail,
+ });
+
+ const membership = await membershipRepositoryFixture.create({
+ role: "MEMBER",
+ user: { connect: { id: pbacOrgUserWithRolePermission.id } },
+ team: { connect: { id: pbacEnabledOrganization.id } },
+ });
+
+ // Create a role that allows role.read and role.update, assign to user
+ const managerRole = await roleService.createRole({
+ name: `role-manager-${randomString()}`,
+ teamId: pbacEnabledOrganization.id,
+ permissions: ["role.create", "role.read", "role.update"],
+ type: "CUSTOM",
+ });
+ await roleService.assignRoleToMember(managerRole.id, membership.id);
+
+ // API key for user
+ const { keyString } = await apiKeysRepositoryFixture.createApiKey(pbacOrgUserWithRolePermission.id, null);
+ pbacOrgUserWithRolePermissionApiKey = `cal_test_${keyString}`;
+
+ app = moduleRef.createNestApplication();
+ bootstrap(app as NestExpressApplication);
+ await app.init();
+ });
+
+ it("lists permissions for a role (GET /)", async () => {
+ const initialPermissions = ["booking.read"] as const;
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `perm-target-role-list-${randomString()}`,
+ permissions: [...initialPermissions],
+ };
+
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const responseBody: CreateTeamRoleOutput = createRes.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.permissions).toEqual(baseRoleInput.permissions);
+ const roleId = responseBody.data.id;
+
+ const listRes = await request(app.getHttpServer())
+ .get(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles/${roleId}/permissions`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200);
+ expect(listRes.body.status).toEqual(SUCCESS_STATUS);
+ expect(listRes.body.data).toEqual(initialPermissions);
+ });
+
+ it("adds permissions (POST /)", async () => {
+ const initialPermissions = ["booking.read"] as const;
+ const toAdd = ["eventType.create", "eventType.read"] as const;
+ const expected = [...initialPermissions, ...toAdd] as string[];
+
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `perm-target-role-add-${randomString()}`,
+ permissions: [...initialPermissions],
+ };
+
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const responseBody: CreateTeamRoleOutput = createRes.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.permissions).toEqual(baseRoleInput.permissions);
+ const roleId = responseBody.data.id;
+
+ const addRes = await request(app.getHttpServer())
+ .post(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles/${roleId}/permissions`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send({ permissions: toAdd })
+ .expect(200);
+ expect(addRes.body.status).toEqual(SUCCESS_STATUS);
+ expect(addRes.body.data).toEqual(expected);
+ });
+
+ it("bulk removes permissions via query (DELETE /)", async () => {
+ // Seed role
+ const initialPermissions: PermissionString[] = ["booking.read", "eventType.create", "eventType.read"];
+ const toRemove: PermissionString[] = ["eventType.create", "eventType.read"];
+ const expected: PermissionString[] = ["booking.read"];
+
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `perm-target-role-delmany-${randomString()}`,
+ permissions: initialPermissions,
+ };
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const responseBody: CreateTeamRoleOutput = createRes.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.permissions).toEqual(baseRoleInput.permissions);
+ const roleId = responseBody.data.id;
+
+ await request(app.getHttpServer())
+ .delete(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${
+ pbacEnabledTeam.id
+ }/roles/${roleId}/permissions?permissions=${toRemove.join(",")}`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(204);
+
+ const listRes = await request(app.getHttpServer())
+ .get(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles/${roleId}/permissions`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200);
+ expect(listRes.body.data).toEqual(expected);
+ });
+
+ it("replaces all permissions (PUT /)", async () => {
+ const initialPermissions = ["booking.read"] as const;
+ const replacement = ["booking.read", "eventType.update"] as const;
+
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `perm-target-role-put-${randomString()}`,
+ permissions: [...initialPermissions],
+ };
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const responseBody: CreateTeamRoleOutput = createRes.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.permissions).toEqual(baseRoleInput.permissions);
+ const roleId = responseBody.data.id;
+
+ const putRes = await request(app.getHttpServer())
+ .put(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles/${roleId}/permissions`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send({ permissions: replacement })
+ .expect(200);
+
+ expect(putRes.body.status).toEqual(SUCCESS_STATUS);
+ expect(putRes.body.data).toEqual(replacement);
+ });
+
+ it("removes a single permission (DELETE /:permission)", async () => {
+ const initialPermissions = ["booking.read", "eventType.update"] as const;
+ const toRemove = "eventType.update" as const;
+ const expected = ["booking.read"] as const;
+
+ const baseRoleInput: CreateTeamRoleInput = {
+ name: `perm-target-role-delone-${randomString()}`,
+ permissions: [...initialPermissions],
+ };
+ const createRes = await request(app.getHttpServer())
+ .post(`/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles`)
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .send(baseRoleInput)
+ .expect(201);
+ const responseBody: CreateTeamRoleOutput = createRes.body;
+ expect(responseBody.status).toEqual(SUCCESS_STATUS);
+ expect(responseBody.data.permissions).toEqual(baseRoleInput.permissions);
+ const roleId = responseBody.data.id;
+
+ await request(app.getHttpServer())
+ .delete(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles/${roleId}/permissions/${toRemove}`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(204);
+
+ const listRes = await request(app.getHttpServer())
+ .get(
+ `/v2/organizations/${pbacEnabledOrganization.id}/teams/${pbacEnabledTeam.id}/roles/${roleId}/permissions`
+ )
+ .set("Authorization", `Bearer ${pbacOrgUserWithRolePermissionApiKey}`)
+ .expect(200);
+ expect(listRes.body.data).toEqual(expected);
+ });
+
+ afterAll(async () => {
+ try {
+ // Clean up feature flag from team
+ await featuresRepositoryFixture.deleteTeamFeature(pbacEnabledTeam.id, "pbac");
+
+ // Clean up teams and orgs
+ await teamRepositoryFixture.delete(pbacEnabledTeam.id);
+ await organizationsRepositoryFixture.delete(pbacEnabledOrganization.id);
+
+ // Clean up user
+ await userRepositoryFixture.deleteByEmail(pbacOrgUserWithRolePermission.email);
+
+ // Clean up feature definition
+ try {
+ await featuresRepositoryFixture.deleteBySlug("pbac");
+ } catch (err) {
+ console.log(err);
+ }
+ } catch (err) {
+ console.log(err);
+ } finally {
+ await app.close();
+ }
+ });
+});
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/permissions/organizations-teams-roles-permissions.controller.ts b/apps/api/v2/src/modules/organizations/teams/roles/permissions/organizations-teams-roles-permissions.controller.ts
new file mode 100644
index 00000000000..f2fc201d9b2
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/permissions/organizations-teams-roles-permissions.controller.ts
@@ -0,0 +1,144 @@
+import { API_VERSIONS_VALUES } from "@/lib/api-versions";
+import {
+ OPTIONAL_API_KEY_HEADER,
+ OPTIONAL_X_CAL_CLIENT_ID_HEADER,
+ OPTIONAL_X_CAL_SECRET_KEY_HEADER,
+} from "@/lib/docs/headers";
+import { PlatformPlan } from "@/modules/auth/decorators/billing/platform-plan.decorator";
+import { Pbac } from "@/modules/auth/decorators/pbac/pbac.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 { PbacGuard } from "@/modules/auth/guards/pbac/pbac.guard";
+import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard";
+import { IsTeamInOrg } from "@/modules/auth/guards/teams/is-team-in-org.guard";
+import { CreateTeamRolePermissionsInput } from "@/modules/organizations/teams/roles/permissions/inputs/create-team-role-permissions.input";
+import { DeleteTeamRolePermissionsQuery } from "@/modules/organizations/teams/roles/permissions/inputs/delete-team-role-permissions.query";
+import { GetTeamRolePermissionsOutput } from "@/modules/organizations/teams/roles/permissions/outputs/get-team-role-permissions.output";
+import { RolesPermissionsService } from "@/modules/roles/permissions/services/roles-permissions.service";
+import {
+ Body,
+ Controller,
+ Delete,
+ Get,
+ HttpCode,
+ HttpStatus,
+ Param,
+ ParseIntPipe,
+ Put,
+ Query,
+ Post,
+ UseGuards,
+} from "@nestjs/common";
+import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
+
+import { SUCCESS_STATUS } from "@calcom/platform-constants";
+import type { PermissionString } from "@calcom/platform-libraries/pbac";
+
+@Controller({
+ path: "/v2/organizations/:orgId/teams/:teamId/roles/:roleId/permissions",
+ version: API_VERSIONS_VALUES,
+})
+@UseGuards(
+ ApiAuthGuard,
+ IsOrgGuard,
+ PbacGuard,
+ RolesGuard,
+ IsTeamInOrg,
+ PlatformPlanGuard,
+ IsAdminAPIEnabledGuard
+)
+@DocsTags("Orgs / Teams / Roles / Permissions")
+@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
+@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
+@ApiHeader(OPTIONAL_API_KEY_HEADER)
+export class OrganizationsTeamsRolesPermissionsController {
+ constructor(private readonly rolePermissionsService: RolesPermissionsService) {}
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.update"])
+ @Post("/")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Add permissions to an organization team role (single or batch)" })
+ async addPermissions(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("teamId", ParseIntPipe) teamId: number,
+ @Param("roleId") roleId: string,
+ @Body() body: CreateTeamRolePermissionsInput
+ ): Promise<GetTeamRolePermissionsOutput> {
+ const permissions = await this.rolePermissionsService.addRolePermissions(
+ teamId,
+ roleId,
+ body.permissions
+ );
+ return { status: SUCCESS_STATUS, data: permissions };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.read"])
+ @Get("/")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "List permissions for an organization team role" })
+ async listPermissions(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("teamId", ParseIntPipe) teamId: number,
+ @Param("roleId") roleId: string
+ ): Promise<GetTeamRolePermissionsOutput> {
+ const permissions = await this.rolePermissionsService.getRolePermissions(teamId, roleId);
+ return { status: SUCCESS_STATUS, data: permissions };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.update"])
+ @Put("/")
+ @HttpCode(HttpStatus.OK)
+ @ApiOperation({ summary: "Replace all permissions for an organization team role" })
+ async setPermissions(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("teamId", ParseIntPipe) teamId: number,
+ @Param("roleId") roleId: string,
+ @Body() body: CreateTeamRolePermissionsInput
+ ): Promise<GetTeamRolePermissionsOutput> {
+ const permissions = await this.rolePermissionsService.setRolePermissions(
+ teamId,
+ roleId,
+ body.permissions || []
+ );
+ return { status: SUCCESS_STATUS, data: permissions };
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.update"])
+ @Delete("/:permission")
+ @HttpCode(HttpStatus.NO_CONTENT)
+ @ApiOperation({ summary: "Remove a permission from an organization team role" })
+ async removePermission(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("teamId", ParseIntPipe) teamId: number,
+ @Param("roleId") roleId: string,
+ @Param("permission") permission: PermissionString
+ ): Promise<void> {
+ await this.rolePermissionsService.removeRolePermission(teamId, roleId, permission);
+ }
+
+ @Roles("ORG_ADMIN")
+ @PlatformPlan("SCALE")
+ @Pbac(["role.update"])
+ @Delete("/")
+ @HttpCode(HttpStatus.NO_CONTENT)
+ @ApiOperation({ summary: "Remove multiple permissions from an organization team role" })
+ async removePermissions(
+ @Param("orgId", ParseIntPipe) orgId: number,
+ @Param("teamId", ParseIntPipe) teamId: number,
+ @Param("roleId") roleId: string,
+ @Query() query: DeleteTeamRolePermissionsQuery
+ ): Promise<void> {
+ await this.rolePermissionsService.removeRolePermissions(teamId, roleId, query.permissions || []);
+ }
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/permissions/outputs/get-team-role-permissions.output.ts b/apps/api/v2/src/modules/organizations/teams/roles/permissions/outputs/get-team-role-permissions.output.ts
new file mode 100644
index 00000000000..0d9297a52eb
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/permissions/outputs/get-team-role-permissions.output.ts
@@ -0,0 +1,14 @@
+import { ApiProperty } from "@nestjs/swagger";
+import { IsArray, IsString } from "class-validator";
+
+import { SUCCESS_STATUS } from "@calcom/platform-constants";
+
+export class GetTeamRolePermissionsOutput {
+ @ApiProperty({ example: SUCCESS_STATUS })
+ status!: typeof SUCCESS_STATUS;
+
+ @ApiProperty({ type: [String] })
+ @IsArray()
+ @IsString({ each: true })
+ data!: string[];
+}
diff --git a/apps/api/v2/src/modules/organizations/teams/roles/services/team-roles-output.service.ts b/apps/api/v2/src/modules/organizations/teams/roles/services/team-roles-output.service.ts
new file mode 100644
index 00000000000..60bbfb889dd
--- /dev/null
+++ b/apps/api/v2/src/modules/organizations/teams/roles/services/team-roles-output.service.ts
@@ -0,0 +1,25 @@
+import { TeamRoleOutput } from "@/modules/organizations/teams/roles/outputs/team-role.output";
+import { Injectable } from "@nestjs/common";
+
+import type { Role } from "@calcom/platform-libraries/pbac";
+
+@Injectable()
+export class TeamRolesOutputService {
+ getTeamRoleOutput(role: Role): TeamRoleOutput {
+ return {
+ id: role.id,
+ name: role.name,
+ color: role.color || null,
+ description: role.description || null,
+ teamId: role.teamId || null,
+ type: role.type,
+ permissions: role.permissions.map((permission) => `${permission.resource}.${permission.action}`),
+ createdAt: role.createdAt.toISOString(),
+ updatedAt: role.updatedAt.toISOString(),
+ };
+ }
+
+ getTeamRolesOutput(roles: Role[]): TeamRoleOutput[] {
+ return roles.map((role) => this.getTeamRoleOutput(role));
+ }
+}
diff --git a/apps/api/v2/src/modules/redis/redis.service.ts b/apps/api/v2/src/modules/redis/redis.service.ts
index 952ae149184..4958ac9b1ec 100644
--- a/apps/api/v2/src/modules/redis/redis.service.ts
+++ b/apps/api/v2/src/modules/redis/redis.service.ts
@@ -61,7 +61,7 @@ export class RedisService implements OnModuleDestroy {
try {
return JSON.parse(data) as TData;
- } catch (e) {
+ } catch {
return data as TData;
}
}
@@ -78,6 +78,30 @@ export class RedisService implements OnModuleDestroy {
}
}
+ async getKeys(pattern: string): Promise<string[]> {
+ if (!this.isReady) {
+ return [];
+ }
+ try {
+ return this.redis.keys(pattern);
+ } catch (err) {
+ if (err instanceof Error) this.logger.error(`IoRedis getKeys failed: ${err.message}`);
+ return [];
+ }
+ }
+
+ async delMany(keys: string[]): Promise<number> {
+ if (!this.isReady || keys.length === 0) {
+ return 0;
+ }
+ try {
+ return this.redis.del(...keys);
+ } catch (err) {
+ if (err instanceof Error) this.logger.error(`IoRedis delMany failed: ${err.message}`);
+ return 0;
+ }
+ }
+
async set<TData>(key: string, value: TData, opts?: { ttl?: number }): Promise<"OK" | TData | null> {
if (!this.isReady) {
return null;
@@ -137,4 +161,16 @@ export class RedisService implements OnModuleDestroy {
return 0;
}
}
+
+ async incr(key: string): Promise<number> {
+ if (!this.isReady) {
+ return 0;
+ }
+ try {
+ return this.redis.incr(key);
+ } catch (err) {
+ if (err instanceof Error) this.logger.error(`IoRedis incr failed: ${err.message}`);
+ return 0;
+ }
+ }
}
diff --git a/apps/api/v2/src/modules/roles/permissions/services/roles-permissions-cache.service.ts b/apps/api/v2/src/modules/roles/permissions/services/roles-permissions-cache.service.ts
new file mode 100644
index 00000000000..6d0211055b9
--- /dev/null
+++ b/apps/api/v2/src/modules/roles/permissions/services/roles-permissions-cache.service.ts
@@ -0,0 +1,28 @@
+import { RedisService } from "@/modules/redis/redis.service";
+import { Injectable, Logger } from "@nestjs/common";
+
+export const REDIS_TEAM_PERMISSIONS_CACHE_PATTERN = (teamId: number) =>
+ `apiv2:user:*:team:${teamId}:requiredPermissions:*:guard:pbac`;
+
+@Injectable()
+export class RolesPermissionsCacheService {
+ private readonly logger = new Logger(RolesPermissionsCacheService.name);
+
+ constructor(private readonly redisService: RedisService) {}
+
+ async deleteTeamPermissionsCache(teamId: number): Promise<void> {
+ try {
+ const pattern = REDIS_TEAM_PERMISSIONS_CACHE_PATTERN(teamId);
+ const keys = await this.redisService.getKeys(pattern);
+
+ if (keys.length > 0) {
+ await this.redisService.delMany(keys);
+ this.logger.log(`Deleted ${keys.length} permission cache keys for team ${teamId}`);
+ } else {
+ this.logger.log(`No permission cache keys found for team ${teamId}`);
+ }
+ } catch (error) {
+ this.logger.error(`Failed to delete permission cache for team ${teamId}:`, error);
+ }
+ }
+}
diff --git a/apps/api/v2/src/modules/roles/permissions/services/roles-permissions-output.service.ts b/apps/api/v2/src/modules/roles/permissions/services/roles-permissions-output.service.ts
new file mode 100644
index 00000000000..ca4d8fd08d3
--- /dev/null
+++ b/apps/api/v2/src/modules/roles/permissions/services/roles-permissions-output.service.ts
@@ -0,0 +1,12 @@
+import { Injectable } from "@nestjs/common";
+
+import type { PermissionString, Role } from "@calcom/platform-libraries/pbac";
+
+@Injectable()
+export class RolesPermissionsOutputService {
+ getPermissionsFromRole(role: Role): PermissionString[] {
+ return role.permissions.map(
+ (permission) => `${permission.resource}.${permission.action}` as PermissionString
+ );
+ }
+}
diff --git a/apps/api/v2/src/modules/roles/permissions/services/roles-permissions.service.ts b/apps/api/v2/src/modules/roles/permissions/services/roles-permissions.service.ts
new file mode 100644
index 00000000000..adafce62757
--- /dev/null
+++ b/apps/api/v2/src/modules/roles/permissions/services/roles-permissions.service.ts
@@ -0,0 +1,172 @@
+import { RolesPermissionsCacheService } from "@/modules/roles/permissions/services/roles-permissions-cache.service";
+import { RolesPermissionsOutputService } from "@/modules/roles/permissions/services/roles-permissions-output.service";
+import { BadRequestException, Injectable, NotFoundException } from "@nestjs/common";
+
+import type { PermissionString, UpdateRolePermissionsData } from "@calcom/platform-libraries/pbac";
+import { RoleService, isValidPermissionString } from "@calcom/platform-libraries/pbac";
+
+@Injectable()
+export class RolesPermissionsService {
+ constructor(
+ private readonly roleService: RoleService,
+ private readonly rolesPermissionsOutputService: RolesPermissionsOutputService,
+ private readonly rolesPermissionsCacheService: RolesPermissionsCacheService
+ ) {}
+
+ async getRolePermissions(teamId: number, roleId: string) {
+ const belongsToTeam = await this.roleService.roleBelongsToTeam(roleId, teamId);
+ if (!belongsToTeam) {
+ throw new NotFoundException(`Role with id ${roleId} within team id ${teamId} not found`);
+ }
+
+ const role = await this.roleService.getRole(roleId);
+ if (!role) {
+ throw new NotFoundException(`Role with id ${roleId} within team id ${teamId} not found`);
+ }
+
+ return this.rolesPermissionsOutputService.getPermissionsFromRole(role);
+ }
+
+ async addRolePermissions(teamId: number, roleId: string, permissionsToAdd: PermissionString[]) {
+ const belongsToTeam = await this.roleService.roleBelongsToTeam(roleId, teamId);
+ if (!belongsToTeam) {
+ throw new NotFoundException(`Role with id ${roleId} within team id ${teamId} not found`);
+ }
+
+ const current = await this.getRolePermissions(teamId, roleId);
+ const desired = Array.from(new Set([...(current || []), ...(permissionsToAdd || [])]));
+
+ const updateData: UpdateRolePermissionsData = {
+ roleId,
+ permissions: desired,
+ updates: {},
+ };
+
+ try {
+ const updatedRole = await this.roleService.update(updateData);
+
+ await this.rolesPermissionsCacheService.deleteTeamPermissionsCache(teamId);
+
+ return this.rolesPermissionsOutputService.getPermissionsFromRole(updatedRole);
+ } catch (error) {
+ if (error instanceof Error && error.message.includes("Invalid permissions provided")) {
+ throw new BadRequestException(error.message);
+ }
+ throw error;
+ }
+ }
+
+ async removeRolePermission(teamId: number, roleId: string, permissionToRemove: PermissionString) {
+ if (!isValidPermissionString(permissionToRemove)) {
+ throw new BadRequestException(
+ `Permission '${permissionToRemove}' must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')`
+ );
+ }
+ const belongsToTeam = await this.roleService.roleBelongsToTeam(roleId, teamId);
+ if (!belongsToTeam) {
+ throw new NotFoundException(`Role with id ${roleId} within team id ${teamId} not found`);
+ }
+
+ const current = await this.getRolePermissions(teamId, roleId);
+ const desired = (current || []).filter((p) => p !== permissionToRemove);
+
+ const updateData: UpdateRolePermissionsData = {
+ roleId,
+ permissions: desired,
+ updates: {},
+ };
+
+ try {
+ const updatedRole = await this.roleService.update(updateData);
+
+ await this.rolesPermissionsCacheService.deleteTeamPermissionsCache(teamId);
+
+ return this.rolesPermissionsOutputService.getPermissionsFromRole(updatedRole);
+ } catch (error) {
+ if (error instanceof Error) {
+ if (error.message.includes("Invalid permissions provided")) {
+ throw new BadRequestException(error.message);
+ }
+ if (error.message.includes("Cannot update default roles")) {
+ throw new BadRequestException(error.message);
+ }
+ }
+ throw error;
+ }
+ }
+
+ async removeRolePermissions(teamId: number, roleId: string, permissionsToRemove: PermissionString[]) {
+ if (permissionsToRemove && permissionsToRemove.length > 0) {
+ for (const permission of permissionsToRemove) {
+ if (!isValidPermissionString(permission)) {
+ throw new BadRequestException(
+ `Permission '${permission}' must be a valid permission string in format 'resource.action' (e.g., 'eventType.read', 'booking.create')`
+ );
+ }
+ }
+ }
+ const belongsToTeam = await this.roleService.roleBelongsToTeam(roleId, teamId);
+ if (!belongsToTeam) {
+ throw new NotFoundException(`Role with id ${roleId} within team id ${teamId} not found`);
+ }
+
+ const current = await this.getRolePermissions(teamId, roleId);
+ const toRemove = new Set(permissionsToRemove || []);
+ const desired = (current || []).filter((p) => !toRemove.has(p));
+
+ const updateData: UpdateRolePermissionsData = {
+ roleId,
+ permissions: desired,
+ updates: {},
+ };
+
+ try {
+ const updatedRole = await this.roleService.update(updateData);
+
+ await this.rolesPermissionsCacheService.deleteTeamPermissionsCache(teamId);
+
+ return this.rolesPermissionsOutputService.getPermissionsFromRole(updatedRole);
+ } catch (error) {
+ if (error instanceof Error) {
+ if (error.message.includes("Invalid permissions provided")) {
+ throw new BadRequestException(error.message);
+ }
+ if (error.message.includes("Cannot update default roles")) {
+ throw new BadRequestException(error.message);
+ }
+ }
+ throw error;
+ }
+ }
+
+ async setRolePermissions(teamId: number, roleId: string, permissions: PermissionString[]) {
+ const belongsToTeam = await this.roleService.roleBelongsToTeam(roleId, teamId);
+ if (!belongsToTeam) {
+ throw new NotFoundException(`Role with id ${roleId} within team id ${teamId} not found`);
+ }
+
+ const updateData: UpdateRolePermissionsData = {
+ roleId,
+ permissions,
+ updates: {},
+ };
+
+ try {
+ const updatedRole = await this.roleService.update(updateData);
+
+ await this.rolesPermissionsCacheService.deleteTeamPermissionsCache(teamId);
+
+ return this.rolesPermissionsOutputService.getPermissionsFromRole(updatedRole);
+ } catch (error) {
+ if (error instanceof Error) {
+ if (error.message.includes("Invalid permissions provided")) {
+ throw new BadRequestException(error.message);
+ }
+ if (error.message.includes("Cannot update default roles")) {
+ throw new BadRequestException(error.message);
+ }
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/api/v2/src/modules/roles/roles.module.ts b/apps/api/v2/src/modules/roles/roles.module.ts
new file mode 100644
index 00000000000..a39f66eacf6
--- /dev/null
+++ b/apps/api/v2/src/modules/roles/roles.module.ts
@@ -0,0 +1,39 @@
+import { MembershipsModule } from "@/modules/memberships/memberships.module";
+import { OrganizationsRolesOutputService } from "@/modules/organizations/roles/services/organizations-roles-output.service";
+import { PrismaModule } from "@/modules/prisma/prisma.module";
+import { RedisModule } from "@/modules/redis/redis.module";
+import { StripeModule } from "@/modules/stripe/stripe.module";
+import { Module } from "@nestjs/common";
+
+import { RoleService } from "@calcom/platform-libraries/pbac";
+
+import { TeamRolesOutputService } from "../organizations/teams/roles/services/team-roles-output.service";
+import { RolesPermissionsCacheService } from "./permissions/services/roles-permissions-cache.service";
+import { RolesPermissionsOutputService } from "./permissions/services/roles-permissions-output.service";
+import { RolesPermissionsService } from "./permissions/services/roles-permissions.service";
+import { RolesService } from "./services/roles.service";
+
+@Module({
+ imports: [StripeModule, PrismaModule, RedisModule, MembershipsModule],
+ providers: [
+ {
+ provide: RoleService,
+ useFactory: () => new RoleService(),
+ },
+ RolesService,
+ TeamRolesOutputService,
+ OrganizationsRolesOutputService,
+ RolesPermissionsService,
+ RolesPermissionsOutputService,
+ RolesPermissionsCacheService,
+ ],
+ exports: [
+ RolesService,
+ TeamRolesOutputService,
+ OrganizationsRolesOutputService,
+ RolesPermissionsService,
+ RolesPermissionsOutputService,
+ RolesPermissionsCacheService,
+ ],
+})
+export class RolesModule {}
diff --git a/apps/api/v2/src/modules/roles/services/roles.service.ts b/apps/api/v2/src/modules/roles/services/roles.service.ts
new file mode 100644
index 00000000000..fe2534ed0b4
--- /dev/null
+++ b/apps/api/v2/src/modules/roles/services/roles.service.ts
@@ -0,0 +1,143 @@
+import { CreateTeamRoleInput } from "@/modules/organizations/teams/roles/inputs/create-team-role.input";
+import { UpdateTeamRoleInput } from "@/modules/organizations/teams/roles/inputs/update-team-role.input";
+import { RolesPermissionsCacheService } from "@/modules/roles/permissions/services/roles-permissions-cache.service";
+import { BadRequestException, Injectable, NotFoundException, Logger } from "@nestjs/common";
+
+import { RoleService } from "@calcom/platform-libraries/pbac";
+import type { CreateRoleData, UpdateRolePermissionsData } from "@calcom/platform-libraries/pbac";
+
+@Injectable()
+export class RolesService {
+ private readonly logger = new Logger(RolesService.name);
+ constructor(
+ private readonly rolesService: RoleService,
+ private readonly rolesPermissionsCacheService: RolesPermissionsCacheService
+ ) {}
+
+ async createRole(teamId: number, data: CreateTeamRoleInput) {
+ const createRoleData: CreateRoleData = {
+ name: data.name,
+ color: data.color,
+ description: data.description,
+ permissions: data.permissions || [],
+ teamId: teamId,
+ type: "CUSTOM",
+ };
+
+ try {
+ const role = await this.rolesService.createRole(createRoleData);
+
+ await this.rolesPermissionsCacheService.deleteTeamPermissionsCache(teamId);
+
+ return role;
+ } catch (error) {
+ this.logger.error(
+ `RolesService - createRole failed (teamId=${teamId}, roleName=${data.name}): ${
+ error instanceof Error ? `${error.name}: ${error.message}` : String(error)
+ }`,
+ error instanceof Error ? error.stack : undefined
+ );
+ if (error instanceof Error) {
+ if (error.message.includes("already exists")) {
+ throw new BadRequestException(error.message);
+ }
+ // Map permission validation failures from PBAC service
+ if (error.message.toLowerCase().includes("permission")) {
+ throw new BadRequestException(error.message);
+ }
+ }
+ throw error;
+ }
+ }
+
+ async getRole(teamId: number, roleId: string) {
+ const role = await this.rolesService.getRole(roleId);
+
+ if (!role || role.teamId !== teamId) {
+ throw new NotFoundException(`Role with id ${roleId} within team id ${teamId} not found`);
+ }
+
+ return role;
+ }
+
+ async getTeamRoles(teamId: number, skip = 0, take = 250) {
+ const allRoles = await this.rolesService.getTeamRoles(teamId);
+
+ const paginatedRoles = allRoles.slice(skip, skip + take);
+
+ return paginatedRoles;
+ }
+
+ async updateRole(teamId: number, roleId: string, data: UpdateTeamRoleInput) {
+ const belongsToTeam = await this.rolesService.roleBelongsToTeam(roleId, teamId);
+ if (!belongsToTeam) {
+ throw new NotFoundException(`Role with id ${roleId} within team id ${teamId} not found`);
+ }
+
+ const updateData: UpdateRolePermissionsData = {
+ roleId,
+ permissions: data.permissions,
+ updates: {
+ name: data.name,
+ color: data.color,
+ },
+ };
+
+ try {
+ const role = await this.rolesService.update(updateData);
+
+ if (data.permissions) {
+ await this.rolesPermissionsCacheService.deleteTeamPermissionsCache(teamId);
+ }
+
+ return role;
+ } catch (error) {
+ if (error instanceof Error) {
+ if (error.message.includes("Role not found")) {
+ throw new NotFoundException(error.message);
+ }
+ if (error.message.includes("Cannot update default roles")) {
+ throw new BadRequestException(error.message);
+ }
+ if (
+ error.message.includes("Invalid permissions provided") ||
+ error.message.toLowerCase().includes("permission")
+ ) {
+ throw new BadRequestException(error.message);
+ }
+ }
+ throw error;
+ }
+ }
+
+ async deleteRole(teamId: number, roleId: string) {
+ const belongsToTeam = await this.rolesService.roleBelongsToTeam(roleId, teamId);
+ if (!belongsToTeam) {
+ throw new NotFoundException(`Role with id ${roleId} within team id ${teamId} not found`);
+ }
+
+ const role = await this.rolesService.getRole(roleId);
+ if (!role) {
+ throw new NotFoundException(`Role with id ${roleId} within team id ${teamId} not found`);
+ }
+
+ try {
+ await this.rolesService.deleteRole(roleId);
+
+ await this.rolesPermissionsCacheService.deleteTeamPermissionsCache(teamId);
+
+ return role;
+ } catch (error) {
+ if (error instanceof Error) {
+ if (error.message.includes("Cannot delete default roles")) {
+ throw new BadRequestException(error.message);
+ }
+
+ if (error.message.includes("Role not found")) {
+ throw new NotFoundException(error.message);
+ }
+ }
+ throw error;
+ }
+ }
+}
diff --git a/apps/api/v2/test/fixtures/repository/features.repository.fixture.ts b/apps/api/v2/test/fixtures/repository/features.repository.fixture.ts
new file mode 100644
index 00000000000..0216b1baaca
--- /dev/null
+++ b/apps/api/v2/test/fixtures/repository/features.repository.fixture.ts
@@ -0,0 +1,71 @@
+import { PrismaReadService } from "@/modules/prisma/prisma-read.service";
+import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
+import { TestingModule } from "@nestjs/testing";
+
+import type { Prisma } from "@calcom/prisma/client";
+
+export class FeaturesRepositoryFixture {
+ private prismaReadClient: PrismaReadService["prisma"];
+ private prismaWriteClient: PrismaWriteService["prisma"];
+
+ constructor(module: TestingModule) {
+ this.prismaReadClient = module.get(PrismaReadService).prisma;
+ this.prismaWriteClient = module.get(PrismaWriteService).prisma;
+ }
+ async create(data: Prisma.FeatureCreateInput) {
+ // note(Lauris): upserting because this create function is called in multiple tests in parallel and otherwise would lead to unique
+ // key constraint violation.
+ return await this.prismaWriteClient.feature.upsert({
+ where: { slug: data.slug },
+ create: data,
+ update: {},
+ });
+ }
+
+ async createTeamFeature(data: Prisma.TeamFeaturesCreateInput) {
+ return await this.prismaWriteClient.teamFeatures.create({
+ data,
+ });
+ }
+
+ async enableFeatureForTeam(teamId: number, featureId: string, assignedBy = "test") {
+ await this.prismaWriteClient.teamFeatures.upsert({
+ where: {
+ teamId_featureId: {
+ teamId,
+ featureId,
+ },
+ },
+ create: {
+ teamId,
+ featureId,
+ assignedBy,
+ },
+ update: {},
+ });
+ }
+
+ async disableFeatureForTeam(teamId: number, featureSlug: string) {
+ return await this.prismaWriteClient.teamFeatures.deleteMany({
+ where: {
+ teamId,
+ featureId: featureSlug,
+ },
+ });
+ }
+
+ async deleteBySlug(slug: string) {
+ return await this.prismaWriteClient.feature.delete({
+ where: { slug },
+ });
+ }
+
+ async deleteTeamFeature(teamId: number, featureSlug: string) {
+ return await this.prismaWriteClient.teamFeatures.deleteMany({
+ where: {
+ teamId,
+ featureId: featureSlug,
+ },
+ });
+ }
+}
diff --git a/docs/api-reference/v2/openapi.json b/docs/api-reference/v2/openapi.json
index 59d344d127a..e65cb5a7d9b 100644
--- a/docs/api-reference/v2/openapi.json
+++ b/docs/api-reference/v2/openapi.json
@@ -2169,126 +2169,133 @@
"tags": ["Orgs / Memberships"]
}
},
- "/v2/organizations/{orgId}/routing-forms": {
- "get": {
- "operationId": "OrganizationsRoutingFormsController_getOrganizationRoutingForms",
- "summary": "Get organization routing forms",
+ "/v2/organizations/{orgId}/roles": {
+ "post": {
+ "operationId": "OrganizationsRolesController_createRole",
+ "summary": "Create a new organization role",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "skip",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"required": false,
- "in": "query",
- "description": "Number of responses to skip",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Number of responses to take",
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "number"
}
- },
- {
- "name": "sortCreatedAt",
- "required": false,
- "in": "query",
- "description": "Sort by creation time",
- "schema": {
- "enum": ["asc", "desc"],
- "type": "string"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateOrgRoleInput"
+ }
}
- },
- {
- "name": "sortUpdatedAt",
- "required": false,
- "in": "query",
- "description": "Sort by update time",
- "schema": {
- "enum": ["asc", "desc"],
- "type": "string"
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateOrgRoleOutput"
+ }
+ }
}
- },
+ }
+ },
+ "tags": ["Orgs / Roles"]
+ },
+ "get": {
+ "operationId": "OrganizationsRolesController_getAllRoles",
+ "summary": "Get all organization roles",
+ "parameters": [
{
- "name": "afterCreatedAt",
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": false,
- "in": "query",
- "description": "Filter by responses created after this date",
"schema": {
- "format": "date-time",
"type": "string"
}
},
{
- "name": "beforeCreatedAt",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
"required": false,
- "in": "query",
- "description": "Filter by responses created before this date",
"schema": {
- "format": "date-time",
"type": "string"
}
},
{
- "name": "afterUpdatedAt",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"required": false,
- "in": "query",
- "description": "Filter by responses created after this date",
"schema": {
- "format": "date-time",
"type": "string"
}
},
{
- "name": "beforeUpdatedAt",
- "required": false,
- "in": "query",
- "description": "Filter by responses updated before this date",
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
- "format": "date-time",
- "type": "string"
+ "type": "number"
}
},
{
- "name": "routedToBookingUid",
+ "name": "take",
"required": false,
"in": "query",
- "description": "Filter by responses routed to a specific booking",
+ "description": "Maximum number of items to return",
+ "example": 25,
"schema": {
- "type": "string"
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
}
},
{
- "name": "teamIds",
+ "name": "skip",
"required": false,
"in": "query",
- "description": "Filter by teamIds. Team ids must be separated by a comma.",
- "example": "?teamIds=100,200",
+ "description": "Number of items to skip",
+ "example": 0,
"schema": {
- "type": "array",
- "items": {
- "type": "number"
- }
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
}
}
],
@@ -2298,300 +2305,260 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetRoutingFormsOutput"
+ "$ref": "#/components/schemas/GetAllOrgRolesOutput"
}
}
}
}
},
- "tags": ["Orgs / Routing forms"]
+ "tags": ["Orgs / Roles"]
}
},
- "/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses": {
+ "/v2/organizations/{orgId}/roles/{roleId}": {
"get": {
- "operationId": "OrganizationsRoutingFormsResponsesController_getRoutingFormResponses",
- "summary": "Get routing form responses",
+ "operationId": "OrganizationsRolesController_getRole",
+ "summary": "Get a specific organization role",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "routingFormId",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "skip",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"required": false,
- "in": "query",
- "description": "Number of responses to skip",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Number of responses to take",
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "number"
}
},
{
- "name": "sortCreatedAt",
- "required": false,
- "in": "query",
- "description": "Sort by creation time",
+ "name": "roleId",
+ "required": true,
+ "in": "path",
"schema": {
- "enum": ["asc", "desc"],
"type": "string"
}
- },
- {
- "name": "sortUpdatedAt",
- "required": false,
- "in": "query",
- "description": "Sort by update time",
- "schema": {
- "enum": ["asc", "desc"],
- "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetOrgRoleOutput"
+ }
+ }
}
- },
+ }
+ },
+ "tags": ["Orgs / Roles"]
+ },
+ "patch": {
+ "operationId": "OrganizationsRolesController_updateRole",
+ "summary": "Update an organization role",
+ "parameters": [
{
- "name": "afterCreatedAt",
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": false,
- "in": "query",
- "description": "Filter by responses created after this date",
"schema": {
- "format": "date-time",
"type": "string"
}
},
{
- "name": "beforeCreatedAt",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
"required": false,
- "in": "query",
- "description": "Filter by responses created before this date",
"schema": {
- "format": "date-time",
"type": "string"
}
},
{
- "name": "afterUpdatedAt",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"required": false,
- "in": "query",
- "description": "Filter by responses created after this date",
"schema": {
- "format": "date-time",
"type": "string"
}
},
{
- "name": "beforeUpdatedAt",
- "required": false,
- "in": "query",
- "description": "Filter by responses updated before this date",
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
- "format": "date-time",
- "type": "string"
+ "type": "number"
}
},
{
- "name": "routedToBookingUid",
- "required": false,
- "in": "query",
- "description": "Filter by responses routed to a specific booking",
+ "name": "roleId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "string"
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateOrgRoleInput"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetRoutingFormResponsesOutput"
+ "$ref": "#/components/schemas/UpdateOrgRoleOutput"
}
}
}
}
},
- "tags": ["Orgs / Routing forms"]
+ "tags": ["Orgs / Roles"]
},
- "post": {
- "operationId": "OrganizationsRoutingFormsResponsesController_createRoutingFormResponse",
- "summary": "Create routing form response and get available slots",
+ "delete": {
+ "operationId": "OrganizationsRolesController_deleteRole",
+ "summary": "Delete an organization role",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "routingFormId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "string"
- }
- },
- {
- "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"
- }
- },
- {
- "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",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "timeZone",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"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",
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"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": "bookingUidToReschedule",
- "required": false,
- "in": "query",
- "description": "The unique identifier of the booking being rescheduled. When provided will ensure that the original booking time appears within the returned available slots when rescheduling.",
- "example": "abc123def456",
+ "name": "roleId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "string"
}
- },
- {
- "name": "queueResponse",
- "required": false,
- "in": "query",
- "description": "Whether to queue the form response.",
- "example": true,
- "schema": {
- "type": "boolean"
- }
}
],
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateRoutingFormResponseOutput"
+ "$ref": "#/components/schemas/DeleteOrgRoleOutput"
}
}
}
}
},
- "tags": ["Orgs / Routing forms"]
+ "tags": ["Orgs / Roles"]
}
},
- "/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses/{responseId}": {
- "patch": {
- "operationId": "OrganizationsRoutingFormsResponsesController_updateRoutingFormResponse",
- "summary": "Update routing form response",
+ "/v2/organizations/{orgId}/roles/{roleId}/permissions": {
+ "post": {
+ "operationId": "OrganizationsRolesPermissionsController_addPermissions",
+ "summary": "Add permissions to an organization role (single or batch)",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "routingFormId",
- "required": true,
- "in": "path",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "responseId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
}
],
"requestBody": {
@@ -2599,7 +2566,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateRoutingFormResponseInput"
+ "$ref": "#/components/schemas/CreateOrgRolePermissionsInput"
}
}
}
@@ -2610,19 +2577,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateRoutingFormResponseOutput"
+ "$ref": "#/components/schemas/GetOrgRolePermissionsOutput"
}
}
}
}
},
- "tags": ["Orgs / Routing forms"]
- }
- },
- "/v2/organizations/{orgId}/schedules": {
+ "tags": ["Orgs / Roles / Permissions"]
+ },
"get": {
- "operationId": "OrganizationsSchedulesController_getOrganizationSchedules",
- "summary": "Get all schedules",
+ "operationId": "OrganizationsRolesPermissionsController_listPermissions",
+ "summary": "List permissions for an organization role",
"parameters": [
{
"name": "Authorization",
@@ -2660,28 +2625,11 @@
}
},
{
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
- "schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "name": "roleId",
+ "required": true,
+ "in": "path",
"schema": {
- "minimum": 0,
- "default": 0,
- "type": "number"
+ "type": "string"
}
}
],
@@ -2691,19 +2639,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
+ "$ref": "#/components/schemas/GetOrgRolePermissionsOutput"
}
}
}
}
},
- "tags": ["Orgs / Schedules"]
- }
- },
- "/v2/organizations/{orgId}/teams": {
- "get": {
- "operationId": "OrganizationsTeamsController_getAllTeams",
- "summary": "Get all teams",
+ "tags": ["Orgs / Roles / Permissions"]
+ },
+ "put": {
+ "operationId": "OrganizationsRolesPermissionsController_setPermissions",
+ "summary": "Replace all permissions for an organization role",
"parameters": [
{
"name": "Authorization",
@@ -2739,25 +2685,43 @@
"schema": {
"type": "number"
}
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateOrgRolePermissionsInput"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OrgTeamsOutputResponseDto"
+ "$ref": "#/components/schemas/GetOrgRolePermissionsOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams"]
+ "tags": ["Orgs / Roles / Permissions"]
},
- "post": {
- "operationId": "OrganizationsTeamsController_createTeam",
- "summary": "Create a team",
+ "delete": {
+ "operationId": "OrganizationsRolesPermissionsController_removePermissions",
+ "summary": "Remove multiple permissions from an organization role",
"parameters": [
{
"name": "Authorization",
@@ -2793,37 +2757,97 @@
"schema": {
"type": "number"
}
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreateOrgTeamDto"
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "permissions",
+ "required": false,
+ "in": "query",
+ "description": "Permissions to remove (format: resource.action). Supports comma-separated values as well as repeated query params.",
+ "example": "?permissions=eventType.read,booking.read",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "*.*",
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "eventType.create",
+ "eventType.read",
+ "eventType.update",
+ "eventType.delete",
+ "team.create",
+ "team.read",
+ "team.update",
+ "team.delete",
+ "team.invite",
+ "team.remove",
+ "team.listMembers",
+ "team.listMembersPrivate",
+ "team.changeMemberRole",
+ "team.impersonate",
+ "organization.create",
+ "organization.read",
+ "organization.listMembers",
+ "organization.listMembersPrivate",
+ "organization.invite",
+ "organization.remove",
+ "organization.manageBilling",
+ "organization.changeMemberRole",
+ "organization.impersonate",
+ "organization.update",
+ "booking.read",
+ "booking.readOrgBookings",
+ "booking.readRecordings",
+ "booking.update",
+ "insights.read",
+ "workflow.create",
+ "workflow.read",
+ "workflow.update",
+ "workflow.delete",
+ "organization.attributes.read",
+ "organization.attributes.update",
+ "organization.attributes.delete",
+ "organization.attributes.create",
+ "routingForm.create",
+ "routingForm.read",
+ "routingForm.update",
+ "routingForm.delete",
+ "webhook.create",
+ "webhook.read",
+ "webhook.update",
+ "webhook.delete",
+ "watchlist.create",
+ "watchlist.read",
+ "watchlist.update",
+ "watchlist.delete"
+ ]
}
}
}
- },
+ ],
"responses": {
- "201": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OrgTeamOutputResponseDto"
- }
- }
- }
+ "204": {
+ "description": ""
}
},
- "tags": ["Orgs / Teams"]
+ "tags": ["Orgs / Roles / Permissions"]
}
},
- "/v2/organizations/{orgId}/teams/me": {
- "get": {
- "operationId": "OrganizationsTeamsController_getMyTeams",
- "summary": "Get teams membership for user",
+ "/v2/organizations/{orgId}/roles/{roleId}/permissions/{permission}": {
+ "delete": {
+ "operationId": "OrganizationsRolesPermissionsController_removePermission",
+ "summary": "Remove a permission from an organization role",
"parameters": [
{
"name": "Authorization",
@@ -2859,484 +2883,430 @@
"schema": {
"type": "number"
}
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "permission",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
}
],
"responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OrgMeTeamsOutputResponseDto"
- }
- }
- }
+ "204": {
+ "description": ""
}
},
- "tags": ["Orgs / Teams"]
+ "tags": ["Orgs / Roles / Permissions"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}": {
+ "/v2/organizations/{orgId}/routing-forms": {
"get": {
- "operationId": "OrganizationsTeamsController_getTeam",
- "summary": "Get a team",
+ "operationId": "OrganizationsRoutingFormsController_getOrganizationRoutingForms",
+ "summary": "Get organization routing forms",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": true,
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
+ "name": "skip",
"required": false,
+ "in": "query",
+ "description": "Number of responses to skip",
"schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OrgTeamOutputResponseDto"
- }
- }
+ "type": "number"
}
- }
- },
- "tags": ["Orgs / Teams"]
- },
- "delete": {
- "operationId": "OrganizationsTeamsController_deleteTeam",
- "summary": "Delete a team",
- "parameters": [
+ },
{
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "name": "take",
"required": false,
+ "in": "query",
+ "description": "Number of responses to take",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
+ "name": "sortCreatedAt",
"required": false,
+ "in": "query",
+ "description": "Sort by creation time",
"schema": {
+ "enum": ["asc", "desc"],
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
+ "name": "sortUpdatedAt",
"required": false,
+ "in": "query",
+ "description": "Sort by update time",
"schema": {
+ "enum": ["asc", "desc"],
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "afterCreatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Filter by responses created after this date",
"schema": {
- "type": "number"
+ "format": "date-time",
+ "type": "string"
}
},
{
- "name": "teamId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OrgTeamOutputResponseDto"
- }
- }
- }
- }
- },
- "tags": ["Orgs / Teams"]
- },
- "patch": {
- "operationId": "OrganizationsTeamsController_updateTeam",
- "summary": "Update a team",
- "parameters": [
- {
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "name": "beforeCreatedAt",
"required": false,
+ "in": "query",
+ "description": "Filter by responses created before this date",
"schema": {
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
+ "name": "afterUpdatedAt",
"required": false,
+ "in": "query",
+ "description": "Filter by responses created after this date",
"schema": {
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
+ "name": "beforeUpdatedAt",
"required": false,
+ "in": "query",
+ "description": "Filter by responses updated before this date",
"schema": {
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "routedToBookingUid",
+ "required": false,
+ "in": "query",
+ "description": "Filter by responses routed to a specific booking",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "teamId",
- "required": true,
- "in": "path",
+ "name": "teamIds",
+ "required": false,
+ "in": "query",
+ "description": "Filter by teamIds. Team ids must be separated by a comma.",
+ "example": "?teamIds=100,200",
"schema": {
- "type": "number"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateOrgTeamDto"
+ "type": "array",
+ "items": {
+ "type": "number"
}
}
}
- },
+ ],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OrgTeamOutputResponseDto"
+ "$ref": "#/components/schemas/GetRoutingFormsOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams"]
+ "tags": ["Orgs / Routing forms"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/bookings": {
+ "/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses": {
"get": {
- "operationId": "OrganizationsTeamsBookingsController_getAllOrgTeamBookings",
- "summary": "Get organization team bookings",
+ "operationId": "OrganizationsRoutingFormsResponsesController_getRoutingFormResponses",
+ "summary": "Get routing form responses",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": true,
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
+ "name": "routingFormId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "string"
}
},
{
- "name": "status",
- "required": false,
- "in": "query",
- "description": "Filter bookings by status. If you want to filter by multiple statuses, separate them with a comma.",
- "example": "?status=upcoming,past",
- "schema": {
- "type": "array",
- "items": {
- "type": "string",
- "enum": ["upcoming", "recurring", "past", "cancelled", "unconfirmed"]
- }
- }
- },
- {
- "name": "attendeeEmail",
+ "name": "skip",
"required": false,
"in": "query",
- "description": "Filter bookings by the attendee's email address.",
- "example": "[email protected]",
+ "description": "Number of responses to skip",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "attendeeName",
+ "name": "take",
"required": false,
"in": "query",
- "description": "Filter bookings by the attendee's name.",
- "example": "John Doe",
+ "description": "Number of responses to take",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "eventTypeIds",
+ "name": "sortCreatedAt",
"required": false,
"in": "query",
- "description": "Filter bookings by event type ids belonging to the team. Event type ids must be separated by a comma.",
- "example": "?eventTypeIds=100,200",
+ "description": "Sort by creation time",
"schema": {
+ "enum": ["asc", "desc"],
"type": "string"
}
},
{
- "name": "eventTypeId",
+ "name": "sortUpdatedAt",
"required": false,
"in": "query",
- "description": "Filter bookings by event type id belonging to the team.",
- "example": "?eventTypeId=100",
+ "description": "Sort by update time",
"schema": {
+ "enum": ["asc", "desc"],
"type": "string"
}
},
{
- "name": "afterStart",
+ "name": "afterCreatedAt",
"required": false,
"in": "query",
- "description": "Filter bookings with start after this date string.",
- "example": "?afterStart=2025-03-07T10:00:00.000Z",
+ "description": "Filter by responses created after this date",
"schema": {
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "beforeEnd",
+ "name": "beforeCreatedAt",
"required": false,
"in": "query",
- "description": "Filter bookings with end before this date string.",
- "example": "?beforeEnd=2025-03-07T11:00:00.000Z",
+ "description": "Filter by responses created before this date",
"schema": {
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "sortStart",
+ "name": "afterUpdatedAt",
"required": false,
"in": "query",
- "description": "Sort results by their start time in ascending or descending order.",
- "example": "?sortStart=asc OR ?sortStart=desc",
+ "description": "Filter by responses created after this date",
"schema": {
- "enum": ["asc", "desc"],
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "sortEnd",
+ "name": "beforeUpdatedAt",
"required": false,
"in": "query",
- "description": "Sort results by their end time in ascending or descending order.",
- "example": "?sortEnd=asc OR ?sortEnd=desc",
+ "description": "Filter by responses updated before this date",
"schema": {
- "enum": ["asc", "desc"],
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "sortCreated",
+ "name": "routedToBookingUid",
"required": false,
"in": "query",
- "description": "Sort results by their creation time (when booking was made) in ascending or descending order.",
- "example": "?sortCreated=asc OR ?sortCreated=desc",
+ "description": "Filter by responses routed to a specific booking",
"schema": {
- "enum": ["asc", "desc"],
"type": "string"
}
- },
- {
- "name": "take",
- "required": false,
- "in": "query",
- "description": "The number of items to return",
- "example": 10,
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetRoutingFormResponsesOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Orgs / Routing forms"]
+ },
+ "post": {
+ "operationId": "OrganizationsRoutingFormsResponsesController_createRoutingFormResponse",
+ "summary": "Create routing form response and get available slots",
+ "parameters": [
+ {
+ "name": "Authorization",
+ "in": "header",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": true,
"schema": {
- "minimum": 1,
- "maximum": 250,
- "type": "number"
+ "type": "string"
}
},
{
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "The number of items to skip",
- "example": 0,
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
- "minimum": 0,
"type": "number"
}
},
{
- "name": "teamId",
+ "name": "routingFormId",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "orgId",
+ "name": "start",
"required": true,
- "in": "path",
+ "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": "number"
+ "type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetBookingsOutput_2024_08_13"
- }
- }
+ },
+ {
+ "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": {
+ "type": "string"
}
- }
- },
- "tags": ["Orgs / Teams / Bookings"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/bookings/{bookingUid}/references": {
- "get": {
- "operationId": "OrganizationsTeamsBookingsController_getBookingReferences",
- "summary": "Get booking references",
- "parameters": [
+ },
{
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "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": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
+ "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": "string"
+ "type": "number"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
+ "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": "bookingUid",
- "required": true,
- "in": "path",
+ "name": "bookingUidToReschedule",
+ "required": false,
+ "in": "query",
+ "description": "The unique identifier of the booking being rescheduled. When provided will ensure that the original booking time appears within the returned available slots when rescheduling.",
+ "example": "abc123def456",
"schema": {
"type": "string"
}
},
{
- "name": "type",
+ "name": "queueResponse",
"required": false,
"in": "query",
- "description": "Filter booking references by type",
- "example": "google_calendar",
+ "description": "Whether to queue the form response.",
+ "example": true,
"schema": {
- "enum": [
- "google_calendar",
- "office365_calendar",
- "daily_video",
- "google_video",
- "office365_video",
- "zoom_video"
- ],
- "type": "string"
+ "type": "boolean"
}
}
],
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/BookingReferencesOutput_2024_08_13"
+ "$ref": "#/components/schemas/CreateRoutingFormResponseOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Bookings"]
+ "tags": ["Orgs / Routing forms"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/connect": {
- "post": {
- "operationId": "OrganizationsConferencingController_connectTeamApp",
- "summary": "Connect your conferencing application to a team",
+ "/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses/{responseId}": {
+ "patch": {
+ "operationId": "OrganizationsRoutingFormsResponsesController_updateRoutingFormResponse",
+ "summary": "Update routing form response",
"parameters": [
{
- "name": "teamId",
+ "name": "Authorization",
+ "in": "header",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
@@ -3348,84 +3318,110 @@
}
},
{
- "name": "app",
+ "name": "routingFormId",
"required": true,
"in": "path",
- "description": "Conferencing application type",
"schema": {
- "enum": ["google-meet"],
"type": "string"
}
+ },
+ {
+ "name": "responseId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateRoutingFormResponseInput"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ConferencingAppOutputResponseDto"
+ "$ref": "#/components/schemas/UpdateRoutingFormResponseOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Conferencing"]
+ "tags": ["Orgs / Routing forms"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/oauth/auth-url": {
+ "/v2/organizations/{orgId}/schedules": {
"get": {
- "operationId": "OrganizationsConferencingController_getTeamOAuthUrl",
- "summary": "Get OAuth conferencing app's auth URL for a team",
+ "operationId": "OrganizationsSchedulesController_getOrganizationSchedules",
+ "summary": "Get all schedules",
"parameters": [
{
"name": "Authorization",
- "required": true,
"in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "teamId",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "app",
+ "name": "orgId",
"required": true,
"in": "path",
- "description": "Conferencing application type",
"schema": {
- "enum": ["zoom", "msteams"],
- "type": "string"
+ "type": "number"
}
},
{
- "name": "returnTo",
- "required": true,
+ "name": "take",
+ "required": false,
"in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
"schema": {
- "type": "string"
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
}
},
{
- "name": "onErrorReturnTo",
- "required": true,
+ "name": "skip",
+ "required": false,
"in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
"schema": {
- "type": "string"
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
}
}
],
@@ -3435,143 +3431,53 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetConferencingAppsOauthUrlResponseDto"
+ "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Orgs / Teams / Conferencing"]
+ "tags": ["Orgs / Schedules"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/conferencing": {
+ "/v2/organizations/{orgId}/teams": {
"get": {
- "operationId": "OrganizationsConferencingController_listTeamConferencingApps",
- "summary": "List team conferencing applications",
+ "operationId": "OrganizationsTeamsController_getAllTeams",
+ "summary": "Get all teams",
"parameters": [
{
- "name": "teamId",
- "required": true,
- "in": "path",
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
- "type": "number"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ConferencingAppsOutputResponseDto"
- }
- }
- }
- }
- },
- "tags": ["Orgs / Teams / Conferencing"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/default": {
- "post": {
- "operationId": "OrganizationsConferencingController_setTeamDefaultApp",
- "summary": "Set team default conferencing application",
- "parameters": [
- {
- "name": "teamId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "app",
- "required": true,
- "in": "path",
- "description": "Conferencing application type",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
- "enum": ["google-meet", "zoom", "msteams", "daily-video"],
"type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SetDefaultConferencingAppOutputResponseDto"
- }
- }
- }
- }
- },
- "tags": ["Orgs / Teams / Conferencing"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/conferencing/default": {
- "get": {
- "operationId": "OrganizationsConferencingController_getTeamDefaultApp",
- "summary": "Get team default conferencing application",
- "parameters": [
- {
- "name": "teamId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
},
{
- "name": "app",
- "required": true,
- "in": "path",
- "description": "Conferencing application type",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
- "enum": ["google-meet", "zoom", "msteams", "daily-video"],
"type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetDefaultConferencingAppOutputResponseDto"
- }
- }
- }
- }
- },
- "tags": ["Orgs / Teams / Conferencing"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/disconnect": {
- "delete": {
- "operationId": "OrganizationsConferencingController_disconnectTeamApp",
- "summary": "Disconnect team conferencing application",
- "parameters": [
- {
- "name": "teamId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
},
{
- "name": "app",
+ "name": "orgId",
"required": true,
"in": "path",
- "description": "Conferencing application type",
"schema": {
- "enum": ["google-meet", "zoom", "msteams"],
- "type": "string"
+ "type": "number"
}
}
],
@@ -3581,73 +3487,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DisconnectConferencingAppOutputResponseDto"
+ "$ref": "#/components/schemas/OrgTeamsOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Conferencing"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/oauth/callback": {
- "get": {
- "operationId": "OrganizationsConferencingController_saveTeamOauthCredentials",
- "summary": "Save conferencing app OAuth credentials",
- "parameters": [
- {
- "name": "state",
- "required": true,
- "in": "query",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "code",
- "required": true,
- "in": "query",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "teamId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "orgId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "app",
- "required": true,
- "in": "path",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": ""
- }
- },
- "tags": ["Orgs / Teams / Conferencing"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/event-types": {
+ "tags": ["Orgs / Teams"]
+ },
"post": {
- "operationId": "OrganizationsEventTypesController_createTeamEventType",
- "summary": "Create an event type",
+ "operationId": "OrganizationsTeamsController_createTeam",
+ "summary": "Create a team",
"parameters": [
{
"name": "Authorization",
@@ -3676,14 +3526,6 @@
"type": "string"
}
},
- {
- "name": "teamId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
{
"name": "orgId",
"required": true,
@@ -3698,7 +3540,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateTeamEventTypeInput_2024_06_14"
+ "$ref": "#/components/schemas/CreateOrgTeamDto"
}
}
}
@@ -3709,17 +3551,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateTeamEventTypeOutput"
+ "$ref": "#/components/schemas/OrgTeamOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Event Types"]
- },
+ "tags": ["Orgs / Teams"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/me": {
"get": {
- "operationId": "OrganizationsEventTypesController_getTeamEventTypes",
- "summary": "Get team event types",
+ "operationId": "OrganizationsTeamsController_getMyTeams",
+ "summary": "Get teams membership for user",
"parameters": [
{
"name": "Authorization",
@@ -3749,30 +3593,12 @@
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
- },
- {
- "name": "eventSlug",
- "required": false,
- "in": "query",
- "description": "Slug of team event type to return.",
- "schema": {
- "type": "string"
- }
- },
- {
- "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": "number"
- }
}
],
"responses": {
@@ -3781,19 +3607,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetTeamEventTypesOutput"
+ "$ref": "#/components/schemas/OrgMeTeamsOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Event Types"]
+ "tags": ["Orgs / Teams"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}": {
+ "/v2/organizations/{orgId}/teams/{teamId}": {
"get": {
- "operationId": "OrganizationsEventTypesController_getTeamEventType",
- "summary": "Get an event type",
+ "operationId": "OrganizationsTeamsController_getTeam",
+ "summary": "Get a team",
"parameters": [
{
"name": "Authorization",
@@ -3821,22 +3647,6 @@
"schema": {
"type": "string"
}
- },
- {
- "name": "teamId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "eventTypeId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
}
],
"responses": {
@@ -3845,17 +3655,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetTeamEventTypeOutput"
+ "$ref": "#/components/schemas/OrgTeamOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Event Types"]
+ "tags": ["Orgs / Teams"]
},
- "patch": {
- "operationId": "OrganizationsEventTypesController_updateTeamEventType",
- "summary": "Update a team event type",
+ "delete": {
+ "operationId": "OrganizationsTeamsController_deleteTeam",
+ "summary": "Delete a team",
"parameters": [
{
"name": "Authorization",
@@ -3885,7 +3695,7 @@
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -3893,7 +3703,7 @@
}
},
{
- "name": "eventTypeId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -3901,33 +3711,23 @@
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateTeamEventTypeInput_2024_06_14"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateTeamEventTypeOutput"
+ "$ref": "#/components/schemas/OrgTeamOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Event Types"]
+ "tags": ["Orgs / Teams"]
},
- "delete": {
- "operationId": "OrganizationsEventTypesController_deleteTeamEventType",
- "summary": "Delete a team event type",
+ "patch": {
+ "operationId": "OrganizationsTeamsController_updateTeam",
+ "summary": "Update a team",
"parameters": [
{
"name": "Authorization",
@@ -3957,7 +3757,7 @@
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -3965,7 +3765,7 @@
}
},
{
- "name": "eventTypeId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -3973,25 +3773,35 @@
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateOrgTeamDto"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteTeamEventTypeOutput"
+ "$ref": "#/components/schemas/OrgTeamOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Event Types"]
+ "tags": ["Orgs / Teams"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/create-phone-call": {
- "post": {
- "operationId": "OrganizationsEventTypesController_createPhoneCall",
- "summary": "Create a phone call",
+ "/v2/organizations/{orgId}/teams/{teamId}/bookings": {
+ "get": {
+ "operationId": "OrganizationsTeamsBookingsController_getAllOrgTeamBookings",
+ "summary": "Get organization team bookings",
"parameters": [
{
"name": "Authorization",
@@ -4021,158 +3831,133 @@
}
},
{
- "name": "eventTypeId",
- "required": true,
- "in": "path",
+ "name": "status",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by status. If you want to filter by multiple statuses, separate them with a comma.",
+ "example": "?status=upcoming,past",
"schema": {
- "type": "number"
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["upcoming", "recurring", "past", "cancelled", "unconfirmed"]
+ }
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "attendeeEmail",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by the attendee's email address.",
+ "example": "[email protected]",
"schema": {
- "type": "number"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreatePhoneCallInput"
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreatePhoneCallOutput"
- }
- }
+ "type": "string"
}
- }
- },
- "tags": ["Orgs / Teams / Event Types"]
- }
- },
- "/v2/organizations/{orgId}/teams/event-types": {
- "get": {
- "operationId": "OrganizationsEventTypesController_getTeamsEventTypes",
- "summary": "Get all team event types",
- "parameters": [
+ },
{
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "name": "attendeeName",
"required": false,
+ "in": "query",
+ "description": "Filter bookings by the attendee's name.",
+ "example": "John Doe",
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
+ "name": "eventTypeIds",
"required": false,
+ "in": "query",
+ "description": "Filter bookings by event type ids belonging to the team. Event type ids must be separated by a comma.",
+ "example": "?eventTypeIds=100,200",
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
+ "name": "eventTypeId",
"required": false,
+ "in": "query",
+ "description": "Filter bookings by event type id belonging to the team.",
+ "example": "?eventTypeId=100",
"schema": {
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "afterStart",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings with start after this date string.",
+ "example": "?afterStart=2025-03-07T10:00:00.000Z",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "take",
+ "name": "beforeEnd",
"required": false,
"in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
+ "description": "Filter bookings with end before this date string.",
+ "example": "?beforeEnd=2025-03-07T11:00:00.000Z",
"schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
+ "type": "string"
}
},
{
- "name": "skip",
+ "name": "sortStart",
"required": false,
"in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "description": "Sort results by their start time in ascending or descending order.",
+ "example": "?sortStart=asc OR ?sortStart=desc",
"schema": {
- "minimum": 0,
- "default": 0,
- "type": "number"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetTeamEventTypesOutput"
- }
- }
+ "enum": ["asc", "desc"],
+ "type": "string"
}
- }
- },
- "tags": ["Orgs / Teams / Event Types"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/private-links": {
- "post": {
- "operationId": "OrganizationsEventTypesPrivateLinksController_createPrivateLink",
- "summary": "Create a private link for a team event type",
- "parameters": [
+ },
{
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "name": "sortEnd",
"required": false,
+ "in": "query",
+ "description": "Sort results by their end time in ascending or descending order.",
+ "example": "?sortEnd=asc OR ?sortEnd=desc",
"schema": {
+ "enum": ["asc", "desc"],
"type": "string"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
+ "name": "sortCreated",
"required": false,
+ "in": "query",
+ "description": "Sort results by their creation time (when booking was made) in ascending or descending order.",
+ "example": "?sortCreated=asc OR ?sortCreated=desc",
"schema": {
+ "enum": ["asc", "desc"],
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
+ "name": "take",
"required": false,
+ "in": "query",
+ "description": "The number of items to return",
+ "example": 10,
"schema": {
- "type": "string"
+ "minimum": 1,
+ "maximum": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "The number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "type": "number"
}
},
{
@@ -4184,7 +3969,7 @@
}
},
{
- "name": "eventTypeId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -4192,33 +3977,25 @@
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreatePrivateLinkInput"
- }
- }
- }
- },
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreatePrivateLinkOutput"
+ "$ref": "#/components/schemas/GetBookingsOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Orgs / Teams / Event Types / Private Links"]
- },
+ "tags": ["Orgs / Teams / Bookings"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/bookings/{bookingUid}/references": {
"get": {
- "operationId": "OrganizationsEventTypesPrivateLinksController_getPrivateLinks",
- "summary": "Get all private links for a team event type",
+ "operationId": "OrganizationsTeamsBookingsController_getBookingReferences",
+ "summary": "Get booking references",
"parameters": [
{
"name": "Authorization",
@@ -4248,69 +4025,52 @@
}
},
{
- "name": "teamId",
+ "name": "bookingUid",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "eventTypeId",
- "required": true,
- "in": "path",
+ "name": "type",
+ "required": false,
+ "in": "query",
+ "description": "Filter booking references by type",
+ "example": "google_calendar",
"schema": {
- "type": "number"
- }
- }
- ],
+ "enum": [
+ "google_calendar",
+ "office365_calendar",
+ "daily_video",
+ "google_video",
+ "office365_video",
+ "zoom_video"
+ ],
+ "type": "string"
+ }
+ }
+ ],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetPrivateLinksOutput"
+ "$ref": "#/components/schemas/BookingReferencesOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Orgs / Teams / Event Types / Private Links"]
+ "tags": ["Orgs / Teams / Bookings"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/private-links/{linkId}": {
- "patch": {
- "operationId": "OrganizationsEventTypesPrivateLinksController_updatePrivateLink",
- "summary": "Update a private link for a team event type",
+ "/v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/connect": {
+ "post": {
+ "operationId": "OrganizationsConferencingController_connectTeamApp",
+ "summary": "Connect your conferencing application to a team",
"parameters": [
- {
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
{
"name": "teamId",
"required": true,
@@ -4320,7 +4080,7 @@
}
},
{
- "name": "eventTypeId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -4328,10 +4088,12 @@
}
},
{
- "name": "linkId",
+ "name": "app",
"required": true,
"in": "path",
+ "description": "Conferencing application type",
"schema": {
+ "enum": ["google-meet"],
"type": "string"
}
}
@@ -4342,65 +4104,66 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdatePrivateLinkOutput"
+ "$ref": "#/components/schemas/ConferencingAppOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Event Types / Private Links"]
- },
- "delete": {
- "operationId": "OrganizationsEventTypesPrivateLinksController_deletePrivateLink",
- "summary": "Delete a private link for a team event type",
+ "tags": ["Orgs / Teams / Conferencing"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/oauth/auth-url": {
+ "get": {
+ "operationId": "OrganizationsConferencingController_getTeamOAuthUrl",
+ "summary": "Get OAuth conferencing app's auth URL for a team",
"parameters": [
{
"name": "Authorization",
+ "required": true,
"in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "name": "teamId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "string"
}
},
{
- "name": "teamId",
+ "name": "app",
"required": true,
"in": "path",
+ "description": "Conferencing application type",
"schema": {
- "type": "number"
+ "enum": ["zoom", "msteams"],
+ "type": "string"
}
},
{
- "name": "eventTypeId",
+ "name": "returnTo",
"required": true,
- "in": "path",
+ "in": "query",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "linkId",
+ "name": "onErrorReturnTo",
"required": true,
- "in": "path",
+ "in": "query",
"schema": {
"type": "string"
}
@@ -4412,49 +4175,51 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeletePrivateLinkOutput"
+ "$ref": "#/components/schemas/GetConferencingAppsOauthUrlResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Event Types / Private Links"]
+ "tags": ["Orgs / Teams / Conferencing"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/invite": {
- "post": {
- "operationId": "OrganizationsTeamsInviteController_createInvite",
- "summary": "Create team invite link",
+ "/v2/organizations/{orgId}/teams/{teamId}/conferencing": {
+ "get": {
+ "operationId": "OrganizationsConferencingController_listTeamConferencingApps",
+ "summary": "List team conferencing applications",
"parameters": [
{
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "name": "teamId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
- },
- {
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
- "schema": {
- "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ConferencingAppsOutputResponseDto"
+ }
+ }
}
- },
+ }
+ },
+ "tags": ["Orgs / Teams / Conferencing"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/default": {
+ "post": {
+ "operationId": "OrganizationsConferencingController_setTeamDefaultApp",
+ "summary": "Set team default conferencing application",
+ "parameters": [
{
- "name": "orgId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -4462,11 +4227,13 @@
}
},
{
- "name": "teamId",
+ "name": "app",
"required": true,
"in": "path",
+ "description": "Conferencing application type",
"schema": {
- "type": "number"
+ "enum": ["google-meet", "zoom", "msteams", "daily-video"],
+ "type": "string"
}
}
],
@@ -4476,49 +4243,22 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateInviteOutputDto"
+ "$ref": "#/components/schemas/SetDefaultConferencingAppOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Invite"]
+ "tags": ["Orgs / Teams / Conferencing"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/memberships": {
+ "/v2/organizations/{orgId}/teams/{teamId}/conferencing/default": {
"get": {
- "operationId": "OrganizationsTeamsMembershipsController_getAllOrgTeamMemberships",
- "summary": "Get all memberships",
+ "operationId": "OrganizationsConferencingController_getTeamDefaultApp",
+ "summary": "Get team default conferencing application",
"parameters": [
{
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "orgId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -4526,36 +4266,13 @@
}
},
{
- "name": "teamId",
+ "name": "app",
"required": true,
"in": "path",
+ "description": "Conferencing application type",
"schema": {
- "type": "number"
- }
- },
- {
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
- "schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
- "schema": {
- "minimum": 0,
- "default": 0,
- "type": "number"
+ "enum": ["google-meet", "zoom", "msteams", "daily-video"],
+ "type": "string"
}
}
],
@@ -4565,17 +4282,112 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OrgTeamMembershipsOutputResponseDto"
+ "$ref": "#/components/schemas/GetDefaultConferencingAppOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Memberships"]
- },
- "post": {
- "operationId": "OrganizationsTeamsMembershipsController_createOrgTeamMembership",
- "summary": "Create a membership",
+ "tags": ["Orgs / Teams / Conferencing"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/disconnect": {
+ "delete": {
+ "operationId": "OrganizationsConferencingController_disconnectTeamApp",
+ "summary": "Disconnect team conferencing application",
+ "parameters": [
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "app",
+ "required": true,
+ "in": "path",
+ "description": "Conferencing application type",
+ "schema": {
+ "enum": ["google-meet", "zoom", "msteams"],
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DisconnectConferencingAppOutputResponseDto"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Orgs / Teams / Conferencing"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/oauth/callback": {
+ "get": {
+ "operationId": "OrganizationsConferencingController_saveTeamOauthCredentials",
+ "summary": "Save conferencing app OAuth credentials",
+ "parameters": [
+ {
+ "name": "state",
+ "required": true,
+ "in": "query",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "code",
+ "required": true,
+ "in": "query",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "app",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": ""
+ }
+ },
+ "tags": ["Orgs / Teams / Conferencing"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/event-types": {
+ "post": {
+ "operationId": "OrganizationsEventTypesController_createTeamEventType",
+ "summary": "Create an event type",
"parameters": [
{
"name": "Authorization",
@@ -4605,7 +4417,7 @@
}
},
{
- "name": "orgId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -4613,7 +4425,7 @@
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -4626,7 +4438,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateOrgTeamMembershipDto"
+ "$ref": "#/components/schemas/CreateTeamEventTypeInput_2024_06_14"
}
}
}
@@ -4637,19 +4449,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OrgTeamMembershipOutputResponseDto"
+ "$ref": "#/components/schemas/CreateTeamEventTypeOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Memberships"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/memberships/{membershipId}": {
+ "tags": ["Orgs / Teams / Event Types"]
+ },
"get": {
- "operationId": "OrganizationsTeamsMembershipsController_getOrgTeamMembership",
- "summary": "Get a membership",
+ "operationId": "OrganizationsEventTypesController_getTeamEventTypes",
+ "summary": "Get team event types",
"parameters": [
{
"name": "Authorization",
@@ -4679,7 +4489,7 @@
}
},
{
- "name": "orgId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -4687,17 +4497,19 @@
}
},
{
- "name": "teamId",
- "required": true,
- "in": "path",
+ "name": "eventSlug",
+ "required": false,
+ "in": "query",
+ "description": "Slug of team event type to return.",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "membershipId",
- "required": true,
- "in": "path",
+ "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": "number"
}
@@ -4709,17 +4521,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OrgTeamMembershipOutputResponseDto"
+ "$ref": "#/components/schemas/GetTeamEventTypesOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Memberships"]
- },
- "delete": {
- "operationId": "OrganizationsTeamsMembershipsController_deleteOrgTeamMembership",
- "summary": "Delete a membership",
+ "tags": ["Orgs / Teams / Event Types"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}": {
+ "get": {
+ "operationId": "OrganizationsEventTypesController_getTeamEventType",
+ "summary": "Get an event type",
"parameters": [
{
"name": "Authorization",
@@ -4748,14 +4562,6 @@
"type": "string"
}
},
- {
- "name": "orgId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
{
"name": "teamId",
"required": true,
@@ -4765,7 +4571,7 @@
}
},
{
- "name": "membershipId",
+ "name": "eventTypeId",
"required": true,
"in": "path",
"schema": {
@@ -4779,17 +4585,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OrgTeamMembershipOutputResponseDto"
+ "$ref": "#/components/schemas/GetTeamEventTypeOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Memberships"]
+ "tags": ["Orgs / Teams / Event Types"]
},
"patch": {
- "operationId": "OrganizationsTeamsMembershipsController_updateOrgTeamMembership",
- "summary": "Update a membership",
+ "operationId": "OrganizationsEventTypesController_updateTeamEventType",
+ "summary": "Update a team event type",
"parameters": [
{
"name": "Authorization",
@@ -4818,14 +4624,6 @@
"type": "string"
}
},
- {
- "name": "orgId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
{
"name": "teamId",
"required": true,
@@ -4835,7 +4633,7 @@
}
},
{
- "name": "membershipId",
+ "name": "eventTypeId",
"required": true,
"in": "path",
"schema": {
@@ -4848,7 +4646,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateOrgTeamMembershipDto"
+ "$ref": "#/components/schemas/UpdateTeamEventTypeInput_2024_06_14"
}
}
}
@@ -4859,35 +4657,43 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OrgTeamMembershipOutputResponseDto"
+ "$ref": "#/components/schemas/UpdateTeamEventTypeOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Memberships"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/routing-forms": {
- "get": {
- "operationId": "OrganizationsTeamsRoutingFormsController_getTeamRoutingForms",
- "summary": "Get team routing forms",
+ "tags": ["Orgs / Teams / Event Types"]
+ },
+ "delete": {
+ "operationId": "OrganizationsEventTypesController_deleteTeamEventType",
+ "summary": "Delete a team event type",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
- "type": "number"
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
+ "schema": {
+ "type": "string"
}
},
{
@@ -4899,404 +4705,504 @@
}
},
{
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of responses to skip",
+ "name": "eventTypeId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "number"
}
- },
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeleteTeamEventTypeOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Orgs / Teams / Event Types"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/create-phone-call": {
+ "post": {
+ "operationId": "OrganizationsEventTypesController_createPhoneCall",
+ "summary": "Create a phone call",
+ "parameters": [
{
- "name": "take",
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": false,
- "in": "query",
- "description": "Number of responses to take",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "sortCreatedAt",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
"required": false,
- "in": "query",
- "description": "Sort by creation time",
"schema": {
- "enum": ["asc", "desc"],
"type": "string"
}
},
{
- "name": "sortUpdatedAt",
- "required": false,
- "in": "query",
- "description": "Sort by update time",
- "schema": {
- "enum": ["asc", "desc"],
- "type": "string"
- }
- },
- {
- "name": "afterCreatedAt",
- "required": false,
- "in": "query",
- "description": "Filter by responses created after this date",
- "schema": {
- "format": "date-time",
- "type": "string"
- }
- },
- {
- "name": "beforeCreatedAt",
- "required": false,
- "in": "query",
- "description": "Filter by responses created before this date",
- "schema": {
- "format": "date-time",
- "type": "string"
- }
- },
- {
- "name": "afterUpdatedAt",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"required": false,
- "in": "query",
- "description": "Filter by responses created after this date",
"schema": {
- "format": "date-time",
"type": "string"
}
},
{
- "name": "beforeUpdatedAt",
- "required": false,
- "in": "query",
- "description": "Filter by responses updated before this date",
+ "name": "eventTypeId",
+ "required": true,
+ "in": "path",
"schema": {
- "format": "date-time",
- "type": "string"
+ "type": "number"
}
},
{
- "name": "routedToBookingUid",
- "required": false,
- "in": "query",
- "description": "Filter by responses routed to a specific booking",
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreatePhoneCallInput"
+ }
+ }
+ }
+ },
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetRoutingFormsOutput"
+ "$ref": "#/components/schemas/CreatePhoneCallOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Routing forms"]
+ "tags": ["Orgs / Teams / Event Types"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/responses": {
+ "/v2/organizations/{orgId}/teams/event-types": {
"get": {
- "operationId": "OrganizationsTeamsRoutingFormsResponsesController_getRoutingFormResponses",
- "summary": "Get organization team routing form responses",
+ "operationId": "OrganizationsEventTypesController_getTeamsEventTypes",
+ "summary": "Get all team event types",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "routingFormId",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
},
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of responses to skip",
- "schema": {
- "type": "number"
- }
- },
{
"name": "take",
"required": false,
"in": "query",
- "description": "Number of responses to take",
+ "description": "Maximum number of items to return",
+ "example": 25,
"schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
"type": "number"
}
},
{
- "name": "sortCreatedAt",
+ "name": "skip",
"required": false,
"in": "query",
- "description": "Sort by creation time",
+ "description": "Number of items to skip",
+ "example": 0,
"schema": {
- "enum": ["asc", "desc"],
- "type": "string"
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
}
- },
- {
- "name": "sortUpdatedAt",
- "required": false,
- "in": "query",
- "description": "Sort by update time",
- "schema": {
- "enum": ["asc", "desc"],
- "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetTeamEventTypesOutput"
+ }
+ }
}
- },
+ }
+ },
+ "tags": ["Orgs / Teams / Event Types"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/private-links": {
+ "post": {
+ "operationId": "OrganizationsEventTypesPrivateLinksController_createPrivateLink",
+ "summary": "Create a private link for a team event type",
+ "parameters": [
{
- "name": "afterCreatedAt",
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": false,
- "in": "query",
- "description": "Filter by responses created after this date",
"schema": {
- "format": "date-time",
"type": "string"
}
},
{
- "name": "beforeCreatedAt",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
"required": false,
- "in": "query",
- "description": "Filter by responses created before this date",
"schema": {
- "format": "date-time",
"type": "string"
}
},
{
- "name": "afterUpdatedAt",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"required": false,
- "in": "query",
- "description": "Filter by responses created after this date",
"schema": {
- "format": "date-time",
"type": "string"
}
},
{
- "name": "beforeUpdatedAt",
- "required": false,
- "in": "query",
- "description": "Filter by responses updated before this date",
+ "name": "teamId",
+ "required": true,
+ "in": "path",
"schema": {
- "format": "date-time",
- "type": "string"
+ "type": "number"
}
},
{
- "name": "routedToBookingUid",
- "required": false,
- "in": "query",
- "description": "Filter by responses routed to a specific booking",
+ "name": "eventTypeId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreatePrivateLinkInput"
+ }
+ }
+ }
+ },
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetRoutingFormResponsesOutput"
+ "$ref": "#/components/schemas/CreatePrivateLinkOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Routing forms / Responses"]
+ "tags": ["Orgs / Teams / Event Types / Private Links"]
},
- "post": {
- "operationId": "OrganizationsTeamsRoutingFormsResponsesController_createRoutingFormResponse",
- "summary": "Create routing form response and get available slots",
+ "get": {
+ "operationId": "OrganizationsEventTypesPrivateLinksController_getPrivateLinks",
+ "summary": "Get all private links for a team event type",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "teamId",
- "required": true,
- "in": "path",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "routingFormId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "start",
+ "name": "eventTypeId",
"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",
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
- },
- {
- "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",
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetPrivateLinksOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Orgs / Teams / Event Types / Private Links"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/private-links/{linkId}": {
+ "patch": {
+ "operationId": "OrganizationsEventTypesPrivateLinksController_updatePrivateLink",
+ "summary": "Update a private link for a team event type",
+ "parameters": [
+ {
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "timeZone",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
"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",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"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": "string"
+ }
+ },
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "number"
}
},
{
- "name": "format",
+ "name": "eventTypeId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "linkId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdatePrivateLinkOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Orgs / Teams / Event Types / Private Links"]
+ },
+ "delete": {
+ "operationId": "OrganizationsEventTypesPrivateLinksController_deletePrivateLink",
+ "summary": "Delete a private link for a team event type",
+ "parameters": [
+ {
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"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": "bookingUidToReschedule",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
"required": false,
- "in": "query",
- "description": "The unique identifier of the booking being rescheduled. When provided will ensure that the original booking time appears within the returned available slots when rescheduling.",
- "example": "abc123def456",
"schema": {
"type": "string"
}
},
{
- "name": "queueResponse",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"required": false,
- "in": "query",
- "description": "Whether to queue the form response.",
- "example": true,
"schema": {
- "type": "boolean"
+ "type": "string"
+ }
+ },
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "eventTypeId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "linkId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
}
}
],
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateRoutingFormResponseOutput"
+ "$ref": "#/components/schemas/DeletePrivateLinkOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Routing forms / Responses"]
+ "tags": ["Orgs / Teams / Event Types / Private Links"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/responses/{responseId}": {
- "patch": {
- "operationId": "OrganizationsTeamsRoutingFormsResponsesController_updateRoutingFormResponse",
- "summary": "Update routing form response",
+ "/v2/organizations/{orgId}/teams/{teamId}/invite": {
+ "post": {
+ "operationId": "OrganizationsTeamsInviteController_createInvite",
+ "summary": "Create team invite link",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "teamId",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "routingFormId",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "responseId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -5304,35 +5210,25 @@
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateRoutingFormResponseInput"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateRoutingFormResponseOutput"
+ "$ref": "#/components/schemas/CreateInviteOutputDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Routing forms / Responses"]
+ "tags": ["Orgs / Teams / Invite"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/schedules": {
+ "/v2/organizations/{orgId}/teams/{teamId}/memberships": {
"get": {
- "operationId": "OrganizationsTeamsSchedulesController_getTeamSchedules",
- "summary": "Get all team member schedules",
+ "operationId": "OrganizationsTeamsMembershipsController_getAllOrgTeamMemberships",
+ "summary": "Get all memberships",
"parameters": [
{
"name": "Authorization",
@@ -5409,124 +5305,125 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
+ "$ref": "#/components/schemas/OrgTeamMembershipsOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Schedules"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/stripe/connect": {
- "get": {
- "operationId": "OrganizationsStripeController_getTeamStripeConnectUrl",
- "summary": "Get Stripe connect URL for a team",
+ "tags": ["Orgs / Teams / Memberships"]
+ },
+ "post": {
+ "operationId": "OrganizationsTeamsMembershipsController_createOrgTeamMembership",
+ "summary": "Create a membership",
"parameters": [
{
"name": "Authorization",
- "required": true,
"in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "teamId",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "returnTo",
+ "name": "orgId",
"required": true,
- "in": "query",
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "onErrorReturnTo",
+ "name": "teamId",
"required": true,
- "in": "query",
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateOrgTeamMembershipDto"
+ }
+ }
+ }
+ },
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/StripConnectOutputResponseDto"
+ "$ref": "#/components/schemas/OrgTeamMembershipOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Stripe"]
+ "tags": ["Orgs / Teams / Memberships"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/stripe/check": {
+ "/v2/organizations/{orgId}/teams/{teamId}/memberships/{membershipId}": {
"get": {
- "operationId": "OrganizationsStripeController_checkTeamStripeConnection",
- "summary": "Check team Stripe connection",
+ "operationId": "OrganizationsTeamsMembershipsController_getOrgTeamMembership",
+ "summary": "Get a membership",
"parameters": [
{
- "name": "teamId",
- "required": true,
- "in": "path",
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
- "type": "number"
+ "type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"
- }
- }
+ },
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
}
- }
- },
- "tags": ["Orgs / Teams / Stripe"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/stripe/save": {
- "get": {
- "operationId": "OrganizationsStripeController_save",
- "summary": "Save Stripe credentials",
- "parameters": [
+ },
{
- "name": "state",
- "required": true,
- "in": "query",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "code",
+ "name": "orgId",
"required": true,
- "in": "query",
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
@@ -5536,6 +5433,14 @@
"schema": {
"type": "number"
}
+ },
+ {
+ "name": "membershipId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
}
],
"responses": {
@@ -5544,19 +5449,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"
+ "$ref": "#/components/schemas/OrgTeamMembershipOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Stripe"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/users/{userId}/schedules": {
- "get": {
- "operationId": "OrganizationsTeamsSchedulesController_getUserSchedules",
- "summary": "Get schedules of a team member",
+ "tags": ["Orgs / Teams / Memberships"]
+ },
+ "delete": {
+ "operationId": "OrganizationsTeamsMembershipsController_deleteOrgTeamMembership",
+ "summary": "Delete a membership",
"parameters": [
{
"name": "Authorization",
@@ -5602,7 +5505,7 @@
}
},
{
- "name": "userId",
+ "name": "membershipId",
"required": true,
"in": "path",
"schema": {
@@ -5616,19 +5519,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
+ "$ref": "#/components/schemas/OrgTeamMembershipOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Users / Schedules"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/workflows": {
- "get": {
- "operationId": "OrganizationTeamWorkflowsController_getWorkflows",
- "summary": "Get organization team workflows",
+ "tags": ["Orgs / Teams / Memberships"]
+ },
+ "patch": {
+ "operationId": "OrganizationsTeamsMembershipsController_updateOrgTeamMembership",
+ "summary": "Update a membership",
"parameters": [
{
"name": "Authorization",
@@ -5674,48 +5575,43 @@
}
},
{
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
- "schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "name": "membershipId",
+ "required": true,
+ "in": "path",
"schema": {
- "minimum": 0,
- "default": 0,
"type": "number"
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateOrgTeamMembershipDto"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetEventTypeWorkflowsOutput"
+ "$ref": "#/components/schemas/OrgTeamMembershipOutputResponseDto"
}
}
}
}
},
- "tags": ["Orgs / Teams / Workflows"]
- },
+ "tags": ["Orgs / Teams / Memberships"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/roles": {
"post": {
- "operationId": "OrganizationTeamWorkflowsController_createEventTypeWorkflow",
- "summary": "Create organization team workflow for event-types",
+ "operationId": "OrganizationsTeamsRolesController_createRole",
+ "summary": "Create a new organization team role",
"parameters": [
{
"name": "Authorization",
@@ -5744,6 +5640,14 @@
"type": "string"
}
},
+ {
+ "name": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
{
"name": "teamId",
"required": true,
@@ -5758,7 +5662,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateEventTypeWorkflowDto"
+ "$ref": "#/components/schemas/CreateTeamRoleInput"
}
}
}
@@ -5769,19 +5673,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetEventTypeWorkflowOutput"
+ "$ref": "#/components/schemas/CreateTeamRoleOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Workflows"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/workflows/routing-form": {
+ "tags": ["Orgs / Teams / Roles"]
+ },
"get": {
- "operationId": "OrganizationTeamWorkflowsController_getRoutingFormWorkflows",
- "summary": "Get organization team workflows",
+ "operationId": "OrganizationsTeamsRolesController_getAllRoles",
+ "summary": "Get all organization team roles",
"parameters": [
{
"name": "Authorization",
@@ -5858,17 +5760,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetRoutingFormWorkflowsOutput"
+ "$ref": "#/components/schemas/GetAllTeamRolesOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Workflows"]
- },
- "post": {
- "operationId": "OrganizationTeamWorkflowsController_createFormWorkflow",
- "summary": "Create organization team workflow for routing-forms",
+ "tags": ["Orgs / Teams / Roles"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/roles/{roleId}": {
+ "get": {
+ "operationId": "OrganizationsTeamsRolesController_getRole",
+ "summary": "Get a specific organization team role",
"parameters": [
{
"name": "Authorization",
@@ -5897,6 +5801,14 @@
"type": "string"
}
},
+ {
+ "name": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
{
"name": "teamId",
"required": true,
@@ -5904,37 +5816,33 @@
"schema": {
"type": "number"
}
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreateFormWorkflowDto"
- }
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
}
}
- },
+ ],
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetRoutingFormWorkflowOutput"
+ "$ref": "#/components/schemas/GetTeamRoleOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Workflows"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}": {
- "get": {
- "operationId": "OrganizationTeamWorkflowsController_getWorkflowById",
- "summary": "Get organization team workflow",
+ "tags": ["Orgs / Teams / Roles"]
+ },
+ "patch": {
+ "operationId": "OrganizationsTeamsRolesController_updateRole",
+ "summary": "Update an organization team role",
"parameters": [
{
"name": "Authorization",
@@ -5964,7 +5872,7 @@
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -5972,31 +5880,49 @@
}
},
{
- "name": "workflowId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateTeamRoleInput"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetEventTypeWorkflowOutput"
+ "$ref": "#/components/schemas/UpdateTeamRoleOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Workflows"]
+ "tags": ["Orgs / Teams / Roles"]
},
- "patch": {
- "operationId": "OrganizationTeamWorkflowsController_updateWorkflow",
- "summary": "Update organization team workflow",
+ "delete": {
+ "operationId": "OrganizationsTeamsRolesController_deleteRole",
+ "summary": "Delete an organization team role",
"parameters": [
{
"name": "Authorization",
@@ -6026,7 +5952,7 @@
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -6034,41 +5960,41 @@
}
},
{
- "name": "workflowId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateEventTypeWorkflowDto"
- }
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
}
}
- },
+ ],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetEventTypeWorkflowOutput"
+ "$ref": "#/components/schemas/DeleteTeamRoleOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Workflows"]
- },
- "delete": {
- "operationId": "OrganizationTeamWorkflowsController_deleteWorkflow",
- "summary": "Delete organization team workflow",
+ "tags": ["Orgs / Teams / Roles"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/roles/{roleId}/permissions": {
+ "post": {
+ "operationId": "OrganizationsTeamsRolesPermissionsController_addPermissions",
+ "summary": "Add permissions to an organization team role (single or batch)",
"parameters": [
{
"name": "Authorization",
@@ -6098,7 +6024,7 @@
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -6106,26 +6032,49 @@
}
},
{
- "name": "workflowId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateTeamRolePermissionsInput"
+ }
+ }
+ }
+ },
"responses": {
"200": {
- "description": ""
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetTeamRolePermissionsOutput"
+ }
+ }
+ }
}
},
- "tags": ["Orgs / Teams / Workflows"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form": {
+ "tags": ["Orgs / Teams / Roles / Permissions"]
+ },
"get": {
- "operationId": "OrganizationTeamWorkflowsController_getRoutingFormWorkflowById",
- "summary": "Get organization team workflow",
+ "operationId": "OrganizationsTeamsRolesPermissionsController_listPermissions",
+ "summary": "List permissions for an organization team role",
"parameters": [
{
"name": "Authorization",
@@ -6155,7 +6104,7 @@
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -6163,12 +6112,20 @@
}
},
{
- "name": "workflowId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
}
],
"responses": {
@@ -6177,17 +6134,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetRoutingFormWorkflowOutput"
+ "$ref": "#/components/schemas/GetTeamRolePermissionsOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Workflows"]
+ "tags": ["Orgs / Teams / Roles / Permissions"]
},
- "patch": {
- "operationId": "OrganizationTeamWorkflowsController_updateRoutingFormWorkflow",
- "summary": "Update organization routing form team workflow",
+ "put": {
+ "operationId": "OrganizationsTeamsRolesPermissionsController_setPermissions",
+ "summary": "Replace all permissions for an organization team role",
"parameters": [
{
"name": "Authorization",
@@ -6217,7 +6174,7 @@
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -6225,12 +6182,20 @@
}
},
{
- "name": "workflowId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
}
],
"requestBody": {
@@ -6238,7 +6203,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateFormWorkflowDto"
+ "$ref": "#/components/schemas/CreateTeamRolePermissionsInput"
}
}
}
@@ -6249,17 +6214,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetRoutingFormWorkflowOutput"
+ "$ref": "#/components/schemas/GetTeamRolePermissionsOutput"
}
}
}
}
},
- "tags": ["Orgs / Teams / Workflows"]
+ "tags": ["Orgs / Teams / Roles / Permissions"]
},
"delete": {
- "operationId": "OrganizationTeamWorkflowsController_deleteRoutingFormWorkflow",
- "summary": "Delete organization team routing-form workflow",
+ "operationId": "OrganizationsTeamsRolesPermissionsController_removePermissions",
+ "summary": "Remove multiple permissions from an organization team role",
"parameters": [
{
"name": "Authorization",
@@ -6289,7 +6254,7 @@
}
},
{
- "name": "teamId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
@@ -6297,26 +6262,83 @@
}
},
{
- "name": "workflowId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "permissions",
+ "required": false,
+ "in": "query",
+ "description": "Permissions to remove (format: resource.action). Supports comma-separated values as well as repeated query params.",
+ "example": "?permissions=eventType.read,booking.read",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "eventType.create",
+ "eventType.read",
+ "eventType.update",
+ "eventType.delete",
+ "team.read",
+ "team.update",
+ "team.delete",
+ "team.invite",
+ "team.remove",
+ "team.listMembers",
+ "team.listMembersPrivate",
+ "team.changeMemberRole",
+ "team.impersonate",
+ "booking.read",
+ "booking.readTeamBookings",
+ "booking.readRecordings",
+ "booking.update",
+ "insights.read",
+ "workflow.create",
+ "workflow.read",
+ "workflow.update",
+ "workflow.delete",
+ "routingForm.create",
+ "routingForm.read",
+ "routingForm.update",
+ "routingForm.delete",
+ "webhook.create",
+ "webhook.read",
+ "webhook.update",
+ "webhook.delete"
+ ]
+ }
+ }
}
],
"responses": {
- "200": {
+ "204": {
"description": ""
}
},
- "tags": ["Orgs / Teams / Workflows"]
+ "tags": ["Orgs / Teams / Roles / Permissions"]
}
},
- "/v2/organizations/{orgId}/users": {
- "get": {
- "operationId": "OrganizationsUsersController_getOrganizationsUsers",
- "summary": "Get all users",
+ "/v2/organizations/{orgId}/teams/{teamId}/roles/{roleId}/permissions/{permission}": {
+ "delete": {
+ "operationId": "OrganizationsTeamsRolesPermissionsController_removePermission",
+ "summary": "Remove a permission from an organization team role",
"parameters": [
{
"name": "Authorization",
@@ -6354,77 +6376,153 @@
}
},
{
- "name": "take",
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "roleId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "permission",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": ""
+ }
+ },
+ "tags": ["Orgs / Teams / Roles / Permissions"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/routing-forms": {
+ "get": {
+ "operationId": "OrganizationsTeamsRoutingFormsController_getTeamRoutingForms",
+ "summary": "Get team routing forms",
+ "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": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
"required": false,
"in": "query",
- "description": "The number of items to return",
- "example": 10,
+ "description": "Number of responses to skip",
"schema": {
- "minimum": 1,
- "maximum": 1000,
"type": "number"
}
},
{
- "name": "skip",
+ "name": "take",
"required": false,
"in": "query",
- "description": "The number of items to skip",
- "example": 0,
+ "description": "Number of responses to take",
"schema": {
- "minimum": 0,
"type": "number"
}
},
{
- "name": "emails",
+ "name": "sortCreatedAt",
"required": false,
"in": "query",
- "description": "The email address or an array of email addresses to filter by",
+ "description": "Sort by creation time",
"schema": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "enum": ["asc", "desc"],
+ "type": "string"
}
},
{
- "name": "assignedOptionIds",
+ "name": "sortUpdatedAt",
"required": false,
"in": "query",
- "description": "Filter by assigned attribute option ids. ids must be separated by a comma.",
- "example": "?assignedOptionIds=aaaaaaaa-bbbb-cccc-dddd-eeeeee1eee,aaaaaaaa-bbbb-cccc-dddd-eeeeee2eee",
+ "description": "Sort by update time",
"schema": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "enum": ["asc", "desc"],
+ "type": "string"
}
},
{
- "name": "attributeQueryOperator",
+ "name": "afterCreatedAt",
"required": false,
"in": "query",
- "description": "Query operator used to filter assigned options, AND by default.",
- "example": "NONE",
+ "description": "Filter by responses created after this date",
"schema": {
- "default": "AND",
- "enum": ["OR", "AND", "NONE"],
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "teamIds",
+ "name": "beforeCreatedAt",
"required": false,
"in": "query",
- "description": "Filter by teamIds. Team ids must be separated by a comma.",
- "example": "?teamIds=100,200",
+ "description": "Filter by responses created before this date",
"schema": {
- "type": "array",
- "items": {
- "type": "number"
- }
+ "format": "date-time",
+ "type": "string"
+ }
+ },
+ {
+ "name": "afterUpdatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Filter by responses created after this date",
+ "schema": {
+ "format": "date-time",
+ "type": "string"
+ }
+ },
+ {
+ "name": "beforeUpdatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Filter by responses updated before this date",
+ "schema": {
+ "format": "date-time",
+ "type": "string"
+ }
+ },
+ {
+ "name": "routedToBookingUid",
+ "required": false,
+ "in": "query",
+ "description": "Filter by responses routed to a specific booking",
+ "schema": {
+ "type": "string"
}
}
],
@@ -6434,189 +6532,138 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetOrganizationUsersResponseDTO"
+ "$ref": "#/components/schemas/GetRoutingFormsOutput"
}
}
}
}
},
- "tags": ["Orgs / Users"]
- },
- "post": {
- "operationId": "OrganizationsUsersController_createOrganizationUser",
- "summary": "Create a user",
+ "tags": ["Orgs / Teams / Routing forms"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/responses": {
+ "get": {
+ "operationId": "OrganizationsTeamsRoutingFormsResponsesController_getRoutingFormResponses",
+ "summary": "Get organization team routing form responses",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": true,
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "name": "routingFormId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreateOrganizationUserInput"
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetOrganizationUserOutput"
- }
- }
+ "type": "number"
}
- }
- },
- "tags": ["Orgs / Users"]
- }
- },
- "/v2/organizations/{orgId}/users/{userId}": {
- "patch": {
- "operationId": "OrganizationsUsersController_updateOrganizationUser",
- "summary": "Update a user",
- "parameters": [
+ },
{
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
+ "name": "teamId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
+ "name": "skip",
"required": false,
+ "in": "query",
+ "description": "Number of responses to skip",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
+ "name": "take",
"required": false,
+ "in": "query",
+ "description": "Number of responses to take",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "sortCreatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Sort by creation time",
"schema": {
- "type": "number"
+ "enum": ["asc", "desc"],
+ "type": "string"
}
},
{
- "name": "userId",
- "required": true,
- "in": "path",
+ "name": "sortUpdatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Sort by update time",
"schema": {
- "type": "number"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateOrganizationUserInput"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetOrganizationUserOutput"
- }
- }
+ "enum": ["asc", "desc"],
+ "type": "string"
}
- }
- },
- "tags": ["Orgs / Users"]
- },
- "delete": {
- "operationId": "OrganizationsUsersController_deleteOrganizationUser",
- "summary": "Delete a user",
- "parameters": [
+ },
{
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "name": "afterCreatedAt",
"required": false,
+ "in": "query",
+ "description": "Filter by responses created after this date",
"schema": {
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
+ "name": "beforeCreatedAt",
"required": false,
+ "in": "query",
+ "description": "Filter by responses created before this date",
"schema": {
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
+ "name": "afterUpdatedAt",
"required": false,
+ "in": "query",
+ "description": "Filter by responses created after this date",
"schema": {
+ "format": "date-time",
"type": "string"
}
},
{
- "name": "orgId",
- "required": true,
- "in": "path",
+ "name": "beforeUpdatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Filter by responses updated before this date",
"schema": {
- "type": "number"
+ "format": "date-time",
+ "type": "string"
}
},
{
- "name": "userId",
- "required": true,
- "in": "path",
+ "name": "routedToBookingUid",
+ "required": false,
+ "in": "query",
+ "description": "Filter by responses routed to a specific booking",
"schema": {
- "type": "number"
+ "type": "string"
}
}
],
@@ -6626,49 +6673,37 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetOrganizationUserOutput"
+ "$ref": "#/components/schemas/GetRoutingFormResponsesOutput"
}
}
}
}
},
- "tags": ["Orgs / Users"]
- }
- },
- "/v2/organizations/{orgId}/users/{userId}/bookings": {
- "get": {
- "operationId": "OrganizationsUsersBookingsController_getOrganizationUserBookings",
- "summary": "Get all bookings for an organization user",
+ "tags": ["Orgs / Teams / Routing forms / Responses"]
+ },
+ "post": {
+ "operationId": "OrganizationsTeamsRoutingFormsResponsesController_createRoutingFormResponse",
+ "summary": "Create routing form response and get available slots",
"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": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": true,
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "orgId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -6676,236 +6711,168 @@
}
},
{
- "name": "userId",
+ "name": "routingFormId",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "status",
- "required": false,
+ "name": "start",
+ "required": true,
"in": "query",
- "description": "Filter bookings by status. If you want to filter by multiple statuses, separate them with a comma.",
- "example": "?status=upcoming,past",
+ "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": "array",
- "items": {
- "type": "string",
- "enum": ["upcoming", "recurring", "past", "cancelled", "unconfirmed"]
- }
+ "type": "string"
}
},
{
- "name": "attendeeEmail",
- "required": false,
+ "name": "end",
+ "required": true,
"in": "query",
- "description": "Filter bookings by the attendee's email address.",
- "example": "[email protected]",
+ "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": "attendeeName",
+ "name": "timeZone",
"required": false,
"in": "query",
- "description": "Filter bookings by the attendee's name.",
- "example": "John Doe",
+ "description": "Time zone in which the available slots should be returned. Defaults to UTC.",
+ "example": "Europe/Rome",
"schema": {
"type": "string"
}
},
{
- "name": "bookingUid",
+ "name": "duration",
"required": false,
"in": "query",
- "description": "Filter bookings by the booking Uid.",
- "example": "2NtaeaVcKfpmSZ4CthFdfk",
+ "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": "string"
+ "type": "number"
}
},
{
- "name": "eventTypeIds",
+ "name": "format",
"required": false,
"in": "query",
- "description": "Filter bookings by event type ids belonging to the user. Event type ids must be separated by a comma.",
- "example": "?eventTypeIds=100,200",
+ "description": "Format of slot times in response. Use 'range' to get start and end times.",
+ "example": "range",
"schema": {
+ "enum": ["range", "time"],
"type": "string"
}
},
{
- "name": "eventTypeId",
+ "name": "bookingUidToReschedule",
"required": false,
"in": "query",
- "description": "Filter bookings by event type id belonging to the user.",
- "example": "?eventTypeId=100",
+ "description": "The unique identifier of the booking being rescheduled. When provided will ensure that the original booking time appears within the returned available slots when rescheduling.",
+ "example": "abc123def456",
"schema": {
"type": "string"
}
},
{
- "name": "teamsIds",
- "required": false,
- "in": "query",
- "description": "Filter bookings by team ids that user is part of. Team ids must be separated by a comma.",
- "example": "?teamIds=50,60",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "teamId",
- "required": false,
- "in": "query",
- "description": "Filter bookings by team id that user is part of",
- "example": "?teamId=50",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "afterStart",
- "required": false,
- "in": "query",
- "description": "Filter bookings with start after this date string.",
- "example": "?afterStart=2025-03-07T10:00:00.000Z",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "beforeEnd",
- "required": false,
- "in": "query",
- "description": "Filter bookings with end before this date string.",
- "example": "?beforeEnd=2025-03-07T11:00:00.000Z",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "afterCreatedAt",
- "required": false,
- "in": "query",
- "description": "Filter bookings that have been created after this date string.",
- "example": "?afterCreatedAt=2025-03-07T10:00:00.000Z",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "beforeCreatedAt",
- "required": false,
- "in": "query",
- "description": "Filter bookings that have been created before this date string.",
- "example": "?beforeCreatedAt=2025-03-14T11:00:00.000Z",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "afterUpdatedAt",
- "required": false,
- "in": "query",
- "description": "Filter bookings that have been updated after this date string.",
- "example": "?afterUpdatedAt=2025-03-07T10:00:00.000Z",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "beforeUpdatedAt",
+ "name": "queueResponse",
"required": false,
"in": "query",
- "description": "Filter bookings that have been updated before this date string.",
- "example": "?beforeUpdatedAt=2025-03-14T11:00:00.000Z",
+ "description": "Whether to queue the form response.",
+ "example": true,
"schema": {
- "type": "string"
+ "type": "boolean"
}
- },
- {
- "name": "sortStart",
- "required": false,
- "in": "query",
- "description": "Sort results by their start time in ascending or descending order.",
- "example": "?sortStart=asc OR ?sortStart=desc",
- "schema": {
- "enum": ["asc", "desc"],
- "type": "string"
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateRoutingFormResponseOutput"
+ }
+ }
}
- },
+ }
+ },
+ "tags": ["Orgs / Teams / Routing forms / Responses"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/responses/{responseId}": {
+ "patch": {
+ "operationId": "OrganizationsTeamsRoutingFormsResponsesController_updateRoutingFormResponse",
+ "summary": "Update routing form response",
+ "parameters": [
{
- "name": "sortEnd",
- "required": false,
- "in": "query",
- "description": "Sort results by their end time in ascending or descending order.",
- "example": "?sortEnd=asc OR ?sortEnd=desc",
+ "name": "Authorization",
+ "in": "header",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": true,
"schema": {
- "enum": ["asc", "desc"],
"type": "string"
}
},
{
- "name": "sortCreated",
- "required": false,
- "in": "query",
- "description": "Sort results by their creation time (when booking was made) in ascending or descending order.",
- "example": "?sortCreated=asc OR ?sortCreated=desc",
+ "name": "teamId",
+ "required": true,
+ "in": "path",
"schema": {
- "enum": ["asc", "desc"],
- "type": "string"
+ "type": "number"
}
},
{
- "name": "sortUpdatedAt",
- "required": false,
- "in": "query",
- "description": "Sort results by their updated time (for example when booking status changes) in ascending or descending order.",
- "example": "?sortUpdated=asc OR ?sortUpdated=desc",
+ "name": "routingFormId",
+ "required": true,
+ "in": "path",
"schema": {
- "enum": ["asc", "desc"],
"type": "string"
}
},
{
- "name": "take",
- "required": false,
- "in": "query",
- "description": "The number of items to return",
- "example": 10,
- "schema": {
- "default": 100,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "The number of items to skip",
- "example": 0,
+ "name": "responseId",
+ "required": true,
+ "in": "path",
"schema": {
- "default": 0,
"type": "number"
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateRoutingFormResponseInput"
+ }
+ }
+ }
+ },
"responses": {
"200": {
- "description": ""
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateRoutingFormResponseOutput"
+ }
+ }
+ }
}
},
- "tags": ["Orgs / Users / Bookings"]
+ "tags": ["Orgs / Teams / Routing forms / Responses"]
}
},
- "/v2/organizations/{orgId}/users/{userId}/ooo": {
+ "/v2/organizations/{orgId}/teams/{teamId}/schedules": {
"get": {
- "operationId": "OrganizationsUsersOOOController_getOrganizationUserOOO",
- "summary": "Get all out-of-office entries for a user",
+ "operationId": "OrganizationsTeamsSchedulesController_getTeamSchedules",
+ "summary": "Get all team member schedules",
"parameters": [
{
"name": "Authorization",
@@ -6935,7 +6902,15 @@
}
},
{
- "name": "userId",
+ "name": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -6966,137 +6941,136 @@
"default": 0,
"type": "number"
}
- },
- {
- "name": "sortStart",
- "required": false,
- "in": "query",
- "description": "Sort results by their start time in ascending or descending order.",
- "example": "?sortStart=asc OR ?sortStart=desc",
- "schema": {
- "enum": ["asc", "desc"],
- "type": "string"
- }
- },
- {
- "name": "sortEnd",
- "required": false,
- "in": "query",
- "description": "Sort results by their end time in ascending or descending order.",
- "example": "?sortEnd=asc OR ?sortEnd=desc",
- "schema": {
- "enum": ["asc", "desc"],
- "type": "string"
- }
}
],
"responses": {
"200": {
- "description": ""
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
+ }
+ }
+ }
}
},
- "tags": ["Orgs / Users / OOO"]
- },
- "post": {
- "operationId": "OrganizationsUsersOOOController_createOrganizationUserOOO",
- "summary": "Create an out-of-office entry for a user",
+ "tags": ["Orgs / Teams / Schedules"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/stripe/connect": {
+ "get": {
+ "operationId": "OrganizationsStripeController_getTeamStripeConnectUrl",
+ "summary": "Get Stripe connect URL for a team",
"parameters": [
{
"name": "Authorization",
+ "required": true,
"in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "name": "teamId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
- "schema": {
- "type": "string"
+ "name": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
}
},
{
- "name": "userId",
+ "name": "returnTo",
"required": true,
- "in": "path",
+ "in": "query",
"schema": {
- "type": "number"
+ "type": "string"
+ }
+ },
+ {
+ "name": "onErrorReturnTo",
+ "required": true,
+ "in": "query",
+ "schema": {
+ "type": "string"
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreateOutOfOfficeEntryDto"
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/StripConnectOutputResponseDto"
+ }
}
}
}
},
- "responses": {
- "201": {
- "description": ""
- }
- },
- "tags": ["Orgs / Users / OOO"]
+ "tags": ["Orgs / Teams / Stripe"]
}
},
- "/v2/organizations/{orgId}/users/{userId}/ooo/{oooId}": {
- "patch": {
- "operationId": "OrganizationsUsersOOOController_updateOrganizationUserOOO",
- "summary": "Update an out-of-office entry for a user",
+ "/v2/organizations/{orgId}/teams/{teamId}/stripe/check": {
+ "get": {
+ "operationId": "OrganizationsStripeController_checkTeamStripeConnection",
+ "summary": "Check team Stripe connection",
"parameters": [
{
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
+ "name": "teamId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
- },
- {
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
- "schema": {
- "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"
+ }
+ }
}
- },
+ }
+ },
+ "tags": ["Orgs / Teams / Stripe"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/stripe/save": {
+ "get": {
+ "operationId": "OrganizationsStripeController_save",
+ "summary": "Save Stripe credentials",
+ "parameters": [
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
+ "name": "state",
+ "required": true,
+ "in": "query",
"schema": {
"type": "string"
}
},
{
- "name": "userId",
+ "name": "code",
"required": true,
- "in": "path",
+ "in": "query",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "oooId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -7104,26 +7078,25 @@
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateOutOfOfficeEntryDto"
- }
- }
- }
- },
"responses": {
"200": {
- "description": ""
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"
+ }
+ }
+ }
}
},
- "tags": ["Orgs / Users / OOO"]
- },
- "delete": {
- "operationId": "OrganizationsUsersOOOController_deleteOrganizationUserOOO",
- "summary": "Delete an out-of-office entry for a user",
+ "tags": ["Orgs / Teams / Stripe"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/users/{userId}/schedules": {
+ "get": {
+ "operationId": "OrganizationsTeamsSchedulesController_getUserSchedules",
+ "summary": "Get schedules of a team member",
"parameters": [
{
"name": "Authorization",
@@ -7153,7 +7126,23 @@
}
},
{
- "name": "oooId",
+ "name": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "userId",
"required": true,
"in": "path",
"schema": {
@@ -7163,16 +7152,23 @@
],
"responses": {
"200": {
- "description": ""
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
+ }
+ }
+ }
}
},
- "tags": ["Orgs / Users / OOO"]
+ "tags": ["Orgs / Teams / Users / Schedules"]
}
},
- "/v2/organizations/{orgId}/ooo": {
+ "/v2/organizations/{orgId}/teams/{teamId}/workflows": {
"get": {
- "operationId": "OrganizationsUsersOOOController_getOrganizationUsersOOO",
- "summary": "Get all out-of-office entries for organization users",
+ "operationId": "OrganizationTeamWorkflowsController_getWorkflows",
+ "summary": "Get organization team workflows",
"parameters": [
{
"name": "Authorization",
@@ -7209,6 +7205,14 @@
"type": "number"
}
},
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
{
"name": "take",
"required": false,
@@ -7233,52 +7237,25 @@
"default": 0,
"type": "number"
}
- },
- {
- "name": "sortStart",
- "required": false,
- "in": "query",
- "description": "Sort results by their start time in ascending or descending order.",
- "example": "?sortStart=asc OR ?sortStart=desc",
- "schema": {
- "enum": ["asc", "desc"],
- "type": "string"
- }
- },
- {
- "name": "sortEnd",
- "required": false,
- "in": "query",
- "description": "Sort results by their end time in ascending or descending order.",
- "example": "?sortEnd=asc OR ?sortEnd=desc",
- "schema": {
- "enum": ["asc", "desc"],
- "type": "string"
- }
- },
- {
- "name": "email",
- "required": false,
- "in": "query",
- "description": "Filter ooo entries by the user email address. user must be within your organization.",
- "example": "[email protected]",
- "schema": {
- "type": "string"
- }
}
],
"responses": {
"200": {
- "description": ""
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetEventTypeWorkflowsOutput"
+ }
+ }
+ }
}
},
- "tags": ["Orgs / Users / OOO"]
- }
- },
- "/v2/organizations/{orgId}/users/{userId}/schedules": {
+ "tags": ["Orgs / Teams / Workflows"]
+ },
"post": {
- "operationId": "OrganizationsSchedulesController_createUserSchedule",
- "summary": "Create a schedule",
+ "operationId": "OrganizationTeamWorkflowsController_createEventTypeWorkflow",
+ "summary": "Create organization team workflow for event-types",
"parameters": [
{
"name": "Authorization",
@@ -7308,7 +7285,7 @@
}
},
{
- "name": "userId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -7321,7 +7298,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateScheduleInput_2024_06_11"
+ "$ref": "#/components/schemas/CreateEventTypeWorkflowDto"
}
}
}
@@ -7332,17 +7309,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateScheduleOutput_2024_06_11"
+ "$ref": "#/components/schemas/GetEventTypeWorkflowOutput"
}
}
}
}
},
- "tags": ["Orgs / Users / Schedules"]
- },
+ "tags": ["Orgs / Teams / Workflows"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/workflows/routing-form": {
"get": {
- "operationId": "OrganizationsSchedulesController_getUserSchedules",
- "summary": "Get all schedules",
+ "operationId": "OrganizationTeamWorkflowsController_getRoutingFormWorkflows",
+ "summary": "Get organization team workflows",
"parameters": [
{
"name": "Authorization",
@@ -7372,74 +7351,43 @@
}
},
{
- "name": "userId",
+ "name": "orgId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
- }
- }
- }
- }
- },
- "tags": ["Orgs / Users / Schedules"]
- }
- },
- "/v2/organizations/{orgId}/users/{userId}/schedules/{scheduleId}": {
- "get": {
- "operationId": "OrganizationsSchedulesController_getUserSchedule",
- "summary": "Get a schedule",
- "parameters": [
- {
- "name": "Authorization",
- "in": "header",
- "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
- "required": false,
- "schema": {
- "type": "string"
- }
},
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "name": "teamId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
+ "name": "take",
"required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
"schema": {
- "type": "string"
- }
- },
- {
- "name": "userId",
- "required": true,
- "in": "path",
- "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
"type": "number"
}
},
{
- "name": "scheduleId",
- "required": true,
- "in": "path",
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
"schema": {
+ "minimum": 0,
+ "default": 0,
"type": "number"
}
}
@@ -7450,17 +7398,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetScheduleOutput_2024_06_11"
+ "$ref": "#/components/schemas/GetRoutingFormWorkflowsOutput"
}
}
}
}
},
- "tags": ["Orgs / Users / Schedules"]
+ "tags": ["Orgs / Teams / Workflows"]
},
- "patch": {
- "operationId": "OrganizationsSchedulesController_updateUserSchedule",
- "summary": "Update a schedule",
+ "post": {
+ "operationId": "OrganizationTeamWorkflowsController_createFormWorkflow",
+ "summary": "Create organization team workflow for routing-forms",
"parameters": [
{
"name": "Authorization",
@@ -7490,15 +7438,7 @@
}
},
{
- "name": "userId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "scheduleId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -7511,28 +7451,30 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateScheduleInput_2024_06_11"
+ "$ref": "#/components/schemas/CreateFormWorkflowDto"
}
}
}
},
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateScheduleOutput_2024_06_11"
+ "$ref": "#/components/schemas/GetRoutingFormWorkflowOutput"
}
}
}
}
},
- "tags": ["Orgs / Users / Schedules"]
- },
- "delete": {
- "operationId": "OrganizationsSchedulesController_deleteUserSchedule",
- "summary": "Delete a schedule",
+ "tags": ["Orgs / Teams / Workflows"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}": {
+ "get": {
+ "operationId": "OrganizationTeamWorkflowsController_getWorkflowById",
+ "summary": "Get organization team workflow",
"parameters": [
{
"name": "Authorization",
@@ -7562,7 +7504,7 @@
}
},
{
- "name": "userId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -7570,7 +7512,7 @@
}
},
{
- "name": "scheduleId",
+ "name": "workflowId",
"required": true,
"in": "path",
"schema": {
@@ -7584,19 +7526,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteScheduleOutput_2024_06_11"
+ "$ref": "#/components/schemas/GetEventTypeWorkflowOutput"
}
}
}
}
},
- "tags": ["Orgs / Users / Schedules"]
- }
- },
- "/v2/organizations/{orgId}/webhooks": {
- "get": {
- "operationId": "OrganizationsWebhooksController_getAllOrganizationWebhooks",
- "summary": "Get all webhooks",
+ "tags": ["Orgs / Teams / Workflows"]
+ },
+ "patch": {
+ "operationId": "OrganizationTeamWorkflowsController_updateWorkflow",
+ "summary": "Update organization team workflow",
"parameters": [
{
"name": "Authorization",
@@ -7626,7 +7566,7 @@
}
},
{
- "name": "orgId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -7634,48 +7574,41 @@
}
},
{
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
- "schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "name": "workflowId",
+ "required": true,
+ "in": "path",
"schema": {
- "minimum": 0,
- "default": 0,
"type": "number"
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateEventTypeWorkflowDto"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamWebhooksOutputResponseDto"
+ "$ref": "#/components/schemas/GetEventTypeWorkflowOutput"
}
}
}
}
},
- "tags": ["Orgs / Webhooks"]
+ "tags": ["Orgs / Teams / Workflows"]
},
- "post": {
- "operationId": "OrganizationsWebhooksController_createOrganizationWebhook",
- "summary": "Create a webhook",
+ "delete": {
+ "operationId": "OrganizationTeamWorkflowsController_deleteWorkflow",
+ "summary": "Delete organization team workflow",
"parameters": [
{
"name": "Authorization",
@@ -7705,43 +7638,34 @@
}
},
{
- "name": "orgId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreateWebhookInputDto"
- }
+ },
+ {
+ "name": "workflowId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
}
}
- },
+ ],
"responses": {
- "201": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/TeamWebhookOutputResponseDto"
- }
- }
- }
+ "200": {
+ "description": ""
}
},
- "tags": ["Orgs / Webhooks"]
+ "tags": ["Orgs / Teams / Workflows"]
}
},
- "/v2/organizations/{orgId}/webhooks/{webhookId}": {
+ "/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form": {
"get": {
- "operationId": "OrganizationsWebhooksController_getOrganizationWebhook",
- "summary": "Get a webhook",
+ "operationId": "OrganizationTeamWorkflowsController_getRoutingFormWorkflowById",
+ "summary": "Get organization team workflow",
"parameters": [
{
"name": "Authorization",
@@ -7771,11 +7695,19 @@
}
},
{
- "name": "webhookId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
- "type": "string"
+ "type": "number"
+ }
+ },
+ {
+ "name": "workflowId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
}
}
],
@@ -7785,17 +7717,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamWebhookOutputResponseDto"
+ "$ref": "#/components/schemas/GetRoutingFormWorkflowOutput"
}
}
}
}
},
- "tags": ["Orgs / Webhooks"]
+ "tags": ["Orgs / Teams / Workflows"]
},
- "delete": {
- "operationId": "OrganizationsWebhooksController_deleteWebhook",
- "summary": "Delete a webhook",
+ "patch": {
+ "operationId": "OrganizationTeamWorkflowsController_updateRoutingFormWorkflow",
+ "summary": "Update organization routing form team workflow",
"parameters": [
{
"name": "Authorization",
@@ -7825,31 +7757,49 @@
}
},
{
- "name": "webhookId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
- "type": "string"
+ "type": "number"
+ }
+ },
+ {
+ "name": "workflowId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateFormWorkflowDto"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamWebhookOutputResponseDto"
+ "$ref": "#/components/schemas/GetRoutingFormWorkflowOutput"
}
}
}
}
},
- "tags": ["Orgs / Webhooks"]
+ "tags": ["Orgs / Teams / Workflows"]
},
- "patch": {
- "operationId": "OrganizationsWebhooksController_updateOrgWebhook",
- "summary": "Update a webhook",
+ "delete": {
+ "operationId": "OrganizationTeamWorkflowsController_deleteRoutingFormWorkflow",
+ "summary": "Delete organization team routing-form workflow",
"parameters": [
{
"name": "Authorization",
@@ -7879,100 +7829,167 @@
}
},
{
- "name": "webhookId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateWebhookInputDto"
- }
+ },
+ {
+ "name": "workflowId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
}
}
- },
+ ],
"responses": {
"200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/TeamWebhookOutputResponseDto"
- }
- }
- }
+ "description": ""
}
},
- "tags": ["Orgs / Webhooks"]
+ "tags": ["Orgs / Teams / Workflows"]
}
},
- "/v2/api-keys/refresh": {
- "post": {
- "operationId": "ApiKeysController_refresh",
- "summary": "Refresh API Key",
- "description": "Generate a new API key and delete the current one. Provide API key to refresh as a Bearer token in the Authorization header (e.g. \"Authorization: Bearer <apiKey>\").",
+ "/v2/organizations/{orgId}/users": {
+ "get": {
+ "operationId": "OrganizationsUsersController_getOrganizationsUsers",
+ "summary": "Get all users",
"parameters": [
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "orgId",
"required": true,
+ "in": "path",
"schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "The number of items to return",
+ "example": 10,
+ "schema": {
+ "minimum": 1,
+ "maximum": 1000,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "The number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ {
+ "name": "emails",
+ "required": false,
+ "in": "query",
+ "description": "The email address or an array of email addresses to filter by",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "assignedOptionIds",
+ "required": false,
+ "in": "query",
+ "description": "Filter by assigned attribute option ids. ids must be separated by a comma.",
+ "example": "?assignedOptionIds=aaaaaaaa-bbbb-cccc-dddd-eeeeee1eee,aaaaaaaa-bbbb-cccc-dddd-eeeeee2eee",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "attributeQueryOperator",
+ "required": false,
+ "in": "query",
+ "description": "Query operator used to filter assigned options, AND by default.",
+ "example": "NONE",
+ "schema": {
+ "default": "AND",
+ "enum": ["OR", "AND", "NONE"],
"type": "string"
}
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RefreshApiKeyInput"
+ },
+ {
+ "name": "teamIds",
+ "required": false,
+ "in": "query",
+ "description": "Filter by teamIds. Team ids must be separated by a comma.",
+ "example": "?teamIds=100,200",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "number"
}
}
}
- },
+ ],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RefreshApiKeyOutput"
+ "$ref": "#/components/schemas/GetOrganizationUsersResponseDTO"
}
}
}
}
},
- "tags": ["Api Keys"]
- }
- },
- "/v2/bookings": {
+ "tags": ["Orgs / Users"]
+ },
"post": {
- "operationId": "BookingsController_2024_08_13_createBooking",
- "summary": "Create a booking",
- "description": "\n POST /v2/bookings is used to create regular bookings, recurring bookings and instant bookings. The request bodies for all 3 are almost the same except:\n If eventTypeId in the request body is id of a regular event, then regular booking is created.\n\n If it is an id of a recurring event type, then recurring booking is created.\n\n Meaning that the request bodies are equal but the outcome depends on what kind of event type it is with the goal of making it as seamless for developers as possible.\n\n For team event types it is possible to create instant meeting. To do that just pass `\"instant\": true` to the request body.\n\n The start needs to be in UTC aka if the timezone is GMT+2 in Rome and meeting should start at 11, then UTC time should have hours 09:00 aka without time zone.\n\n Finally, there are 2 ways to book an event type belonging to an individual user:\n 1. Provide `eventTypeId` in the request body.\n 2. Provide `eventTypeSlug` and `username` and optionally `organizationSlug` if the user with the username is within an organization.\n\n And 2 ways to book and event type belonging to a team:\n 1. Provide `eventTypeId` in the request body.\n 2. Provide `eventTypeSlug` and `teamSlug` and optionally `organizationSlug` if the team with the teamSlug is within an organization.\n\n If you are creating a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or\n you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.\n\n For event types that have SMS reminders workflow, you need to pass the attendee's phone number in the request body via `attendee.phoneNumber` (e.g., \"+19876543210\" in international format). This is an optional field, but becomes required when SMS reminders are enabled for the event type. For the complete attendee object structure, see the [attendee object](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#body-attendee) documentation.\n\n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "operationId": "OrganizationsUsersController_createOrganizationUser",
+ "summary": "Create a user",
"parameters": [
- {
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-08-13"
- }
- },
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": false,
"schema": {
"type": "string"
@@ -7999,21 +8016,10 @@
],
"requestBody": {
"required": true,
- "description": "Accepts different types of booking input: Create Booking (Option 1), Create Instant Booking (Option 2), or Create Recurring Booking (Option 3)",
"content": {
"application/json": {
"schema": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/CreateBookingInput_2024_08_13"
- },
- {
- "$ref": "#/components/schemas/CreateInstantBookingInput_2024_08_13"
- },
- {
- "$ref": "#/components/schemas/CreateRecurringBookingInput_2024_08_13"
- }
- ]
+ "$ref": "#/components/schemas/CreateOrganizationUserInput"
}
}
}
@@ -8024,84 +8030,254 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateBookingOutput_2024_08_13"
+ "$ref": "#/components/schemas/GetOrganizationUserOutput"
}
}
}
}
},
- "tags": ["Bookings"]
- },
- "get": {
- "operationId": "BookingsController_2024_08_13_getBookings",
- "summary": "Get all bookings",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "tags": ["Orgs / Users"]
+ }
+ },
+ "/v2/organizations/{orgId}/users/{userId}": {
+ "patch": {
+ "operationId": "OrganizationsUsersController_updateOrganizationUser",
+ "summary": "Update a user",
"parameters": [
{
- "name": "cal-api-version",
+ "name": "Authorization",
"in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-08-13"
- }
- },
- {
- "name": "status",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": false,
- "in": "query",
- "description": "Filter bookings by status. If you want to filter by multiple statuses, separate them with a comma.",
- "example": "?status=upcoming,past",
"schema": {
- "type": "array",
- "items": {
- "type": "string",
- "enum": ["upcoming", "recurring", "past", "cancelled", "unconfirmed"]
- }
+ "type": "string"
}
},
{
- "name": "attendeeEmail",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
"required": false,
- "in": "query",
- "description": "Filter bookings by the attendee's email address.",
- "example": "[email protected]",
"schema": {
"type": "string"
}
},
{
- "name": "attendeeName",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"required": false,
- "in": "query",
- "description": "Filter bookings by the attendee's name.",
- "example": "John Doe",
"schema": {
"type": "string"
}
},
{
- "name": "bookingUid",
- "required": false,
- "in": "query",
- "description": "Filter bookings by the booking Uid.",
- "example": "2NtaeaVcKfpmSZ4CthFdfk",
+ "name": "orgId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "eventTypeIds",
- "required": false,
- "in": "query",
- "description": "Filter bookings by event type ids belonging to the user. Event type ids must be separated by a comma.",
- "example": "?eventTypeIds=100,200",
+ "name": "userId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
- },
- {
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateOrganizationUserInput"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetOrganizationUserOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Orgs / Users"]
+ },
+ "delete": {
+ "operationId": "OrganizationsUsersController_deleteOrganizationUser",
+ "summary": "Delete a user",
+ "parameters": [
+ {
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "userId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetOrganizationUserOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Orgs / Users"]
+ }
+ },
+ "/v2/organizations/{orgId}/users/{userId}/bookings": {
+ "get": {
+ "operationId": "OrganizationsUsersBookingsController_getOrganizationUserBookings",
+ "summary": "Get all bookings for an organization user",
+ "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": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "userId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "status",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by status. If you want to filter by multiple statuses, separate them with a comma.",
+ "example": "?status=upcoming,past",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["upcoming", "recurring", "past", "cancelled", "unconfirmed"]
+ }
+ }
+ },
+ {
+ "name": "attendeeEmail",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by the attendee's email address.",
+ "example": "[email protected]",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "attendeeName",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by the attendee's name.",
+ "example": "John Doe",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "bookingUid",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by the booking Uid.",
+ "example": "2NtaeaVcKfpmSZ4CthFdfk",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "eventTypeIds",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by event type ids belonging to the user. Event type ids must be separated by a comma.",
+ "example": "?eventTypeIds=100,200",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
"name": "eventTypeId",
"required": false,
"in": "query",
@@ -8256,60 +8432,25 @@
"default": 0,
"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/GetBookingsOutput_2024_08_13"
- }
- }
- }
+ "description": ""
}
},
- "tags": ["Bookings"]
+ "tags": ["Orgs / Users / Bookings"]
}
},
- "/v2/bookings/{bookingUid}": {
+ "/v2/organizations/{orgId}/users/{userId}/ooo": {
"get": {
- "operationId": "BookingsController_2024_08_13_getBooking",
- "summary": "Get a booking",
- "description": "`:bookingUid` can be\n\n 1. uid of a normal booking\n\n 2. uid of one of the recurring booking recurrences\n\n 3. uid of recurring booking which will return an array of all recurring booking recurrences (stored as recurringBookingUid on one of the individual recurrences).\n \n If you are fetching a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or\n you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.\n\n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "operationId": "OrganizationsUsersOOOController_getOrganizationUserOOO",
+ "summary": "Get all out-of-office entries for a user",
"parameters": [
- {
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-08-13"
- }
- },
- {
- "name": "bookingUid",
- "required": true,
- "in": "path",
- "schema": {
- "type": "string"
- }
- },
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": false,
"schema": {
"type": "string"
@@ -8332,131 +8473,78 @@
"schema": {
"type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetBookingOutput_2024_08_13"
- }
- }
- }
- }
- },
- "tags": ["Bookings"]
- }
- },
- "/v2/bookings/{bookingUid}/recordings": {
- "get": {
- "operationId": "BookingsController_2024_08_13_getBookingRecordings",
- "summary": "Get all the recordings for the booking",
- "description": "Fetches all the recordings for the booking `:bookingUid`\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
- "parameters": [
+ },
{
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
+ "name": "userId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string",
- "default": "2024-08-13"
+ "type": "number"
}
},
{
- "name": "bookingUid",
- "required": true,
- "in": "path",
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
"schema": {
- "type": "string"
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetBookingRecordingsOutput"
- }
- }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
}
- }
- },
- "tags": ["Bookings"]
- }
- },
- "/v2/bookings/{bookingUid}/transcripts": {
- "get": {
- "operationId": "BookingsController_2024_08_13_getBookingTranscripts",
- "summary": "Get all the transcripts download links for the booking",
- "description": "Fetches all the transcripts download links for the booking `:bookingUid`\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
- "parameters": [
+ },
{
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
+ "name": "sortStart",
+ "required": false,
+ "in": "query",
+ "description": "Sort results by their start time in ascending or descending order.",
+ "example": "?sortStart=asc OR ?sortStart=desc",
"schema": {
- "type": "string",
- "default": "2024-08-13"
+ "enum": ["asc", "desc"],
+ "type": "string"
}
},
{
- "name": "bookingUid",
- "required": true,
- "in": "path",
+ "name": "sortEnd",
+ "required": false,
+ "in": "query",
+ "description": "Sort results by their end time in ascending or descending order.",
+ "example": "?sortEnd=asc OR ?sortEnd=desc",
"schema": {
+ "enum": ["asc", "desc"],
"type": "string"
}
}
],
"responses": {
"200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetBookingTranscriptsOutput"
- }
- }
- }
+ "description": ""
}
},
- "tags": ["Bookings"]
- }
- },
- "/v2/bookings/{bookingUid}/reschedule": {
+ "tags": ["Orgs / Users / OOO"]
+ },
"post": {
- "operationId": "BookingsController_2024_08_13_rescheduleBooking",
- "summary": "Reschedule a booking",
- "description": "Reschedule a booking or seated booking\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "operationId": "OrganizationsUsersOOOController_createOrganizationUserOOO",
+ "summary": "Create an out-of-office entry for a user",
"parameters": [
- {
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-08-13"
- }
- },
- {
- "name": "bookingUid",
- "required": true,
- "in": "path",
- "schema": {
- "type": "string"
- }
- },
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": false,
"schema": {
"type": "string"
@@ -8479,69 +8567,43 @@
"schema": {
"type": "string"
}
+ },
+ {
+ "name": "userId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
}
],
"requestBody": {
"required": true,
- "description": "Accepts different types of reschedule booking input: Reschedule Booking (Option 1) or Reschedule Seated Booking (Option 2). If you're rescheduling a seated booking as org admin of booking host, pass booking input for Reschedule Booking (Option 1) along with your access token in the request header.\n\n If you are rescheduling a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or\n you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.",
"content": {
"application/json": {
"schema": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/RescheduleBookingInput_2024_08_13"
- },
- {
- "$ref": "#/components/schemas/RescheduleSeatedBookingInput_2024_08_13"
- }
- ]
+ "$ref": "#/components/schemas/CreateOutOfOfficeEntryDto"
}
}
}
},
"responses": {
"201": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RescheduleBookingOutput_2024_08_13"
- }
- }
- }
+ "description": ""
}
},
- "tags": ["Bookings"]
+ "tags": ["Orgs / Users / OOO"]
}
},
- "/v2/bookings/{bookingUid}/cancel": {
- "post": {
- "operationId": "BookingsController_2024_08_13_cancelBooking",
- "summary": "Cancel a booking",
- "description": ":bookingUid can be :bookingUid of an usual booking, individual recurrence or recurring booking to cancel all recurrences.\n \n \nCancelling normal bookings:\n If the booking is not seated and not recurring, simply pass :bookingUid in the request URL `/bookings/:bookingUid/cancel` and optionally cancellationReason in the request body `{\"cancellationReason\": \"Will travel\"}`.\n\n \nCancelling seated bookings:\n It is possible to cancel specific seat within a booking as an attendee or all of the seats as the host.\n \n1. As an attendee - provide :bookingUid in the request URL `/bookings/:bookingUid/cancel` and seatUid in the request body `{\"seatUid\": \"123-123-123\"}` . This will remove this particular attendance from the booking.\n \n2. As the host or org admin of host - host can cancel booking for all attendees aka for every seat, this also applies to org admins. Provide :bookingUid in the request URL `/bookings/:bookingUid/cancel` and cancellationReason in the request body `{\"cancellationReason\": \"Will travel\"}` and `Authorization: Bearer token` request header where token is event type owner (host) credential. This will cancel the booking for all attendees.\n \n \nCancelling recurring seated bookings:\n For recurring seated bookings it is not possible to cancel all of them with 1 call\n like with non-seated recurring bookings by providing recurring bookind uid - you have to cancel each recurrence booking by its bookingUid + seatUid.\n \n If you are cancelling a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or\n you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.\n\n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "/v2/organizations/{orgId}/users/{userId}/ooo/{oooId}": {
+ "patch": {
+ "operationId": "OrganizationsUsersOOOController_updateOrganizationUserOOO",
+ "summary": "Update an out-of-office entry for a user",
"parameters": [
- {
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-08-13"
- }
- },
- {
- "name": "bookingUid",
- "required": true,
- "in": "path",
- "schema": {
- "type": "string"
- }
- },
{
"name": "Authorization",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": false,
"schema": {
"type": "string"
@@ -8564,129 +8626,182 @@
"schema": {
"type": "string"
}
+ },
+ {
+ "name": "userId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "oooId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
}
],
"requestBody": {
"required": true,
- "description": "Accepts different types of cancel booking input: Cancel Booking (Option 1 which is for normal or recurring bookings) or Cancel Seated Booking (Option 2 which is for seated bookings)",
"content": {
"application/json": {
"schema": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/CancelBookingInput_2024_08_13"
- },
- {
- "$ref": "#/components/schemas/CancelSeatedBookingInput_2024_08_13"
- }
- ]
+ "$ref": "#/components/schemas/UpdateOutOfOfficeEntryDto"
}
}
}
},
"responses": {
"200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CancelBookingOutput_2024_08_13"
- }
- }
- }
+ "description": ""
}
},
- "tags": ["Bookings"]
- }
- },
- "/v2/bookings/{bookingUid}/mark-absent": {
- "post": {
- "operationId": "BookingsController_2024_08_13_markNoShow",
- "summary": "Mark a booking absence",
- "description": "The provided authorization header refers to the owner of the booking.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "tags": ["Orgs / Users / OOO"]
+ },
+ "delete": {
+ "operationId": "OrganizationsUsersOOOController_deleteOrganizationUserOOO",
+ "summary": "Delete an out-of-office entry for a user",
"parameters": [
{
- "name": "cal-api-version",
+ "name": "Authorization",
"in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
- "type": "string",
- "default": "2024-08-13"
+ "type": "string"
}
},
{
- "name": "bookingUid",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "Authorization",
+ "name": "x-cal-client-id",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
- "required": true,
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/MarkAbsentBookingInput_2024_08_13"
- }
+ },
+ {
+ "name": "oooId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
}
}
- },
+ ],
"responses": {
"200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/MarkAbsentBookingOutput_2024_08_13"
- }
- }
- }
+ "description": ""
}
},
- "tags": ["Bookings"]
+ "tags": ["Orgs / Users / OOO"]
}
},
- "/v2/bookings/{bookingUid}/reassign": {
- "post": {
- "operationId": "BookingsController_2024_08_13_reassignBooking",
- "summary": "Reassign a booking to auto-selected host",
- "description": "Currently only supports reassigning host for round robin bookings. The provided authorization header refers to the owner of the booking.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "/v2/organizations/{orgId}/ooo": {
+ "get": {
+ "operationId": "OrganizationsUsersOOOController_getOrganizationUsersOOO",
+ "summary": "Get all out-of-office entries for organization users",
"parameters": [
{
- "name": "cal-api-version",
+ "name": "Authorization",
"in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
- "type": "string",
- "default": "2024-08-13"
+ "type": "string"
}
},
{
- "name": "bookingUid",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "Authorization",
+ "name": "x-cal-client-id",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "orgId",
"required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
+ }
+ },
+ {
+ "name": "sortStart",
+ "required": false,
+ "in": "query",
+ "description": "Sort results by their start time in ascending or descending order.",
+ "example": "?sortStart=asc OR ?sortStart=desc",
+ "schema": {
+ "enum": ["asc", "desc"],
+ "type": "string"
+ }
+ },
+ {
+ "name": "sortEnd",
+ "required": false,
+ "in": "query",
+ "description": "Sort results by their end time in ascending or descending order.",
+ "example": "?sortEnd=asc OR ?sortEnd=desc",
+ "schema": {
+ "enum": ["asc", "desc"],
+ "type": "string"
+ }
+ },
+ {
+ "name": "email",
+ "required": false,
+ "in": "query",
+ "description": "Filter ooo entries by the user email address. user must be within your organization.",
+ "example": "[email protected]",
"schema": {
"type": "string"
}
@@ -8694,58 +8809,50 @@
],
"responses": {
"200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ReassignBookingOutput_2024_08_13"
- }
- }
- }
+ "description": ""
}
},
- "tags": ["Bookings"]
+ "tags": ["Orgs / Users / OOO"]
}
},
- "/v2/bookings/{bookingUid}/reassign/{userId}": {
+ "/v2/organizations/{orgId}/users/{userId}/schedules": {
"post": {
- "operationId": "BookingsController_2024_08_13_reassignBookingToUser",
- "summary": "Reassign a booking to a specific host",
- "description": "Currently only supports reassigning host for round robin bookings. The provided authorization header refers to the owner of the booking.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "operationId": "OrganizationsSchedulesController_createUserSchedule",
+ "summary": "Create a schedule",
"parameters": [
{
- "name": "cal-api-version",
+ "name": "Authorization",
"in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
- "type": "string",
- "default": "2024-08-13"
+ "type": "string"
}
},
{
- "name": "bookingUid",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "userId",
- "required": true,
- "in": "path",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "Authorization",
- "in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "name": "userId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
}
],
@@ -8754,58 +8861,63 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ReassignToUserBookingInput_2024_08_13"
+ "$ref": "#/components/schemas/CreateScheduleInput_2024_06_11"
}
}
}
},
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ReassignBookingOutput_2024_08_13"
+ "$ref": "#/components/schemas/CreateScheduleOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Bookings"]
- }
- },
- "/v2/bookings/{bookingUid}/confirm": {
- "post": {
- "operationId": "BookingsController_2024_08_13_confirmBooking",
- "summary": "Confirm a booking",
- "description": "The provided authorization header refers to the owner of the booking.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "tags": ["Orgs / Users / Schedules"]
+ },
+ "get": {
+ "operationId": "OrganizationsSchedulesController_getUserSchedules",
+ "summary": "Get all schedules",
"parameters": [
{
- "name": "cal-api-version",
+ "name": "Authorization",
"in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
- "type": "string",
- "default": "2024-08-13"
+ "type": "string"
}
},
{
- "name": "bookingUid",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "Authorization",
+ "name": "x-cal-client-id",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
- "required": true,
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
+ },
+ {
+ "name": "userId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
}
],
"responses": {
@@ -8814,105 +8926,61 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetBookingOutput_2024_08_13"
+ "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Bookings"]
+ "tags": ["Orgs / Users / Schedules"]
}
},
- "/v2/bookings/{bookingUid}/decline": {
- "post": {
- "operationId": "BookingsController_2024_08_13_declineBooking",
- "summary": "Decline a booking",
- "description": "The provided authorization header refers to the owner of the booking.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note> \n ",
+ "/v2/organizations/{orgId}/users/{userId}/schedules/{scheduleId}": {
+ "get": {
+ "operationId": "OrganizationsSchedulesController_getUserSchedule",
+ "summary": "Get a schedule",
"parameters": [
{
- "name": "cal-api-version",
+ "name": "Authorization",
"in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
- "type": "string",
- "default": "2024-08-13"
+ "type": "string"
}
},
{
- "name": "bookingUid",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "Authorization",
+ "name": "x-cal-client-id",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
- "required": true,
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DeclineBookingInput_2024_08_13"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetBookingOutput_2024_08_13"
- }
- }
- }
- }
- },
- "tags": ["Bookings"]
- }
- },
- "/v2/bookings/{bookingUid}/calendar-links": {
- "get": {
- "operationId": "BookingsController_2024_08_13_getCalendarLinks",
- "summary": "Get 'Add to Calendar' links for a booking",
- "description": "Retrieve calendar links for a booking that can be used to add the event to various calendar services. Returns links for Google Calendar, Microsoft Office, Microsoft Outlook, and a downloadable ICS file.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note> \n ",
- "parameters": [
- {
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-08-13"
- }
},
{
- "name": "bookingUid",
+ "name": "userId",
"required": true,
"in": "path",
"schema": {
- "type": "string"
+ "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": "scheduleId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
}
],
@@ -8922,112 +8990,59 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CalendarLinksOutput_2024_08_13"
+ "$ref": "#/components/schemas/GetScheduleOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Bookings"]
- }
- },
- "/v2/bookings/{bookingUid}/references": {
- "get": {
- "operationId": "BookingsController_2024_08_13_getBookingReferences",
- "summary": "Get booking references",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "tags": ["Orgs / Users / Schedules"]
+ },
+ "patch": {
+ "operationId": "OrganizationsSchedulesController_updateUserSchedule",
+ "summary": "Update a schedule",
"parameters": [
{
- "name": "cal-api-version",
+ "name": "Authorization",
"in": "header",
- "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-08-13"
- }
- },
- {
- "name": "bookingUid",
- "required": true,
- "in": "path",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "type",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": false,
- "in": "query",
- "description": "Filter booking references by type",
- "example": "google_calendar",
"schema": {
- "enum": [
- "google_calendar",
- "office365_calendar",
- "daily_video",
- "google_video",
- "office365_video",
- "zoom_video"
- ],
"type": "string"
}
},
{
- "name": "Authorization",
+ "name": "x-cal-secret-key",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
- "required": true,
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/BookingReferencesOutput_2024_08_13"
- }
- }
- }
- }
- },
- "tags": ["Bookings"]
- }
- },
- "/v2/bookings/{bookingUid}/guests": {
- "post": {
- "operationId": "BookingGuestsController_2024_08_13_addGuests",
- "summary": "Add guests to an existing booking",
- "description": "Add one or more guests to an existing booking.\n \n **Email Notifications:**\n When guests are added, the following notifications are sent (unless disabled by event type settings):\n \n - **Organizer & Team Members:** Receive an \"Add Guests\" notification email informing them that new guests have been added to the booking.\n \n - **New Guests:** Receive a \"Scheduled Event\" email with full booking details and calendar invite. If they have a phone number, they also receive an SMS notification.\n \n - **Existing Guests:** Receive an \"Add Guests\" notification email informing them that additional guests have been added to the booking.\n \n <Note>The cal-api-version header is required for this endpoint. Without it, the request will fail with a 404 error.</Note>\n ",
- "parameters": [
+ },
{
- "name": "cal-api-version",
+ "name": "x-cal-client-id",
"in": "header",
- "description": "Must be set to 2024-08-13. This header is required as this endpoint does not exist in older API versions.",
- "required": true,
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "bookingUid",
+ "name": "userId",
"required": true,
"in": "path",
"schema": {
- "type": "string"
+ "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": "scheduleId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
}
],
@@ -9036,7 +9051,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/AddGuestsInput_2024_08_13"
+ "$ref": "#/components/schemas/UpdateScheduleInput_2024_06_11"
}
}
}
@@ -9047,176 +9062,141 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/AddGuestsOutput_2024_08_13"
+ "$ref": "#/components/schemas/UpdateScheduleOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Bookings / Guests"]
- }
- },
- "/v2/calendars/{calendar}/event/{eventUid}": {
- "get": {
- "operationId": "CalUnifiedCalendarsController_getCalendarEventDetails",
- "summary": "Get meeting details from calendar",
- "description": "Returns detailed information about a meeting including attendance metrics",
+ "tags": ["Orgs / Users / Schedules"]
+ },
+ "delete": {
+ "operationId": "OrganizationsSchedulesController_deleteUserSchedule",
+ "summary": "Delete a schedule",
"parameters": [
{
- "name": "calendar",
- "required": true,
- "in": "path",
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
- "enum": ["google"],
"type": "string"
}
},
{
- "name": "eventUid",
- "required": true,
- "in": "path",
- "description": "The Google Calendar event ID. You can retrieve this by getting booking references from the following endpoints:\n\n- For team events: https://cal.com/docs/api-reference/v2/orgs-teams-bookings/get-booking-references-for-a-booking\n\n- For user events: https://cal.com/docs/api-reference/v2/bookings/get-booking-references-for-a-booking",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "Authorization",
+ "name": "x-cal-client-id",
"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/GetUnifiedCalendarEventOutput"
- }
- }
- }
- }
- },
- "tags": ["Cal Unified Calendars"]
- }
- },
- "/v2/calendars/{calendar}/events/{eventUid}": {
- "patch": {
- "operationId": "CalUnifiedCalendarsController_updateCalendarEvent",
- "summary": "Update meeting details in calendar",
- "description": "Updates event information in the specified calendar provider",
- "parameters": [
- {
- "name": "calendar",
- "required": true,
- "in": "path",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
- "enum": ["google"],
"type": "string"
}
},
{
- "name": "eventUid",
+ "name": "userId",
"required": true,
"in": "path",
- "description": "The Google Calendar event ID. You can retrieve this by getting booking references from the following endpoints:\n\n- For team events: https://cal.com/docs/api-reference/v2/orgs-teams-bookings/get-booking-references-for-a-booking\n\n- For user events: https://cal.com/docs/api-reference/v2/bookings/get-booking-references-for-a-booking",
"schema": {
- "type": "string"
+ "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": "scheduleId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateUnifiedCalendarEventInput"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetUnifiedCalendarEventOutput"
+ "$ref": "#/components/schemas/DeleteScheduleOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Cal Unified Calendars"]
+ "tags": ["Orgs / Users / Schedules"]
}
},
- "/v2/calendars/ics-feed/save": {
- "post": {
- "operationId": "CalendarsController_createIcsFeed",
- "summary": "Save an ICS feed",
+ "/v2/organizations/{orgId}/webhooks": {
+ "get": {
+ "operationId": "OrganizationsWebhooksController_getAllOrganizationWebhooks",
+ "summary": "Get all webhooks",
"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,
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreateIcsFeedInputDto"
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreateIcsFeedOutputResponseDto"
- }
- }
+ },
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
}
- }
- },
- "tags": ["Calendars"]
- }
- },
- "/v2/calendars/ics-feed/check": {
- "get": {
- "operationId": "CalendarsController_checkIcsFeed",
- "summary": "Check an ICS feed",
- "parameters": [
+ },
{
- "name": "Authorization",
+ "name": "x-cal-client-id",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
- "required": true,
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
+ },
+ {
+ "name": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
+ }
}
],
"responses": {
@@ -9225,102 +9205,115 @@
"content": {
"application/json": {
"schema": {
- "type": "object"
+ "$ref": "#/components/schemas/TeamWebhooksOutputResponseDto"
}
}
}
}
},
- "tags": ["Calendars"]
- }
- },
- "/v2/calendars/busy-times": {
- "get": {
- "operationId": "CalendarsController_getBusyTimes",
- "summary": "Get busy times",
- "description": "Get busy times from a calendar. Example request URL is `https://api.cal.com/v2/calendars/busy-times?loggedInUsersTz=Europe%2FMadrid&dateFrom=2024-12-18&dateTo=2024-12-18&calendarsToLoad[0][credentialId]=135&calendarsToLoad[0][externalId]=skrauciz%40gmail.com`",
+ "tags": ["Orgs / Webhooks"]
+ },
+ "post": {
+ "operationId": "OrganizationsWebhooksController_createOrganizationWebhook",
+ "summary": "Create a webhook",
"parameters": [
{
- "name": "loggedInUsersTz",
- "required": true,
- "in": "query",
- "description": "The timezone of the logged in user represented as a string",
- "example": "America/New_York",
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "dateFrom",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
"required": false,
- "in": "query",
- "description": "The starting date for the busy times query",
- "example": "2023-10-01",
"schema": {
"type": "string"
}
},
{
- "name": "dateTo",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"required": false,
- "in": "query",
- "description": "The ending date for the busy times query",
- "example": "2023-10-31",
"schema": {
"type": "string"
}
},
{
- "name": "credentialId",
- "in": "query",
+ "name": "orgId",
"required": true,
+ "in": "path",
"schema": {
"type": "number"
}
- },
- {
- "name": "externalId",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "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/CreateWebhookInputDto"
+ }
+ }
+ }
+ },
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetBusyTimesOutput"
+ "$ref": "#/components/schemas/TeamWebhookOutputResponseDto"
}
}
}
}
},
- "tags": ["Calendars"]
+ "tags": ["Orgs / Webhooks"]
}
},
- "/v2/calendars": {
+ "/v2/organizations/{orgId}/webhooks/{webhookId}": {
"get": {
- "operationId": "CalendarsController_getCalendars",
- "summary": "Get all calendars",
+ "operationId": "OrganizationsWebhooksController_getOrganizationWebhook",
+ "summary": "Get a webhook",
"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": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "webhookId",
"required": true,
+ "in": "path",
"schema": {
"type": "string"
}
@@ -9332,51 +9325,49 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ConnectedCalendarsOutput"
+ "$ref": "#/components/schemas/TeamWebhookOutputResponseDto"
}
}
}
}
},
- "tags": ["Calendars"]
- }
- },
- "/v2/calendars/{calendar}/connect": {
- "get": {
- "operationId": "CalendarsController_redirect",
- "summary": "Get OAuth connect URL",
+ "tags": ["Orgs / Webhooks"]
+ },
+ "delete": {
+ "operationId": "OrganizationsWebhooksController_deleteWebhook",
+ "summary": "Delete a webhook",
"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",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "calendar",
- "required": true,
- "in": "path",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
- "enum": ["office365", "google"],
"type": "string"
}
},
{
- "name": "isDryRun",
- "required": true,
- "in": "query",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
- "type": "boolean"
+ "type": "string"
}
},
{
- "name": "redir",
- "required": false,
- "in": "query",
- "description": "Redirect URL after successful calendar authorization.",
+ "name": "webhookId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "string"
}
@@ -9388,73 +9379,49 @@
"content": {
"application/json": {
"schema": {
- "type": "object"
+ "$ref": "#/components/schemas/TeamWebhookOutputResponseDto"
}
}
}
}
},
- "tags": ["Calendars"]
- }
- },
- "/v2/calendars/{calendar}/save": {
- "get": {
- "operationId": "CalendarsController_save",
- "summary": "Save Google or Outlook calendar credentials",
+ "tags": ["Orgs / Webhooks"]
+ },
+ "patch": {
+ "operationId": "OrganizationsWebhooksController_updateOrgWebhook",
+ "summary": "Update a webhook",
"parameters": [
{
- "name": "state",
- "required": true,
- "in": "query",
+ "name": "Authorization",
+ "in": "header",
+ "description": "For non-platform customers - value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "code",
- "required": true,
- "in": "query",
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "calendar",
- "required": true,
- "in": "path",
- "schema": {
- "enum": ["office365", "google"],
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": ""
- }
- },
- "tags": ["Calendars"]
- }
- },
- "/v2/calendars/{calendar}/credentials": {
- "post": {
- "operationId": "CalendarsController_syncCredentials",
- "summary": "Save Apple calendar credentials",
- "parameters": [
- {
- "name": "calendar",
- "required": true,
- "in": "path",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
- "enum": ["apple"],
"type": "string"
}
},
{
- "name": "Authorization",
- "in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "name": "webhookId",
"required": true,
+ "in": "path",
"schema": {
"type": "string"
}
@@ -9465,76 +9432,36 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateCalendarCredentialsInput"
+ "$ref": "#/components/schemas/UpdateWebhookInputDto"
}
}
}
},
- "responses": {
- "201": {
- "description": ""
- }
- },
- "tags": ["Calendars"]
- }
- },
- "/v2/calendars/{calendar}/check": {
- "get": {
- "operationId": "CalendarsController_check",
- "summary": "Check a calendar connection",
- "parameters": [
- {
- "name": "calendar",
- "required": true,
- "in": "path",
- "schema": {
- "enum": ["apple", "google", "office365"],
- "type": "string"
- }
- },
- {
- "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": {
- "type": "object"
+ "$ref": "#/components/schemas/TeamWebhookOutputResponseDto"
}
}
}
}
},
- "tags": ["Calendars"]
+ "tags": ["Orgs / Webhooks"]
}
},
- "/v2/calendars/{calendar}/disconnect": {
+ "/v2/api-keys/refresh": {
"post": {
- "operationId": "CalendarsController_deleteCalendarCredentials",
- "summary": "Disconnect a calendar",
+ "operationId": "ApiKeysController_refresh",
+ "summary": "Refresh API Key",
+ "description": "Generate a new API key and delete the current one. Provide API key to refresh as a Bearer token in the Authorization header (e.g. \"Authorization: Bearer <apiKey>\").",
"parameters": [
- {
- "name": "calendar",
- "required": true,
- "in": "path",
- "schema": {
- "enum": ["apple", "google", "office365"],
- "type": "string"
- }
- },
{
"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"
@@ -9546,7 +9473,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteCalendarCredentialsInputBodyDto"
+ "$ref": "#/components/schemas/RefreshApiKeyInput"
}
}
}
@@ -9557,156 +9484,319 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeletedCalendarCredentialsOutputResponseDto"
+ "$ref": "#/components/schemas/RefreshApiKeyOutput"
}
}
}
}
},
- "tags": ["Calendars"]
+ "tags": ["Api Keys"]
}
},
- "/v2/conferencing/{app}/connect": {
+ "/v2/bookings": {
"post": {
- "operationId": "ConferencingController_connect",
- "summary": "Connect your conferencing application",
+ "operationId": "BookingsController_2024_08_13_createBooking",
+ "summary": "Create a booking",
+ "description": "\n POST /v2/bookings is used to create regular bookings, recurring bookings and instant bookings. The request bodies for all 3 are almost the same except:\n If eventTypeId in the request body is id of a regular event, then regular booking is created.\n\n If it is an id of a recurring event type, then recurring booking is created.\n\n Meaning that the request bodies are equal but the outcome depends on what kind of event type it is with the goal of making it as seamless for developers as possible.\n\n For team event types it is possible to create instant meeting. To do that just pass `\"instant\": true` to the request body.\n\n The start needs to be in UTC aka if the timezone is GMT+2 in Rome and meeting should start at 11, then UTC time should have hours 09:00 aka without time zone.\n\n Finally, there are 2 ways to book an event type belonging to an individual user:\n 1. Provide `eventTypeId` in the request body.\n 2. Provide `eventTypeSlug` and `username` and optionally `organizationSlug` if the user with the username is within an organization.\n\n And 2 ways to book and event type belonging to a team:\n 1. Provide `eventTypeId` in the request body.\n 2. Provide `eventTypeSlug` and `teamSlug` and optionally `organizationSlug` if the team with the teamSlug is within an organization.\n\n If you are creating a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or\n you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.\n\n For event types that have SMS reminders workflow, you need to pass the attendee's phone number in the request body via `attendee.phoneNumber` (e.g., \"+19876543210\" in international format). This is an optional field, but becomes required when SMS reminders are enabled for the event type. For the complete attendee object structure, see the [attendee object](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#body-attendee) documentation.\n\n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
- "name": "app",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
- "description": "Conferencing application type",
"schema": {
- "enum": ["google-meet"],
- "type": "string"
+ "type": "string",
+ "default": "2024-08-13"
}
},
{
"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,
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "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,
+ "description": "Accepts different types of booking input: Create Booking (Option 1), Create Instant Booking (Option 2), or Create Recurring Booking (Option 3)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/CreateBookingInput_2024_08_13"
+ },
+ {
+ "$ref": "#/components/schemas/CreateInstantBookingInput_2024_08_13"
+ },
+ {
+ "$ref": "#/components/schemas/CreateRecurringBookingInput_2024_08_13"
+ }
+ ]
+ }
+ }
+ }
+ },
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ConferencingAppOutputResponseDto"
+ "$ref": "#/components/schemas/CreateBookingOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Conferencing"]
- }
- },
- "/v2/conferencing/{app}/oauth/auth-url": {
+ "tags": ["Bookings"]
+ },
"get": {
- "operationId": "ConferencingController_redirect",
- "summary": "Get OAuth conferencing app auth URL",
+ "operationId": "BookingsController_2024_08_13_getBookings",
+ "summary": "Get all bookings",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"parameters": [
{
- "name": "Authorization",
- "required": true,
+ "name": "cal-api-version",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
+ "required": true,
"schema": {
- "type": "string"
+ "type": "string",
+ "default": "2024-08-13"
}
},
{
- "name": "app",
- "required": true,
- "in": "path",
- "description": "Conferencing application type",
+ "name": "status",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by status. If you want to filter by multiple statuses, separate them with a comma.",
+ "example": "?status=upcoming,past",
"schema": {
- "enum": ["zoom", "msteams"],
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["upcoming", "recurring", "past", "cancelled", "unconfirmed"]
+ }
}
},
{
- "name": "returnTo",
- "required": true,
+ "name": "attendeeEmail",
+ "required": false,
"in": "query",
+ "description": "Filter bookings by the attendee's email address.",
+ "example": "[email protected]",
"schema": {
"type": "string"
}
},
{
- "name": "onErrorReturnTo",
- "required": true,
+ "name": "attendeeName",
+ "required": false,
"in": "query",
+ "description": "Filter bookings by the attendee's name.",
+ "example": "John Doe",
"schema": {
"type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetConferencingAppsOauthUrlResponseDto"
- }
- }
- }
- }
- },
- "tags": ["Conferencing"]
- }
- },
- "/v2/conferencing/{app}/oauth/callback": {
- "get": {
- "operationId": "ConferencingController_save",
- "summary": "Conferencing app OAuth callback",
- "parameters": [
+ },
{
- "name": "state",
- "required": true,
+ "name": "bookingUid",
+ "required": false,
"in": "query",
+ "description": "Filter bookings by the booking Uid.",
+ "example": "2NtaeaVcKfpmSZ4CthFdfk",
"schema": {
"type": "string"
}
},
{
- "name": "app",
- "required": true,
- "in": "path",
- "description": "Conferencing application type",
+ "name": "eventTypeIds",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by event type ids belonging to the user. Event type ids must be separated by a comma.",
+ "example": "?eventTypeIds=100,200",
"schema": {
- "enum": ["zoom", "msteams"],
"type": "string"
}
},
{
- "name": "code",
- "required": true,
+ "name": "eventTypeId",
+ "required": false,
"in": "query",
+ "description": "Filter bookings by event type id belonging to the user.",
+ "example": "?eventTypeId=100",
"schema": {
"type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": ""
- }
- },
- "tags": ["Conferencing"]
- }
- },
- "/v2/conferencing": {
- "get": {
- "operationId": "ConferencingController_listInstalledConferencingApps",
- "summary": "List your conferencing applications",
- "parameters": [
+ },
+ {
+ "name": "teamsIds",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by team ids that user is part of. Team ids must be separated by a comma.",
+ "example": "?teamIds=50,60",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "teamId",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings by team id that user is part of",
+ "example": "?teamId=50",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "afterStart",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings with start after this date string.",
+ "example": "?afterStart=2025-03-07T10:00:00.000Z",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "beforeEnd",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings with end before this date string.",
+ "example": "?beforeEnd=2025-03-07T11:00:00.000Z",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "afterCreatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings that have been created after this date string.",
+ "example": "?afterCreatedAt=2025-03-07T10:00:00.000Z",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "beforeCreatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings that have been created before this date string.",
+ "example": "?beforeCreatedAt=2025-03-14T11:00:00.000Z",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "afterUpdatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings that have been updated after this date string.",
+ "example": "?afterUpdatedAt=2025-03-07T10:00:00.000Z",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "beforeUpdatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Filter bookings that have been updated before this date string.",
+ "example": "?beforeUpdatedAt=2025-03-14T11:00:00.000Z",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "sortStart",
+ "required": false,
+ "in": "query",
+ "description": "Sort results by their start time in ascending or descending order.",
+ "example": "?sortStart=asc OR ?sortStart=desc",
+ "schema": {
+ "enum": ["asc", "desc"],
+ "type": "string"
+ }
+ },
+ {
+ "name": "sortEnd",
+ "required": false,
+ "in": "query",
+ "description": "Sort results by their end time in ascending or descending order.",
+ "example": "?sortEnd=asc OR ?sortEnd=desc",
+ "schema": {
+ "enum": ["asc", "desc"],
+ "type": "string"
+ }
+ },
+ {
+ "name": "sortCreated",
+ "required": false,
+ "in": "query",
+ "description": "Sort results by their creation time (when booking was made) in ascending or descending order.",
+ "example": "?sortCreated=asc OR ?sortCreated=desc",
+ "schema": {
+ "enum": ["asc", "desc"],
+ "type": "string"
+ }
+ },
+ {
+ "name": "sortUpdatedAt",
+ "required": false,
+ "in": "query",
+ "description": "Sort results by their updated time (for example when booking status changes) in ascending or descending order.",
+ "example": "?sortUpdated=asc OR ?sortUpdated=desc",
+ "schema": {
+ "enum": ["asc", "desc"],
+ "type": "string"
+ }
+ },
+ {
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "The number of items to return",
+ "example": 10,
+ "schema": {
+ "default": 100,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "The number of items to skip",
+ "example": 0,
+ "schema": {
+ "default": 0,
+ "type": "number"
+ }
+ },
{
"name": "Authorization",
"in": "header",
@@ -9723,27 +9813,36 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ConferencingAppsOutputResponseDto"
+ "$ref": "#/components/schemas/GetBookingsOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Conferencing"]
+ "tags": ["Bookings"]
}
},
- "/v2/conferencing/{app}/default": {
- "post": {
- "operationId": "ConferencingController_default",
- "summary": "Set your default conferencing application",
+ "/v2/bookings/{bookingUid}": {
+ "get": {
+ "operationId": "BookingsController_2024_08_13_getBooking",
+ "summary": "Get a booking",
+ "description": "`:bookingUid` can be\n\n 1. uid of a normal booking\n\n 2. uid of one of the recurring booking recurrences\n\n 3. uid of recurring booking which will return an array of all recurring booking recurrences (stored as recurringBookingUid on one of the individual recurrences).\n \n If you are fetching a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or\n you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.\n\n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
- "name": "app",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "default": "2024-08-13"
+ }
+ },
+ {
+ "name": "bookingUid",
"required": true,
"in": "path",
- "description": "Conferencing application type",
"schema": {
- "enum": ["google-meet", "zoom", "msteams", "daily-video"],
"type": "string"
}
},
@@ -9751,7 +9850,25 @@
"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,
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
@@ -9763,25 +9880,35 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/SetDefaultConferencingAppOutputResponseDto"
+ "$ref": "#/components/schemas/GetBookingOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Conferencing"]
+ "tags": ["Bookings"]
}
},
- "/v2/conferencing/default": {
+ "/v2/bookings/{bookingUid}/recordings": {
"get": {
- "operationId": "ConferencingController_getDefault",
- "summary": "Get your default conferencing application",
+ "operationId": "BookingsController_2024_08_13_getBookingRecordings",
+ "summary": "Get all the recordings for the booking",
+ "description": "Fetches all the recordings for the booking `:bookingUid`\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
- "name": "Authorization",
+ "name": "cal-api-version",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "default": "2024-08-13"
+ }
+ },
+ {
+ "name": "bookingUid",
"required": true,
+ "in": "path",
"schema": {
"type": "string"
}
@@ -9793,35 +9920,35 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetDefaultConferencingAppOutputResponseDto"
+ "$ref": "#/components/schemas/GetBookingRecordingsOutput"
}
}
}
}
},
- "tags": ["Conferencing"]
+ "tags": ["Bookings"]
}
},
- "/v2/conferencing/{app}/disconnect": {
- "delete": {
- "operationId": "ConferencingController_disconnect",
- "summary": "Disconnect your conferencing application",
+ "/v2/bookings/{bookingUid}/transcripts": {
+ "get": {
+ "operationId": "BookingsController_2024_08_13_getBookingTranscripts",
+ "summary": "Get all the transcripts download links for the booking",
+ "description": "Fetches all the transcripts download links for the booking `:bookingUid`\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
- "name": "app",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
- "description": "Conferencing application type",
"schema": {
- "enum": ["google-meet", "zoom", "msteams"],
- "type": "string"
+ "type": "string",
+ "default": "2024-08-13"
}
},
{
- "name": "Authorization",
- "in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "name": "bookingUid",
"required": true,
+ "in": "path",
"schema": {
"type": "string"
}
@@ -9833,76 +9960,62 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DisconnectConferencingAppOutputResponseDto"
+ "$ref": "#/components/schemas/GetBookingTranscriptsOutput"
}
}
}
}
},
- "tags": ["Conferencing"]
+ "tags": ["Bookings"]
}
},
- "/v2/destination-calendars": {
- "put": {
- "operationId": "DestinationCalendarsController_updateDestinationCalendars",
- "summary": "Update destination calendars",
+ "/v2/bookings/{bookingUid}/reschedule": {
+ "post": {
+ "operationId": "BookingsController_2024_08_13_rescheduleBooking",
+ "summary": "Reschedule a booking",
+ "description": "Reschedule a booking or seated booking\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
- "name": "Authorization",
+ "name": "cal-api-version",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
"required": true,
"schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DestinationCalendarsInputBodyDto"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DestinationCalendarsOutputResponseDto"
- }
- }
+ "type": "string",
+ "default": "2024-08-13"
}
- }
- },
- "tags": ["Destination Calendars"]
- }
- },
- "/v2/event-types": {
- "post": {
- "operationId": "EventTypesController_2024_06_14_createEventType",
- "summary": "Create an event type",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
- "parameters": [
+ },
{
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-06-14. If not set to this value, the endpoint will default to an older version.",
+ "name": "bookingUid",
"required": true,
+ "in": "path",
"schema": {
- "type": "string",
- "default": "2024-06-14"
+ "type": "string"
}
},
{
"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,
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
@@ -9910,10 +10023,18 @@
],
"requestBody": {
"required": true,
+ "description": "Accepts different types of reschedule booking input: Reschedule Booking (Option 1) or Reschedule Seated Booking (Option 2). If you're rescheduling a seated booking as org admin of booking host, pass booking input for Reschedule Booking (Option 1) along with your access token in the request header.\n\n If you are rescheduling a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or\n you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateEventTypeInput_2024_06_14"
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/RescheduleBookingInput_2024_08_13"
+ },
+ {
+ "$ref": "#/components/schemas/RescheduleSeatedBookingInput_2024_08_13"
+ }
+ ]
}
}
}
@@ -9924,74 +10045,39 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateEventTypeOutput_2024_06_14"
+ "$ref": "#/components/schemas/RescheduleBookingOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Event Types"]
- },
- "get": {
- "operationId": "EventTypesController_2024_06_14_getEventTypes",
- "summary": "Get all event types",
- "description": "Hidden event types are returned only if authentication is provided and it belongs to the event type owner.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "tags": ["Bookings"]
+ }
+ },
+ "/v2/bookings/{bookingUid}/cancel": {
+ "post": {
+ "operationId": "BookingsController_2024_08_13_cancelBooking",
+ "summary": "Cancel a booking",
+ "description": ":bookingUid can be :bookingUid of an usual booking, individual recurrence or recurring booking to cancel all recurrences.\n \n \nCancelling normal bookings:\n If the booking is not seated and not recurring, simply pass :bookingUid in the request URL `/bookings/:bookingUid/cancel` and optionally cancellationReason in the request body `{\"cancellationReason\": \"Will travel\"}`.\n\n \nCancelling seated bookings:\n It is possible to cancel specific seat within a booking as an attendee or all of the seats as the host.\n \n1. As an attendee - provide :bookingUid in the request URL `/bookings/:bookingUid/cancel` and seatUid in the request body `{\"seatUid\": \"123-123-123\"}` . This will remove this particular attendance from the booking.\n \n2. As the host or org admin of host - host can cancel booking for all attendees aka for every seat, this also applies to org admins. Provide :bookingUid in the request URL `/bookings/:bookingUid/cancel` and cancellationReason in the request body `{\"cancellationReason\": \"Will travel\"}` and `Authorization: Bearer token` request header where token is event type owner (host) credential. This will cancel the booking for all attendees.\n \n \nCancelling recurring seated bookings:\n For recurring seated bookings it is not possible to cancel all of them with 1 call\n like with non-seated recurring bookings by providing recurring bookind uid - you have to cancel each recurrence booking by its bookingUid + seatUid.\n \n If you are cancelling a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or\n you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.\n\n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
"name": "cal-api-version",
"in": "header",
- "description": "Must be set to 2024-06-14. If not set to this value, the endpoint will default to an older version.",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
"required": true,
"schema": {
"type": "string",
- "default": "2024-06-14"
- }
- },
- {
- "name": "username",
- "required": false,
- "in": "query",
- "description": "The username of the user to get event types for. If only username provided will get all event types.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "eventSlug",
- "required": false,
- "in": "query",
- "description": "Slug of event type to return. Notably, if eventSlug is provided then username must be provided too, because multiple users can have event with same slug.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "usernames",
- "required": false,
- "in": "query",
- "description": "Get dynamic event type for multiple usernames separated by comma. e.g `usernames=alice,bob`",
- "schema": {
- "type": "string"
+ "default": "2024-08-13"
}
},
{
- "name": "orgSlug",
- "required": false,
- "in": "query",
- "description": "slug of the user's organization if he is in one, orgId is not required if using this parameter",
+ "name": "bookingUid",
+ "required": true,
+ "in": "path",
"schema": {
"type": "string"
}
},
- {
- "name": "orgId",
- "required": false,
- "in": "query",
- "description": "ID of the organization of the user you want the get the event-types of, orgSlug is not needed when using this parameter",
- "schema": {
- "type": "number"
- }
- },
{
"name": "Authorization",
"in": "header",
@@ -10020,39 +10106,57 @@
}
}
],
+ "requestBody": {
+ "required": true,
+ "description": "Accepts different types of cancel booking input: Cancel Booking (Option 1 which is for normal or recurring bookings) or Cancel Seated Booking (Option 2 which is for seated bookings)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/CancelBookingInput_2024_08_13"
+ },
+ {
+ "$ref": "#/components/schemas/CancelSeatedBookingInput_2024_08_13"
+ }
+ ]
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetEventTypesOutput_2024_06_14"
+ "$ref": "#/components/schemas/CancelBookingOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Event Types"]
+ "tags": ["Bookings"]
}
},
- "/v2/event-types/{eventTypeId}": {
- "get": {
- "operationId": "EventTypesController_2024_06_14_getEventTypeById",
- "summary": "Get an event type",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "/v2/bookings/{bookingUid}/mark-absent": {
+ "post": {
+ "operationId": "BookingsController_2024_08_13_markNoShow",
+ "summary": "Mark a booking absence",
+ "description": "The provided authorization header refers to the owner of the booking.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
"name": "cal-api-version",
"in": "header",
- "description": "Must be set to 2024-06-14. If not set to this value, the endpoint will default to an older version.",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
"required": true,
"schema": {
"type": "string",
- "default": "2024-06-14"
+ "default": "2024-08-13"
}
},
{
- "name": "eventTypeId",
+ "name": "bookingUid",
"required": true,
"in": "path",
"schema": {
@@ -10069,41 +10173,53 @@
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MarkAbsentBookingInput_2024_08_13"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetEventTypeOutput_2024_06_14"
+ "$ref": "#/components/schemas/MarkAbsentBookingOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Event Types"]
- },
- "patch": {
- "operationId": "EventTypesController_2024_06_14_updateEventType",
- "summary": "Update an event type",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "tags": ["Bookings"]
+ }
+ },
+ "/v2/bookings/{bookingUid}/reassign": {
+ "post": {
+ "operationId": "BookingsController_2024_08_13_reassignBooking",
+ "summary": "Reassign a booking to auto-selected host",
+ "description": "Currently only supports reassigning host for round robin bookings. The provided authorization header refers to the owner of the booking.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
"name": "cal-api-version",
"in": "header",
- "description": "Must be set to 2024-06-14. If not set to this value, the endpoint will default to an older version.",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
"required": true,
"schema": {
"type": "string",
- "default": "2024-06-14"
+ "default": "2024-08-13"
}
},
{
- "name": "eventTypeId",
+ "name": "bookingUid",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
@@ -10116,47 +10232,47 @@
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateEventTypeInput_2024_06_14"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateEventTypeOutput_2024_06_14"
+ "$ref": "#/components/schemas/ReassignBookingOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Event Types"]
- },
- "delete": {
- "operationId": "EventTypesController_2024_06_14_deleteEventType",
- "summary": "Delete an event type",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "tags": ["Bookings"]
+ }
+ },
+ "/v2/bookings/{bookingUid}/reassign/{userId}": {
+ "post": {
+ "operationId": "BookingsController_2024_08_13_reassignBookingToUser",
+ "summary": "Reassign a booking to a specific host",
+ "description": "Currently only supports reassigning host for round robin bookings. The provided authorization header refers to the owner of the booking.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
"name": "cal-api-version",
"in": "header",
- "description": "Must be set to 2024-06-14. If not set to this value, the endpoint will default to an older version.",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
"required": true,
"schema": {
"type": "string",
- "default": "2024-06-14"
+ "default": "2024-08-13"
}
},
{
- "name": "eventTypeId",
+ "name": "bookingUid",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "userId",
"required": true,
"in": "path",
"schema": {
@@ -10173,26 +10289,55 @@
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ReassignToUserBookingInput_2024_08_13"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteEventTypeOutput_2024_06_14"
+ "$ref": "#/components/schemas/ReassignBookingOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Event Types"]
+ "tags": ["Bookings"]
}
},
- "/v2/event-types/{eventTypeId}/webhooks": {
+ "/v2/bookings/{bookingUid}/confirm": {
"post": {
- "operationId": "EventTypeWebhooksController_createEventTypeWebhook",
- "summary": "Create a webhook",
+ "operationId": "BookingsController_2024_08_13_confirmBooking",
+ "summary": "Confirm a booking",
+ "description": "The provided authorization header refers to the owner of the booking.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
+ {
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "default": "2024-08-13"
+ }
+ },
+ {
+ "name": "bookingUid",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ },
{
"name": "Authorization",
"in": "header",
@@ -10201,13 +10346,54 @@
"schema": {
"type": "string"
}
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetBookingOutput_2024_08_13"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Bookings"]
+ }
+ },
+ "/v2/bookings/{bookingUid}/decline": {
+ "post": {
+ "operationId": "BookingsController_2024_08_13_declineBooking",
+ "summary": "Decline a booking",
+ "description": "The provided authorization header refers to the owner of the booking.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note> \n ",
+ "parameters": [
+ {
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "default": "2024-08-13"
+ }
},
{
- "name": "eventTypeId",
+ "name": "bookingUid",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "type": "string"
+ }
+ },
+ {
+ "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"
}
}
],
@@ -10216,69 +10402,57 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateWebhookInputDto"
+ "$ref": "#/components/schemas/DeclineBookingInput_2024_08_13"
}
}
}
},
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EventTypeWebhookOutputResponseDto"
+ "$ref": "#/components/schemas/GetBookingOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Event Types / Webhooks"]
- },
+ "tags": ["Bookings"]
+ }
+ },
+ "/v2/bookings/{bookingUid}/calendar-links": {
"get": {
- "operationId": "EventTypeWebhooksController_getEventTypeWebhooks",
- "summary": "Get all webhooks",
+ "operationId": "BookingsController_2024_08_13_getCalendarLinks",
+ "summary": "Get 'Add to Calendar' links for a booking",
+ "description": "Retrieve calendar links for a booking that can be used to add the event to various calendar services. Returns links for Google Calendar, Microsoft Office, Microsoft Outlook, and a downloadable ICS file.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note> \n ",
"parameters": [
{
- "name": "Authorization",
+ "name": "cal-api-version",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
"required": true,
"schema": {
- "type": "string"
+ "type": "string",
+ "default": "2024-08-13"
}
},
{
- "name": "eventTypeId",
+ "name": "bookingUid",
"required": true,
"in": "path",
"schema": {
- "type": "number"
- }
- },
- {
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
- "schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
+ "type": "string"
}
},
{
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "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": {
- "minimum": 0,
- "default": 0,
- "type": "number"
+ "type": "string"
}
}
],
@@ -10288,33 +10462,64 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EventTypeWebhooksOutputResponseDto"
+ "$ref": "#/components/schemas/CalendarLinksOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Event Types / Webhooks"]
- },
- "delete": {
- "operationId": "EventTypeWebhooksController_deleteAllEventTypeWebhooks",
- "summary": "Delete all webhooks",
+ "tags": ["Bookings"]
+ }
+ },
+ "/v2/bookings/{bookingUid}/references": {
+ "get": {
+ "operationId": "BookingsController_2024_08_13_getBookingReferences",
+ "summary": "Get booking references",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"parameters": [
{
- "name": "Authorization",
+ "name": "cal-api-version",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "Must be set to 2024-08-13. If not set to this value, the endpoint will default to an older version.",
"required": true,
"schema": {
- "type": "string"
+ "type": "string",
+ "default": "2024-08-13"
}
},
{
- "name": "eventTypeId",
+ "name": "bookingUid",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "type": "string"
+ }
+ },
+ {
+ "name": "type",
+ "required": false,
+ "in": "query",
+ "description": "Filter booking references by type",
+ "example": "google_calendar",
+ "schema": {
+ "enum": [
+ "google_calendar",
+ "office365_calendar",
+ "daily_video",
+ "google_video",
+ "office365_video",
+ "zoom_video"
+ ],
+ "type": "string"
+ }
+ },
+ {
+ "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"
}
}
],
@@ -10324,36 +10529,46 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteManyWebhooksOutputResponseDto"
+ "$ref": "#/components/schemas/BookingReferencesOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Event Types / Webhooks"]
+ "tags": ["Bookings"]
}
},
- "/v2/event-types/{eventTypeId}/webhooks/{webhookId}": {
- "patch": {
- "operationId": "EventTypeWebhooksController_updateEventTypeWebhook",
- "summary": "Update a webhook",
+ "/v2/bookings/{bookingUid}/guests": {
+ "post": {
+ "operationId": "BookingGuestsController_2024_08_13_addGuests",
+ "summary": "Add guests to an existing booking",
+ "description": "Add one or more guests to an existing booking.\n \n **Email Notifications:**\n When guests are added, the following notifications are sent (unless disabled by event type settings):\n \n - **Organizer & Team Members:** Receive an \"Add Guests\" notification email informing them that new guests have been added to the booking.\n \n - **New Guests:** Receive a \"Scheduled Event\" email with full booking details and calendar invite. If they have a phone number, they also receive an SMS notification.\n \n - **Existing Guests:** Receive an \"Add Guests\" notification email informing them that additional guests have been added to the booking.\n \n <Note>The cal-api-version header is required for this endpoint. Without it, the request will fail with a 404 error.</Note>\n ",
"parameters": [
{
- "name": "Authorization",
+ "name": "cal-api-version",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "description": "Must be set to 2024-08-13. This header is required as this endpoint does not exist in older API versions.",
"required": true,
"schema": {
"type": "string"
}
},
{
- "name": "webhookId",
+ "name": "bookingUid",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
+ },
+ {
+ "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": {
@@ -10361,7 +10576,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateWebhookInputDto"
+ "$ref": "#/components/schemas/AddGuestsInput_2024_08_13"
}
}
}
@@ -10372,46 +10587,39 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EventTypeWebhookOutputResponseDto"
+ "$ref": "#/components/schemas/AddGuestsOutput_2024_08_13"
}
}
}
}
},
- "tags": ["Event Types / Webhooks"]
- },
+ "tags": ["Bookings / Guests"]
+ }
+ },
+ "/v2/calendars/{calendar}/event/{eventUid}": {
"get": {
- "operationId": "EventTypeWebhooksController_getEventTypeWebhook",
- "summary": "Get a webhook",
+ "operationId": "CalUnifiedCalendarsController_getCalendarEventDetails",
+ "summary": "Get meeting details from calendar",
+ "description": "Returns detailed information about a meeting including attendance metrics",
"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": "calendar",
"required": true,
+ "in": "path",
"schema": {
+ "enum": ["google"],
"type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/EventTypeWebhookOutputResponseDto"
- }
- }
+ },
+ {
+ "name": "eventUid",
+ "required": true,
+ "in": "path",
+ "description": "The Google Calendar event ID. You can retrieve this by getting booking references from the following endpoints:\n\n- For team events: https://cal.com/docs/api-reference/v2/orgs-teams-bookings/get-booking-references-for-a-booking\n\n- For user events: https://cal.com/docs/api-reference/v2/bookings/get-booking-references-for-a-booking",
+ "schema": {
+ "type": "string"
}
- }
- },
- "tags": ["Event Types / Webhooks"]
- },
- "delete": {
- "operationId": "EventTypeWebhooksController_deleteEventTypeWebhook",
- "summary": "Delete a webhook",
- "parameters": [
+ },
{
"name": "Authorization",
"in": "header",
@@ -10428,26 +10636,37 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EventTypeWebhookOutputResponseDto"
+ "$ref": "#/components/schemas/GetUnifiedCalendarEventOutput"
}
}
}
}
},
- "tags": ["Event Types / Webhooks"]
+ "tags": ["Cal Unified Calendars"]
}
},
- "/v2/event-types/{eventTypeId}/private-links": {
- "post": {
- "operationId": "EventTypesPrivateLinksController_createPrivateLink",
- "summary": "Create a private link for an event type",
+ "/v2/calendars/{calendar}/events/{eventUid}": {
+ "patch": {
+ "operationId": "CalUnifiedCalendarsController_updateCalendarEvent",
+ "summary": "Update meeting details in calendar",
+ "description": "Updates event information in the specified calendar provider",
"parameters": [
{
- "name": "eventTypeId",
+ "name": "calendar",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "enum": ["google"],
+ "type": "string"
+ }
+ },
+ {
+ "name": "eventUid",
+ "required": true,
+ "in": "path",
+ "description": "The Google Calendar event ID. You can retrieve this by getting booking references from the following endpoints:\n\n- For team events: https://cal.com/docs/api-reference/v2/orgs-teams-bookings/get-booking-references-for-a-booking\n\n- For user events: https://cal.com/docs/api-reference/v2/bookings/get-booking-references-for-a-booking",
+ "schema": {
+ "type": "string"
}
},
{
@@ -10465,37 +10684,31 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreatePrivateLinkInput"
+ "$ref": "#/components/schemas/UpdateUnifiedCalendarEventInput"
}
}
}
},
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreatePrivateLinkOutput"
+ "$ref": "#/components/schemas/GetUnifiedCalendarEventOutput"
}
}
}
}
},
- "tags": ["Event Types Private Links"]
- },
- "get": {
- "operationId": "EventTypesPrivateLinksController_getPrivateLinks",
- "summary": "Get all private links for an event type",
+ "tags": ["Cal Unified Calendars"]
+ }
+ },
+ "/v2/calendars/ics-feed/save": {
+ "post": {
+ "operationId": "CalendarsController_createIcsFeed",
+ "summary": "Save an ICS feed",
"parameters": [
- {
- "name": "eventTypeId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
{
"name": "Authorization",
"in": "header",
@@ -10506,42 +10719,36 @@
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateIcsFeedInputDto"
+ }
+ }
+ }
+ },
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetPrivateLinksOutput"
+ "$ref": "#/components/schemas/CreateIcsFeedOutputResponseDto"
}
}
}
}
},
- "tags": ["Event Types Private Links"]
+ "tags": ["Calendars"]
}
},
- "/v2/event-types/{eventTypeId}/private-links/{linkId}": {
- "patch": {
- "operationId": "EventTypesPrivateLinksController_updatePrivateLink",
- "summary": "Update a private link for an event type",
+ "/v2/calendars/ics-feed/check": {
+ "get": {
+ "operationId": "CalendarsController_checkIcsFeed",
+ "summary": "Check an ICS feed",
"parameters": [
- {
- "name": "eventTypeId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "linkId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "string"
- }
- },
{
"name": "Authorization",
"in": "header",
@@ -10552,46 +10759,69 @@
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdatePrivateLinkBody"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdatePrivateLinkOutput"
+ "type": "object"
}
}
}
}
},
- "tags": ["Event Types Private Links"]
- },
- "delete": {
- "operationId": "EventTypesPrivateLinksController_deletePrivateLink",
- "summary": "Delete a private link for an event type",
+ "tags": ["Calendars"]
+ }
+ },
+ "/v2/calendars/busy-times": {
+ "get": {
+ "operationId": "CalendarsController_getBusyTimes",
+ "summary": "Get busy times",
+ "description": "Get busy times from a calendar. Example request URL is `https://api.cal.com/v2/calendars/busy-times?loggedInUsersTz=Europe%2FMadrid&dateFrom=2024-12-18&dateTo=2024-12-18&calendarsToLoad[0][credentialId]=135&calendarsToLoad[0][externalId]=skrauciz%40gmail.com`",
"parameters": [
{
- "name": "eventTypeId",
+ "name": "loggedInUsersTz",
+ "required": true,
+ "in": "query",
+ "description": "The timezone of the logged in user represented as a string",
+ "example": "America/New_York",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "dateFrom",
+ "required": false,
+ "in": "query",
+ "description": "The starting date for the busy times query",
+ "example": "2023-10-01",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "dateTo",
+ "required": false,
+ "in": "query",
+ "description": "The ending date for the busy times query",
+ "example": "2023-10-31",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "credentialId",
+ "in": "query",
"required": true,
- "in": "path",
"schema": {
"type": "number"
}
},
{
- "name": "linkId",
+ "name": "externalId",
+ "in": "query",
"required": true,
- "in": "path",
"schema": {
"type": "string"
}
@@ -10612,154 +10842,81 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeletePrivateLinkOutput"
+ "$ref": "#/components/schemas/GetBusyTimesOutput"
}
}
}
}
},
- "tags": ["Event Types Private Links"]
+ "tags": ["Calendars"]
}
},
- "/v2/organizations/{orgId}/organizations": {
- "post": {
- "operationId": "OrganizationsOrganizationsController_createOrganization",
- "summary": "Create an organization within an organization",
- "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.",
+ "/v2/calendars": {
+ "get": {
+ "operationId": "CalendarsController_getCalendars",
+ "summary": "Get all calendars",
"parameters": [
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-cal-client-id",
+ "name": "Authorization",
"in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "orgId",
+ "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/CreateOrganizationInput"
- }
- }
- }
- },
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateManagedOrganizationOutput"
+ "$ref": "#/components/schemas/ConnectedCalendarsOutput"
}
}
}
}
},
- "tags": ["Managed Orgs"]
- },
+ "tags": ["Calendars"]
+ }
+ },
+ "/v2/calendars/{calendar}/connect": {
"get": {
- "operationId": "OrganizationsOrganizationsController_getOrganizations",
- "summary": "Get all organizations within an organization",
- "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.",
+ "operationId": "CalendarsController_redirect",
+ "summary": "Get OAuth connect URL",
"parameters": [
{
- "name": "x-cal-secret-key",
+ "name": "Authorization",
+ "required": true,
"in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
+ "name": "calendar",
+ "required": true,
+ "in": "path",
"schema": {
+ "enum": ["office365", "google"],
"type": "string"
}
},
{
- "name": "orgId",
+ "name": "isDryRun",
"required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
- "schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
- "schema": {
- "minimum": 0,
- "default": 0,
- "type": "number"
- }
- },
- {
- "name": "slug",
- "required": false,
"in": "query",
- "example": "organization-slug",
- "description": "The slug of the managed organization",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "metadataKey",
- "required": false,
- "in": "query",
- "example": "metadata-key",
- "description": "The key of the metadata - it is case sensitive so provide exactly as stored. If you provide it then you must also provide metadataValue",
"schema": {
- "type": "string"
+ "type": "boolean"
}
},
{
- "name": "metadataValue",
+ "name": "redir",
"required": false,
"in": "query",
- "example": "metadata-value",
- "description": "The value of the metadata - it is case sensitive so provide exactly as stored. If you provide it then you must also provide metadataKey",
+ "description": "Redirect URL after successful calendar authorization.",
"schema": {
"type": "string"
}
@@ -10771,99 +10928,75 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetManagedOrganizationsOutput"
+ "type": "object"
}
}
}
}
},
- "tags": ["Managed Orgs"]
+ "tags": ["Calendars"]
}
},
- "/v2/organizations/{orgId}/organizations/{managedOrganizationId}": {
+ "/v2/calendars/{calendar}/save": {
"get": {
- "operationId": "OrganizationsOrganizationsController_getOrganization",
- "summary": "Get an organization within an organization",
- "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.",
+ "operationId": "CalendarsController_save",
+ "summary": "Save Google or Outlook calendar credentials",
"parameters": [
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "name": "state",
+ "required": true,
+ "in": "query",
"schema": {
"type": "string"
}
},
{
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
+ "name": "code",
+ "required": true,
+ "in": "query",
"schema": {
"type": "string"
}
},
{
- "name": "managedOrganizationId",
+ "name": "calendar",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "enum": ["office365", "google"],
+ "type": "string"
}
}
],
"responses": {
"200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetManagedOrganizationOutput"
- }
- }
- }
+ "description": ""
}
},
- "tags": ["Managed Orgs"]
- },
- "patch": {
- "operationId": "OrganizationsOrganizationsController_updateOrganization",
- "summary": "Update an organization within an organization",
- "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.",
+ "tags": ["Calendars"]
+ }
+ },
+ "/v2/calendars/{calendar}/credentials": {
+ "post": {
+ "operationId": "CalendarsController_syncCredentials",
+ "summary": "Save Apple calendar credentials",
"parameters": [
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-cal-client-id",
- "in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "orgId",
+ "name": "calendar",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "enum": ["apple"],
+ "type": "string"
}
},
{
- "name": "managedOrganizationId",
+ "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"
}
}
],
@@ -10872,54 +11005,40 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateOrganizationInput"
+ "$ref": "#/components/schemas/CreateCalendarCredentialsInput"
}
}
}
},
"responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetManagedOrganizationOutput"
- }
- }
- }
+ "201": {
+ "description": ""
}
},
- "tags": ["Managed Orgs"]
- },
- "delete": {
- "operationId": "OrganizationsOrganizationsController_deleteOrganization",
- "summary": "Delete an organization within an organization",
- "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.",
+ "tags": ["Calendars"]
+ }
+ },
+ "/v2/calendars/{calendar}/check": {
+ "get": {
+ "operationId": "CalendarsController_check",
+ "summary": "Check a calendar connection",
"parameters": [
{
- "name": "x-cal-secret-key",
- "in": "header",
- "description": "For platform customers - OAuth client secret key",
- "required": false,
+ "name": "calendar",
+ "required": true,
+ "in": "path",
"schema": {
+ "enum": ["apple", "google", "office365"],
"type": "string"
}
},
{
- "name": "x-cal-client-id",
+ "name": "Authorization",
"in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "managedOrganizationId",
+ "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"
}
}
],
@@ -10929,48 +11048,29 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetManagedOrganizationOutput"
+ "type": "object"
}
}
}
}
},
- "tags": ["Managed Orgs"]
+ "tags": ["Calendars"]
}
},
- "/v2/me": {
- "get": {
- "operationId": "MeController_getMe",
- "summary": "Get my profile",
+ "/v2/calendars/{calendar}/disconnect": {
+ "post": {
+ "operationId": "CalendarsController_deleteCalendarCredentials",
+ "summary": "Disconnect a 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",
+ "name": "calendar",
"required": true,
+ "in": "path",
"schema": {
+ "enum": ["apple", "google", "office365"],
"type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetMeOutput"
- }
- }
- }
- }
- },
- "tags": ["Me"]
- },
- "patch": {
- "operationId": "MeController_updateMe",
- "summary": "Update my profile",
- "parameters": [
+ },
{
"name": "Authorization",
"in": "header",
@@ -10986,7 +11086,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateManagedUserInput"
+ "$ref": "#/components/schemas/DeleteCalendarCredentialsInputBodyDto"
}
}
}
@@ -10997,63 +11097,91 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateMeOutput"
+ "$ref": "#/components/schemas/DeletedCalendarCredentialsOutputResponseDto"
}
}
}
}
},
- "tags": ["Me"]
+ "tags": ["Calendars"]
}
},
- "/v2/oauth-clients": {
+ "/v2/conferencing/{app}/connect": {
"post": {
- "operationId": "OAuthClientsController_createOAuthClient",
- "summary": "Create an OAuth client",
+ "operationId": "ConferencingController_connect",
+ "summary": "Connect your conferencing application",
"parameters": [
+ {
+ "name": "app",
+ "required": true,
+ "in": "path",
+ "description": "Conferencing application type",
+ "schema": {
+ "enum": ["google-meet"],
+ "type": "string"
+ }
+ },
{
"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/CreateOAuthClientInput"
- }
- }
- }
- },
"responses": {
- "201": {
- "description": "Create an OAuth client",
+ "200": {
+ "description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateOAuthClientResponseDto"
+ "$ref": "#/components/schemas/ConferencingAppOutputResponseDto"
}
}
}
}
},
- "tags": ["OAuth Clients"]
- },
+ "tags": ["Conferencing"]
+ }
+ },
+ "/v2/conferencing/{app}/oauth/auth-url": {
"get": {
- "operationId": "OAuthClientsController_getOAuthClients",
- "summary": "Get all OAuth clients",
+ "operationId": "ConferencingController_redirect",
+ "summary": "Get OAuth conferencing app auth URL",
"parameters": [
{
"name": "Authorization",
+ "required": true,
"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",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "app",
+ "required": true,
+ "in": "path",
+ "description": "Conferencing application type",
+ "schema": {
+ "enum": ["zoom", "msteams"],
+ "type": "string"
+ }
+ },
+ {
+ "name": "returnTo",
+ "required": true,
+ "in": "query",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "onErrorReturnTo",
"required": true,
+ "in": "query",
"schema": {
"type": "string"
}
@@ -11065,33 +11193,42 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetOAuthClientsResponseDto"
+ "$ref": "#/components/schemas/GetConferencingAppsOauthUrlResponseDto"
}
}
}
}
},
- "tags": ["OAuth Clients"]
+ "tags": ["Conferencing"]
}
},
- "/v2/oauth-clients/{clientId}": {
+ "/v2/conferencing/{app}/oauth/callback": {
"get": {
- "operationId": "OAuthClientsController_getOAuthClientById",
- "summary": "Get an OAuth client",
+ "operationId": "ConferencingController_save",
+ "summary": "Conferencing app OAuth callback",
"parameters": [
{
- "name": "Authorization",
- "in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "name": "state",
"required": true,
+ "in": "query",
"schema": {
"type": "string"
}
},
{
- "name": "clientId",
+ "name": "app",
"required": true,
"in": "path",
+ "description": "Conferencing application type",
+ "schema": {
+ "enum": ["zoom", "msteams"],
+ "type": "string"
+ }
+ },
+ {
+ "name": "code",
+ "required": true,
+ "in": "query",
"schema": {
"type": "string"
}
@@ -11099,81 +11236,62 @@
],
"responses": {
"200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GetOAuthClientResponseDto"
- }
- }
- }
+ "description": ""
}
},
- "tags": ["OAuth Clients"]
- },
- "patch": {
- "operationId": "OAuthClientsController_updateOAuthClient",
- "summary": "Update an OAuth client",
+ "tags": ["Conferencing"]
+ }
+ },
+ "/v2/conferencing": {
+ "get": {
+ "operationId": "ConferencingController_listInstalledConferencingApps",
+ "summary": "List your conferencing applications",
"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": "clientId",
+ "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"
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateOAuthClientInput"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetOAuthClientResponseDto"
+ "$ref": "#/components/schemas/ConferencingAppsOutputResponseDto"
}
}
}
}
},
- "tags": ["OAuth Clients"]
- },
- "delete": {
- "operationId": "OAuthClientsController_deleteOAuthClient",
- "summary": "Delete an OAuth client",
+ "tags": ["Conferencing"]
+ }
+ },
+ "/v2/conferencing/{app}/default": {
+ "post": {
+ "operationId": "ConferencingController_default",
+ "summary": "Set your default conferencing application",
"parameters": [
{
- "name": "Authorization",
- "in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "name": "app",
"required": true,
+ "in": "path",
+ "description": "Conferencing application type",
"schema": {
+ "enum": ["google-meet", "zoom", "msteams", "daily-video"],
"type": "string"
}
},
{
- "name": "clientId",
+ "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"
}
@@ -11185,20 +11303,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetOAuthClientResponseDto"
+ "$ref": "#/components/schemas/SetDefaultConferencingAppOutputResponseDto"
}
}
}
}
},
- "tags": ["OAuth Clients"]
+ "tags": ["Conferencing"]
}
},
- "/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",
+ "/v2/conferencing/default": {
+ "get": {
+ "operationId": "ConferencingController_getDefault",
+ "summary": "Get your default conferencing application",
"parameters": [
{
"name": "Authorization",
@@ -11210,37 +11327,36 @@
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RequestEmailVerificationInput"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RequestEmailVerificationOutput"
+ "$ref": "#/components/schemas/GetDefaultConferencingAppOutputResponseDto"
}
}
}
}
},
- "tags": ["Organization Team Verified Resources"]
+ "tags": ["Conferencing"]
}
},
- "/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",
+ "/v2/conferencing/{app}/disconnect": {
+ "delete": {
+ "operationId": "ConferencingController_disconnect",
+ "summary": "Disconnect your conferencing application",
"parameters": [
+ {
+ "name": "app",
+ "required": true,
+ "in": "path",
+ "description": "Conferencing application type",
+ "schema": {
+ "enum": ["google-meet", "zoom", "msteams"],
+ "type": "string"
+ }
+ },
{
"name": "Authorization",
"in": "header",
@@ -11251,45 +11367,26 @@
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RequestPhoneVerificationInput"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RequestPhoneVerificationOutput"
+ "$ref": "#/components/schemas/DisconnectConferencingAppOutputResponseDto"
}
}
}
}
},
- "tags": ["Organization Team Verified Resources"]
+ "tags": ["Conferencing"]
}
},
- "/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",
+ "/v2/destination-calendars": {
+ "put": {
+ "operationId": "DestinationCalendarsController_updateDestinationCalendars",
+ "summary": "Update destination calendars",
"parameters": [
- {
- "name": "teamId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
{
"name": "Authorization",
"in": "header",
@@ -11305,7 +11402,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/VerifyEmailInput"
+ "$ref": "#/components/schemas/DestinationCalendarsInputBodyDto"
}
}
}
@@ -11316,27 +11413,29 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamVerifiedEmailOutput"
+ "$ref": "#/components/schemas/DestinationCalendarsOutputResponseDto"
}
}
}
}
},
- "tags": ["Organization Team Verified Resources"]
+ "tags": ["Destination Calendars"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/verification-code/verify": {
+ "/v2/event-types": {
"post": {
- "operationId": "OrgTeamsVerifiedResourcesController_verifyPhoneNumber",
- "summary": "Verify a phone number for an org team",
- "description": "Use code to verify a phone number",
+ "operationId": "EventTypesController_2024_06_14_createEventType",
+ "summary": "Create an event type",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"parameters": [
{
- "name": "teamId",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-14. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string",
+ "default": "2024-06-14"
}
},
{
@@ -11354,61 +11453,82 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/VerifyPhoneInput"
+ "$ref": "#/components/schemas/CreateEventTypeInput_2024_06_14"
}
}
}
},
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"
+ "$ref": "#/components/schemas/CreateEventTypeOutput_2024_06_14"
}
}
}
}
},
- "tags": ["Organization Team Verified Resources"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails": {
+ "tags": ["Event Types"]
+ },
"get": {
- "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedEmails",
- "summary": "Get list of verified emails of an org team",
+ "operationId": "EventTypesController_2024_06_14_getEventTypes",
+ "summary": "Get all event types",
+ "description": "Hidden event types are returned only if authentication is provided and it belongs to the event type owner.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
- "name": "teamId",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-14. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string",
+ "default": "2024-06-14"
}
},
{
- "name": "take",
+ "name": "username",
"required": false,
"in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
+ "description": "The username of the user to get event types for. If only username provided will get all event types.",
"schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
+ "type": "string"
}
},
{
- "name": "skip",
+ "name": "eventSlug",
"required": false,
"in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "description": "Slug of event type to return. Notably, if eventSlug is provided then username must be provided too, because multiple users can have event with same slug.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "usernames",
+ "required": false,
+ "in": "query",
+ "description": "Get dynamic event type for multiple usernames separated by comma. e.g `usernames=alice,bob`",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "orgSlug",
+ "required": false,
+ "in": "query",
+ "description": "slug of the user's organization if he is in one, orgId is not required if using this parameter",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "orgId",
+ "required": false,
+ "in": "query",
+ "description": "ID of the organization of the user you want the get the event-types of, orgSlug is not needed when using this parameter",
"schema": {
- "minimum": 0,
- "default": 0,
"type": "number"
}
},
@@ -11416,7 +11536,25 @@
"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,
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
@@ -11428,51 +11566,37 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamVerifiedEmailsOutput"
+ "$ref": "#/components/schemas/GetEventTypesOutput_2024_06_14"
}
}
}
}
},
- "tags": ["Organization Team Verified Resources"]
+ "tags": ["Event Types"]
}
},
- "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones": {
+ "/v2/event-types/{eventTypeId}": {
"get": {
- "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedPhoneNumbers",
- "summary": "Get list of verified phone numbers of an org team",
+ "operationId": "EventTypesController_2024_06_14_getEventTypeById",
+ "summary": "Get an event type",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"parameters": [
{
- "name": "teamId",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-14. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
"schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
+ "type": "string",
+ "default": "2024-06-14"
}
},
{
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "name": "eventTypeId",
+ "required": true,
+ "in": "path",
"schema": {
- "minimum": 0,
- "default": 0,
- "type": "number"
+ "type": "string"
}
},
{
@@ -11491,30 +11615,31 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamVerifiedPhonesOutput"
+ "$ref": "#/components/schemas/GetEventTypeOutput_2024_06_14"
}
}
}
}
},
- "tags": ["Organization Team Verified Resources"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/{id}": {
- "get": {
- "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedEmailById",
- "summary": "Get verified email of an org team by id",
+ "tags": ["Event Types"]
+ },
+ "patch": {
+ "operationId": "EventTypesController_2024_06_14_updateEventType",
+ "summary": "Update an event type",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"parameters": [
{
- "name": "id",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-14. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string",
+ "default": "2024-06-14"
}
},
{
- "name": "teamId",
+ "name": "eventTypeId",
"required": true,
"in": "path",
"schema": {
@@ -11531,36 +11656,47 @@
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateEventTypeInput_2024_06_14"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamVerifiedEmailOutput"
+ "$ref": "#/components/schemas/UpdateEventTypeOutput_2024_06_14"
}
}
}
}
},
- "tags": ["Organization Team Verified Resources"]
- }
- },
- "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/{id}": {
- "get": {
- "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedPhoneById",
- "summary": "Get verified phone number of an org team by id",
+ "tags": ["Event Types"]
+ },
+ "delete": {
+ "operationId": "EventTypesController_2024_06_14_deleteEventType",
+ "summary": "Delete an event type",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"parameters": [
{
- "name": "teamId",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-14. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string",
+ "default": "2024-06-14"
}
},
{
- "name": "id",
+ "name": "eventTypeId",
"required": true,
"in": "path",
"schema": {
@@ -11583,97 +11719,142 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"
+ "$ref": "#/components/schemas/DeleteEventTypeOutput_2024_06_14"
}
}
}
}
},
- "tags": ["Organization Team Verified Resources"]
+ "tags": ["Event Types"]
}
},
- "/v2/routing-forms/{routingFormId}/calculate-slots": {
+ "/v2/event-types/{eventTypeId}/webhooks": {
"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.",
+ "operationId": "EventTypeWebhooksController_createEventTypeWebhook",
+ "summary": "Create a webhook",
"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": "start",
+ "name": "eventTypeId",
"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",
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
- },
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateWebhookInputDto"
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/EventTypeWebhookOutputResponseDto"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Event Types / Webhooks"]
+ },
+ "get": {
+ "operationId": "EventTypeWebhooksController_getEventTypeWebhooks",
+ "summary": "Get all webhooks",
+ "parameters": [
{
- "name": "end",
+ "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",
- "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",
+ "name": "eventTypeId",
+ "required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "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": "Maximum number of items to return",
+ "example": 25,
"schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
"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": "Number of items to skip",
+ "example": 0,
"schema": {
- "enum": ["range", "time"],
- "type": "string"
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
}
- },
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/EventTypeWebhooksOutputResponseDto"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Event Types / Webhooks"]
+ },
+ "delete": {
+ "operationId": "EventTypeWebhooksController_deleteAllEventTypeWebhooks",
+ "summary": "Delete all webhooks",
+ "parameters": [
{
- "name": "bookingUidToReschedule",
- "required": false,
- "in": "query",
- "description": "The unique identifier of the booking being rescheduled. When provided will ensure that the original booking time appears within the returned available slots when rescheduling.",
- "example": "abc123def456",
+ "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": "routingFormId",
+ "name": "eventTypeId",
"required": true,
"in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
}
],
@@ -11683,20 +11864,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ResponseSlotsOutput"
+ "$ref": "#/components/schemas/DeleteManyWebhooksOutputResponseDto"
}
}
}
}
},
- "tags": ["Routing forms"]
+ "tags": ["Event Types / Webhooks"]
}
},
- "/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\n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "/v2/event-types/{eventTypeId}/webhooks/{webhookId}": {
+ "patch": {
+ "operationId": "EventTypeWebhooksController_updateEventTypeWebhook",
+ "summary": "Update a webhook",
"parameters": [
{
"name": "Authorization",
@@ -11708,13 +11888,11 @@
}
},
{
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
+ "name": "webhookId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string",
- "default": "2024-06-11"
+ "type": "string"
}
}
],
@@ -11723,29 +11901,28 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateScheduleInput_2024_06_11"
+ "$ref": "#/components/schemas/UpdateWebhookInputDto"
}
}
}
},
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateScheduleOutput_2024_06_11"
+ "$ref": "#/components/schemas/EventTypeWebhookOutputResponseDto"
}
}
}
}
},
- "tags": ["Schedules"]
+ "tags": ["Event Types / Webhooks"]
},
"get": {
- "operationId": "SchedulesController_2024_06_11_getSchedules",
- "summary": "Get all schedules",
- "description": "Get all schedules of the authenticated user.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "operationId": "EventTypeWebhooksController_getEventTypeWebhook",
+ "summary": "Get a webhook",
"parameters": [
{
"name": "Authorization",
@@ -11755,16 +11932,6 @@
"schema": {
"type": "string"
}
- },
- {
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-06-11"
- }
}
],
"responses": {
@@ -11773,20 +11940,17 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
+ "$ref": "#/components/schemas/EventTypeWebhookOutputResponseDto"
}
}
}
}
},
- "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.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "tags": ["Event Types / Webhooks"]
+ },
+ "delete": {
+ "operationId": "EventTypeWebhooksController_deleteEventTypeWebhook",
+ "summary": "Delete a webhook",
"parameters": [
{
"name": "Authorization",
@@ -11796,16 +11960,6 @@
"schema": {
"type": "string"
}
- },
- {
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-06-11"
- }
}
],
"responses": {
@@ -11814,21 +11968,28 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetDefaultScheduleOutput_2024_06_11"
+ "$ref": "#/components/schemas/EventTypeWebhookOutputResponseDto"
}
}
}
}
},
- "tags": ["Schedules"]
+ "tags": ["Event Types / Webhooks"]
}
},
- "/v2/schedules/{scheduleId}": {
- "get": {
- "operationId": "SchedulesController_2024_06_11_getSchedule",
- "summary": "Get a schedule",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "/v2/event-types/{eventTypeId}/private-links": {
+ "post": {
+ "operationId": "EventTypesPrivateLinksController_createPrivateLink",
+ "summary": "Create a private link for an event type",
"parameters": [
+ {
+ "name": "eventTypeId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
{
"name": "Authorization",
"in": "header",
@@ -11837,23 +11998,51 @@
"schema": {
"type": "string"
}
- },
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreatePrivateLinkInput"
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreatePrivateLinkOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Event Types Private Links"]
+ },
+ "get": {
+ "operationId": "EventTypesPrivateLinksController_getPrivateLinks",
+ "summary": "Get all private links for an event type",
+ "parameters": [
{
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
+ "name": "eventTypeId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string",
- "default": "2024-06-11"
+ "type": "number"
}
},
{
- "name": "scheduleId",
+ "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"
}
}
],
@@ -11863,42 +12052,41 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetScheduleOutput_2024_06_11"
+ "$ref": "#/components/schemas/GetPrivateLinksOutput"
}
}
}
}
},
- "tags": ["Schedules"]
- },
+ "tags": ["Event Types Private Links"]
+ }
+ },
+ "/v2/event-types/{eventTypeId}/private-links/{linkId}": {
"patch": {
- "operationId": "SchedulesController_2024_06_11_updateSchedule",
- "summary": "Update a schedule",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "operationId": "EventTypesPrivateLinksController_updatePrivateLink",
+ "summary": "Update a private link for an event type",
"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": "eventTypeId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
+ "name": "linkId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string",
- "default": "2024-06-11"
+ "type": "string"
}
},
{
- "name": "scheduleId",
+ "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"
}
@@ -11909,7 +12097,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateScheduleInput_2024_06_11"
+ "$ref": "#/components/schemas/UpdatePrivateLinkBody"
}
}
}
@@ -11920,44 +12108,41 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateScheduleOutput_2024_06_11"
+ "$ref": "#/components/schemas/UpdatePrivateLinkOutput"
}
}
}
}
},
- "tags": ["Schedules"]
+ "tags": ["Event Types Private Links"]
},
"delete": {
- "operationId": "SchedulesController_2024_06_11_deleteSchedule",
- "summary": "Delete a schedule",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "operationId": "EventTypesPrivateLinksController_deletePrivateLink",
+ "summary": "Delete a private link for an event type",
"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": "eventTypeId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
},
{
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
+ "name": "linkId",
"required": true,
+ "in": "path",
"schema": {
- "type": "string",
- "default": "2024-06-11"
+ "type": "string"
}
},
{
- "name": "scheduleId",
+ "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"
}
}
],
@@ -11967,28 +12152,46 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteScheduleOutput_2024_06_11"
+ "$ref": "#/components/schemas/DeletePrivateLinkOutput"
}
}
}
}
},
- "tags": ["Schedules"]
+ "tags": ["Event Types Private Links"]
}
},
- "/v2/selected-calendars": {
+ "/v2/organizations/{orgId}/organizations": {
"post": {
- "operationId": "SelectedCalendarsController_addSelectedCalendar",
- "summary": "Add a selected calendar",
+ "operationId": "OrganizationsOrganizationsController_createOrganization",
+ "summary": "Create an organization within an organization",
+ "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.",
"parameters": [
{
- "name": "Authorization",
+ "name": "x-cal-secret-key",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
- "required": true,
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
+ },
+ {
+ "name": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
}
],
"requestBody": {
@@ -11996,7 +12199,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/SelectedCalendarsInputDto"
+ "$ref": "#/components/schemas/CreateOrganizationInput"
}
}
}
@@ -12007,55 +12210,96 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"
+ "$ref": "#/components/schemas/CreateManagedOrganizationOutput"
}
}
}
}
},
- "tags": ["Selected Calendars"]
+ "tags": ["Managed Orgs"]
},
- "delete": {
- "operationId": "SelectedCalendarsController_deleteSelectedCalendar",
- "summary": "Delete a selected calendar",
+ "get": {
+ "operationId": "OrganizationsOrganizationsController_getOrganizations",
+ "summary": "Get all organizations within an organization",
+ "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.",
"parameters": [
{
- "name": "Authorization",
+ "name": "x-cal-secret-key",
"in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
- "required": true,
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "integration",
- "required": true,
- "in": "query",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
},
{
- "name": "externalId",
+ "name": "orgId",
"required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
+ }
+ },
+ {
+ "name": "slug",
+ "required": false,
"in": "query",
+ "example": "organization-slug",
+ "description": "The slug of the managed organization",
"schema": {
"type": "string"
}
},
{
- "name": "credentialId",
- "required": true,
+ "name": "metadataKey",
+ "required": false,
"in": "query",
+ "example": "metadata-key",
+ "description": "The key of the metadata - it is case sensitive so provide exactly as stored. If you provide it then you must also provide metadataValue",
"schema": {
"type": "string"
}
},
{
- "name": "delegationCredentialId",
+ "name": "metadataValue",
"required": false,
"in": "query",
+ "example": "metadata-value",
+ "description": "The value of the metadata - it is case sensitive so provide exactly as stored. If you provide it then you must also provide metadataKey",
"schema": {
"type": "string"
}
@@ -12067,248 +12311,211 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"
+ "$ref": "#/components/schemas/GetManagedOrganizationsOutput"
}
}
}
}
},
- "tags": ["Selected Calendars"]
+ "tags": ["Managed Orgs"]
}
},
- "/v2/slots": {
+ "/v2/organizations/{orgId}/organizations/{managedOrganizationId}": {
"get": {
- "operationId": "SlotsController_2024_09_04_getAvailableSlots",
- "summary": "Get available time slots for an event type",
- "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 - format: 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 - bookingUidToReschedule: When rescheduling an existing booking, provide the booking's unique identifier to exclude its time slot from busy time calculations. This ensures the original booking time appears as available for rescheduling.\n\n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
+ "operationId": "OrganizationsOrganizationsController_getOrganization",
+ "summary": "Get an organization within an organization",
+ "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.",
"parameters": [
{
- "name": "cal-api-version",
+ "name": "x-cal-secret-key",
"in": "header",
- "description": "Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.",
- "required": true,
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
"schema": {
- "type": "string",
- "default": "2024-09-04"
+ "type": "string"
}
},
{
- "name": "bookingUidToReschedule",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"required": false,
- "in": "query",
- "description": "The unique identifier of the booking being rescheduled. When provided will ensure that the original booking time appears within the returned available slots when rescheduling.",
- "example": "abc123def456",
- "schema": {}
+ "schema": {
+ "type": "string"
+ }
},
{
- "name": "start",
+ "name": "managedOrganizationId",
"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": {}
- },
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetManagedOrganizationOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Managed Orgs"]
+ },
+ "patch": {
+ "operationId": "OrganizationsOrganizationsController_updateOrganization",
+ "summary": "Update an organization within an organization",
+ "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.",
+ "parameters": [
{
- "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": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
},
{
- "name": "organizationSlug",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"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": {}
+ "schema": {
+ "type": "string"
+ }
},
{
- "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": "orgId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
},
{
- "name": "username",
+ "name": "managedOrganizationId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateOrganizationInput"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetManagedOrganizationOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Managed Orgs"]
+ },
+ "delete": {
+ "operationId": "OrganizationsOrganizationsController_deleteOrganization",
+ "summary": "Delete an organization within an organization",
+ "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.",
+ "parameters": [
+ {
+ "name": "x-cal-secret-key",
+ "in": "header",
+ "description": "For platform customers - OAuth client secret key",
"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": {}
+ "schema": {
+ "type": "string"
+ }
},
{
- "name": "eventTypeSlug",
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
"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": {}
+ "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": "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": "format",
- "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": {}
+ "name": "managedOrganizationId",
+ "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",
- "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",
- "items": {
- "type": "object",
- "properties": {
- "start": {
- "type": "string"
- },
- "end": {
- "type": "string"
- }
- }
- }
- },
- "example": {
- "status": "success",
- "data": {
- "2050-09-05": [
- {
- "start": "2050-09-05T09:00:00.000+02:00",
- "end": "2050-09-05T10:00:00.000+02:00"
- },
- {
- "start": "2050-09-05T10:00:00.000+02:00",
- "end": "2050-09-05T11:00:00.000+02:00"
- }
- ],
- "2050-09-06": [
- {
- "start": "2050-09-06T09:00:00.000+02:00",
- "end": "2050-09-06T10:00:00.000+02:00"
- },
- {
- "start": "2050-09-06T10:00:00.000+02:00",
- "end": "2050-09-06T11:00:00.000+02:00"
- }
- ]
- }
- }
- }
- ]
+ "$ref": "#/components/schemas/GetManagedOrganizationOutput"
}
}
}
}
},
- "tags": ["Slots"]
+ "tags": ["Managed Orgs"]
}
},
- "/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).\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note> \n ",
+ "/v2/me": {
+ "get": {
+ "operationId": "MeController_getMe",
+ "summary": "Get my profile",
"parameters": [
- {
- "name": "cal-api-version",
- "in": "header",
- "description": "Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.",
- "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,
+ "required": true,
"schema": {
"type": "string"
}
- },
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetMeOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Me"]
+ },
+ "patch": {
+ "operationId": "MeController_updateMe",
+ "summary": "Update my profile",
+ "parameters": [
{
- "name": "x-cal-client-id",
+ "name": "Authorization",
"in": "header",
- "description": "For platform customers - OAuth client ID",
- "required": false,
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "required": true,
"schema": {
"type": "string"
}
@@ -12319,130 +12526,110 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ReserveSlotInput_2024_09_04"
+ "$ref": "#/components/schemas/UpdateManagedUserInput"
}
}
}
},
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"
+ "$ref": "#/components/schemas/UpdateMeOutput"
}
}
}
}
},
- "tags": ["Slots"]
+ "tags": ["Me"]
}
},
- "/v2/slots/reservations/{uid}": {
- "get": {
- "operationId": "SlotsController_2024_09_04_getReservedSlot",
- "summary": "Get reserved slot",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "/v2/oauth-clients": {
+ "post": {
+ "operationId": "OAuthClientsController_createOAuthClient",
+ "summary": "Create an OAuth client",
"parameters": [
{
- "name": "cal-api-version",
+ "name": "Authorization",
"in": "header",
- "description": "Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-09-04"
- }
- },
- {
- "name": "uid",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": true,
- "in": "path",
"schema": {
"type": "string"
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateOAuthClientInput"
+ }
+ }
+ }
+ },
"responses": {
- "200": {
- "description": "",
+ "201": {
+ "description": "Create an OAuth client",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetReservedSlotOutput_2024_09_04"
+ "$ref": "#/components/schemas/CreateOAuthClientResponseDto"
}
}
}
}
},
- "tags": ["Slots"]
+ "tags": ["OAuth Clients"]
},
- "patch": {
- "operationId": "SlotsController_2024_09_04_updateReservedSlot",
- "summary": "Update a reserved slot",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
+ "get": {
+ "operationId": "OAuthClientsController_getOAuthClients",
+ "summary": "Get all OAuth clients",
"parameters": [
{
- "name": "cal-api-version",
+ "name": "Authorization",
"in": "header",
- "description": "Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.",
- "required": true,
- "schema": {
- "type": "string",
- "default": "2024-09-04"
- }
- },
- {
- "name": "uid",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"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"
+ "$ref": "#/components/schemas/GetOAuthClientsResponseDto"
}
}
}
}
},
- "tags": ["Slots"]
- },
- "delete": {
- "operationId": "SlotsController_2024_09_04_deleteReservedSlot",
- "summary": "Delete a reserved slot",
- "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
- "parameters": [
+ "tags": ["OAuth Clients"]
+ }
+ },
+ "/v2/oauth-clients/{clientId}": {
+ "get": {
+ "operationId": "OAuthClientsController_getOAuthClientById",
+ "summary": "Get an OAuth client",
+ "parameters": [
{
- "name": "cal-api-version",
+ "name": "Authorization",
"in": "header",
- "description": "Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": true,
"schema": {
- "type": "string",
- "default": "2024-09-04"
+ "type": "string"
}
},
{
- "name": "uid",
+ "name": "clientId",
"required": true,
"in": "path",
"schema": {
@@ -12456,65 +12643,77 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "example": {
- "status": "success"
- }
+ "$ref": "#/components/schemas/GetOAuthClientResponseDto"
}
}
}
}
},
- "tags": ["Slots"]
- }
- },
- "/v2/stripe/connect": {
- "get": {
- "operationId": "StripeController_redirect",
- "summary": "Get Stripe connect URL",
+ "tags": ["OAuth Clients"]
+ },
+ "patch": {
+ "operationId": "OAuthClientsController_updateOAuthClient",
+ "summary": "Update an OAuth client",
"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",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "clientId",
+ "required": true,
+ "in": "path",
"schema": {
"type": "string"
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateOAuthClientInput"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/StripConnectOutputResponseDto"
+ "$ref": "#/components/schemas/GetOAuthClientResponseDto"
}
}
}
}
},
- "tags": ["Stripe"]
- }
- },
- "/v2/stripe/save": {
- "get": {
- "operationId": "StripeController_save",
- "summary": "Save Stripe credentials",
+ "tags": ["OAuth Clients"]
+ },
+ "delete": {
+ "operationId": "OAuthClientsController_deleteOAuthClient",
+ "summary": "Delete an OAuth client",
"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": "clientId",
"required": true,
- "in": "query",
+ "in": "path",
"schema": {
"type": "string"
}
@@ -12526,19 +12725,20 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"
+ "$ref": "#/components/schemas/GetOAuthClientResponseDto"
}
}
}
}
},
- "tags": ["Stripe"]
+ "tags": ["OAuth Clients"]
}
},
- "/v2/stripe/check": {
- "get": {
- "operationId": "StripeController_check",
- "summary": "Check Stripe connection",
+ "/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",
@@ -12550,30 +12750,41 @@
}
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RequestEmailVerificationInput"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"
+ "$ref": "#/components/schemas/RequestEmailVerificationOutput"
}
}
}
}
},
- "tags": ["Stripe"]
+ "tags": ["Organization Team Verified Resources"]
}
},
- "/v2/teams": {
+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/verification-code/request": {
"post": {
- "operationId": "TeamsController_createTeam",
- "summary": "Create a team",
+ "operationId": "OrgTeamsVerifiedResourcesController_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"
@@ -12585,68 +12796,32 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateTeamInput"
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreateTeamOutput"
- }
+ "$ref": "#/components/schemas/RequestPhoneVerificationInput"
}
}
}
},
- "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"
+ "$ref": "#/components/schemas/RequestPhoneVerificationOutput"
}
}
}
}
},
- "tags": ["Teams"]
+ "tags": ["Organization Team Verified Resources"]
}
},
- "/v2/teams/{teamId}": {
- "get": {
- "operationId": "TeamsController_getTeam",
- "summary": "Get a team",
+ "/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": "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,
@@ -12654,42 +12829,15 @@
"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_",
+ "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": {
@@ -12697,66 +12845,31 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateOrgTeamDto"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateTeamOutput"
- }
+ "$ref": "#/components/schemas/VerifyEmailInput"
}
}
}
},
- "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"
+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"
}
}
}
}
},
- "tags": ["Teams"]
+ "tags": ["Organization Team Verified Resources"]
}
},
- "/v2/teams/{teamId}/event-types": {
+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/verification-code/verify": {
"post": {
- "operationId": "TeamsEventTypesController_createTeamEventType",
- "summary": "Create an event type",
+ "operationId": "OrgTeamsVerifiedResourcesController_verifyPhoneNumber",
+ "summary": "Verify a phone number for an org team",
+ "description": "Use code to verify a phone number",
"parameters": [
{
"name": "teamId",
@@ -12769,7 +12882,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"
@@ -12781,28 +12894,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": ["Organization Team Verified Resources"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails": {
"get": {
- "operationId": "TeamsEventTypesController_getTeamEventTypes",
- "summary": "Get a team event type",
+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedEmails",
+ "summary": "Get list of verified emails of an org team",
"parameters": [
{
"name": "teamId",
@@ -12813,22 +12928,38 @@
}
},
{
- "name": "eventSlug",
+ "name": "take",
"required": false,
"in": "query",
- "description": "Slug of team event type to return.",
+ "description": "Maximum number of items to return",
+ "example": 25,
"schema": {
- "type": "string"
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "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": "Number of items to skip",
+ "example": 0,
"schema": {
+ "minimum": 0,
+ "default": 0,
"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": {
@@ -12837,19 +12968,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetTeamEventTypesOutput"
+ "$ref": "#/components/schemas/TeamVerifiedEmailsOutput"
}
}
}
}
},
- "tags": ["Teams / Event Types"]
+ "tags": ["Organization Team Verified Resources"]
}
},
- "/v2/teams/{teamId}/event-types/{eventTypeId}": {
+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones": {
"get": {
- "operationId": "TeamsEventTypesController_getTeamEventType",
- "summary": "Get an event type",
+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedPhoneNumbers",
+ "summary": "Get list of verified phone numbers of an org team",
"parameters": [
{
"name": "teamId",
@@ -12860,17 +12991,34 @@
}
},
{
- "name": "eventTypeId",
- "required": true,
- "in": "path",
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
"schema": {
+ "minimum": 0,
+ "default": 0,
"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"
@@ -12883,20 +13031,22 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetTeamEventTypeOutput"
+ "$ref": "#/components/schemas/TeamVerifiedPhonesOutput"
}
}
}
}
},
- "tags": ["Teams / Event Types"]
- },
- "patch": {
- "operationId": "TeamsEventTypesController_updateTeamEventType",
- "summary": "Update a team event type",
+ "tags": ["Organization Team Verified Resources"]
+ }
+ },
+ "/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": "teamId",
+ "name": "id",
"required": true,
"in": "path",
"schema": {
@@ -12904,7 +13054,7 @@
}
},
{
- "name": "eventTypeId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -12914,40 +13064,32 @@
{
"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/UpdateTeamEventTypeInput_2024_06_14"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateTeamEventTypeOutput"
+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"
}
}
}
}
},
- "tags": ["Teams / Event Types"]
- },
- "delete": {
- "operationId": "TeamsEventTypesController_deleteTeamEventType",
- "summary": "Delete a team event type",
+ "tags": ["Organization Team Verified Resources"]
+ }
+ },
+ "/v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/{id}": {
+ "get": {
+ "operationId": "OrgTeamsVerifiedResourcesController_getVerifiedPhoneById",
+ "summary": "Get verified phone number of an org team by id",
"parameters": [
{
"name": "teamId",
@@ -12958,7 +13100,7 @@
}
},
{
- "name": "eventTypeId",
+ "name": "id",
"required": true,
"in": "path",
"schema": {
@@ -12968,7 +13110,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"
@@ -12981,91 +13123,138 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteTeamEventTypeOutput"
+ "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"
}
}
}
}
},
- "tags": ["Teams / Event Types"]
+ "tags": ["Organization Team Verified Resources"]
}
},
- "/v2/teams/{teamId}/event-types/{eventTypeId}/create-phone-call": {
+ "/v2/routing-forms/{routingFormId}/calculate-slots": {
"post": {
- "operationId": "TeamsEventTypesController_createPhoneCall",
- "summary": "Create a phone call",
+ "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": "eventTypeId",
+ "name": "Authorization",
+ "in": "header",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "orgId",
+ "name": "start",
"required": true,
- "in": "path",
+ "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"
+ }
+ },
+ {
+ "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": {
+ "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": "Authorization",
- "in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "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": "bookingUidToReschedule",
+ "required": false,
+ "in": "query",
+ "description": "The unique identifier of the booking being rescheduled. When provided will ensure that the original booking time appears within the returned available slots when rescheduling.",
+ "example": "abc123def456",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "routingFormId",
"required": true,
+ "in": "path",
"schema": {
"type": "string"
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreatePhoneCallInput"
- }
- }
- }
- },
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreatePhoneCallOutput"
+ "$ref": "#/components/schemas/ResponseSlotsOutput"
}
}
}
}
},
- "tags": ["Teams / Event Types"]
+ "tags": ["Routing forms"]
}
},
- "/v2/teams/{teamId}/memberships": {
+ "/v2/schedules": {
"post": {
- "operationId": "TeamsMembershipsController_createTeamMembership",
- "summary": "Create a membership",
+ "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\n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"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",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string",
+ "default": "2024-06-11"
}
}
],
@@ -13074,7 +13263,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateTeamMembershipInput"
+ "$ref": "#/components/schemas/CreateScheduleInput_2024_06_11"
}
}
}
@@ -13085,72 +13274,36 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateTeamMembershipOutput"
+ "$ref": "#/components/schemas/CreateScheduleOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Teams / Memberships"]
+ "tags": ["Schedules"]
},
"get": {
- "operationId": "TeamsMembershipsController_getTeamMemberships",
- "summary": "Get all memberships",
- "description": "Retrieve team memberships with optional filtering by email addresses. Supports pagination.",
+ "operationId": "SchedulesController_2024_06_11_getSchedules",
+ "summary": "Get all schedules",
+ "description": "Get all schedules of the authenticated user.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"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",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
- }
- },
- {
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
- "schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
- "schema": {
- "minimum": 0,
- "default": 0,
- "type": "number"
- }
- },
- {
- "name": "emails",
- "required": false,
- "in": "query",
- "description": "Filter team memberships by email addresses. If you want to filter by multiple emails, separate them with a comma (max 20 emails for performance).",
- "schema": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string",
+ "default": "2024-06-11"
}
}
],
@@ -13160,43 +13313,38 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetTeamMembershipsOutput"
+ "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Teams / Memberships"]
+ "tags": ["Schedules"]
}
},
- "/v2/teams/{teamId}/memberships/{membershipId}": {
+ "/v2/schedules/default": {
"get": {
- "operationId": "TeamsMembershipsController_getTeamMembership",
- "summary": "Get a membership",
+ "operationId": "SchedulesController_2024_06_11_getDefaultSchedule",
+ "summary": "Get default schedule",
+ "description": "Get the default schedule of the authenticated user.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"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"
- }
- },
- {
- "name": "membershipId",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string",
+ "default": "2024-06-11"
}
}
],
@@ -13206,37 +13354,42 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetTeamMembershipOutput"
+ "$ref": "#/components/schemas/GetDefaultScheduleOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Teams / Memberships"]
- },
- "patch": {
- "operationId": "TeamsMembershipsController_updateTeamMembership",
- "summary": "Update membership",
+ "tags": ["Schedules"]
+ }
+ },
+ "/v2/schedules/{scheduleId}": {
+ "get": {
+ "operationId": "SchedulesController_2024_06_11_getSchedule",
+ "summary": "Get a schedule",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"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",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string",
+ "default": "2024-06-11"
}
},
{
- "name": "membershipId",
+ "name": "scheduleId",
"required": true,
"in": "path",
"schema": {
@@ -13244,79 +13397,81 @@
}
}
],
- "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/GetScheduleOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Teams / Memberships"]
+ "tags": ["Schedules"]
},
- "delete": {
- "operationId": "TeamsMembershipsController_deleteTeamMembership",
- "summary": "Delete a membership",
+ "patch": {
+ "operationId": "SchedulesController_2024_06_11_updateSchedule",
+ "summary": "Update a schedule",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"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",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string",
+ "default": "2024-06-11"
}
},
{
- "name": "membershipId",
+ "name": "scheduleId",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "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/DeleteTeamMembershipOutput"
+ "$ref": "#/components/schemas/UpdateScheduleOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Teams / Memberships"]
- }
- },
- "/v2/teams/{teamId}/schedules": {
- "get": {
- "operationId": "TeamsSchedulesController_getTeamSchedules",
- "summary": "Get all team member schedules",
+ "tags": ["Schedules"]
+ },
+ "delete": {
+ "operationId": "SchedulesController_2024_06_11_deleteSchedule",
+ "summary": "Delete a schedule",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"parameters": [
{
"name": "Authorization",
@@ -13328,35 +13483,20 @@
}
},
{
- "name": "teamId",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-06-11. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
"schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
+ "type": "string",
+ "default": "2024-06-11"
}
},
{
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "name": "scheduleId",
+ "required": true,
+ "in": "path",
"schema": {
- "minimum": 0,
- "default": 0,
"type": "number"
}
}
@@ -13367,20 +13507,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
+ "$ref": "#/components/schemas/DeleteScheduleOutput_2024_06_11"
}
}
}
}
},
- "tags": ["Teams / Schedules"]
+ "tags": ["Schedules"]
}
},
- "/v2/teams/{teamId}/verified-resources/emails/verification-code/request": {
+ "/v2/selected-calendars": {
"post": {
- "operationId": "TeamsVerifiedResourcesController_requestEmailVerificationCode",
- "summary": "Request email verification code",
- "description": "Sends a verification code to the Email",
+ "operationId": "SelectedCalendarsController_addSelectedCalendar",
+ "summary": "Add a selected calendar",
"parameters": [
{
"name": "Authorization",
@@ -13397,31 +13536,28 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RequestEmailVerificationInput"
+ "$ref": "#/components/schemas/SelectedCalendarsInputDto"
}
}
}
},
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RequestEmailVerificationOutput"
+ "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"
}
}
}
}
},
- "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",
+ "tags": ["Selected Calendars"]
+ },
+ "delete": {
+ "operationId": "SelectedCalendarsController_deleteSelectedCalendar",
+ "summary": "Delete a selected calendar",
"parameters": [
{
"name": "Authorization",
@@ -13431,101 +13567,288 @@
"schema": {
"type": "string"
}
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RequestPhoneVerificationInput"
- }
+ },
+ {
+ "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/RequestPhoneVerificationOutput"
+ "$ref": "#/components/schemas/SelectedCalendarOutputResponseDto"
}
}
}
}
},
- "tags": ["Teams Verified Resources"]
+ "tags": ["Selected Calendars"]
}
},
- "/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",
+ "/v2/slots": {
+ "get": {
+ "operationId": "SlotsController_2024_09_04_getAvailableSlots",
+ "summary": "Get available time slots for an event type",
+ "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 - format: 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 - bookingUidToReschedule: When rescheduling an existing booking, provide the booking's unique identifier to exclude its time slot from busy time calculations. This ensures the original booking time appears as available for rescheduling.\n\n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
"parameters": [
{
- "name": "teamId",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "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",
+ "name": "bookingUidToReschedule",
+ "required": false,
+ "in": "query",
+ "description": "The unique identifier of the booking being rescheduled. When provided will ensure that the original booking time appears within the returned available slots when rescheduling.",
+ "example": "abc123def456",
+ "schema": {}
+ },
+ {
+ "name": "start",
"required": true,
- "schema": {
- "type": "string"
- }
+ "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": "format",
+ "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": {}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/VerifyEmailInput"
- }
- }
- }
- },
"responses": {
"200": {
- "description": "",
+ "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": {
- "$ref": "#/components/schemas/TeamVerifiedEmailOutput"
+ "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",
+ "items": {
+ "type": "object",
+ "properties": {
+ "start": {
+ "type": "string"
+ },
+ "end": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "example": {
+ "status": "success",
+ "data": {
+ "2050-09-05": [
+ {
+ "start": "2050-09-05T09:00:00.000+02:00",
+ "end": "2050-09-05T10:00:00.000+02:00"
+ },
+ {
+ "start": "2050-09-05T10:00:00.000+02:00",
+ "end": "2050-09-05T11:00:00.000+02:00"
+ }
+ ],
+ "2050-09-06": [
+ {
+ "start": "2050-09-06T09:00:00.000+02:00",
+ "end": "2050-09-06T10:00:00.000+02:00"
+ },
+ {
+ "start": "2050-09-06T10:00:00.000+02:00",
+ "end": "2050-09-06T11:00:00.000+02:00"
+ }
+ ]
+ }
+ }
+ }
+ ]
}
}
}
}
},
- "tags": ["Teams Verified Resources"]
+ "tags": ["Slots"]
}
},
- "/v2/teams/{teamId}/verified-resources/phones/verification-code/verify": {
+ "/v2/slots/reservations": {
"post": {
- "operationId": "TeamsVerifiedResourcesController_verifyPhoneNumber",
- "summary": "Verify a phone number for an org team",
- "description": "Use code to verify a phone number",
+ "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).\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note> \n ",
"parameters": [
{
- "name": "teamId",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "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": true,
+ "required": false,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-cal-client-id",
+ "in": "header",
+ "description": "For platform customers - OAuth client ID",
+ "required": false,
"schema": {
"type": "string"
}
@@ -13536,69 +13859,46 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/VerifyPhoneInput"
+ "$ref": "#/components/schemas/ReserveSlotInput_2024_09_04"
}
}
}
},
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"
+ "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"
}
}
}
}
},
- "tags": ["Teams Verified Resources"]
+ "tags": ["Slots"]
}
},
- "/v2/teams/{teamId}/verified-resources/emails": {
+ "/v2/slots/reservations/{uid}": {
"get": {
- "operationId": "TeamsVerifiedResourcesController_getVerifiedEmails",
- "summary": "Get list of verified emails of a team",
+ "operationId": "SlotsController_2024_09_04_getReservedSlot",
+ "summary": "Get reserved slot",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"parameters": [
{
- "name": "teamId",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
- "schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
"schema": {
- "minimum": 0,
- "default": 0,
- "type": "number"
+ "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",
+ "name": "uid",
"required": true,
+ "in": "path",
"schema": {
"type": "string"
}
@@ -13610,104 +13910,114 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamVerifiedEmailsOutput"
+ "$ref": "#/components/schemas/GetReservedSlotOutput_2024_09_04"
}
}
}
}
},
- "tags": ["Teams Verified Resources"]
- }
- },
- "/v2/teams/{teamId}/verified-resources/phones": {
- "get": {
- "operationId": "TeamsVerifiedResourcesController_getVerifiedPhoneNumbers",
- "summary": "Get list of verified phone numbers of a team",
+ "tags": ["Slots"]
+ },
+ "patch": {
+ "operationId": "SlotsController_2024_09_04_updateReservedSlot",
+ "summary": "Update a reserved slot",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"parameters": [
{
- "name": "teamId",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
"schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
- "schema": {
- "minimum": 0,
- "default": 0,
- "type": "number"
+ "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",
+ "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/TeamVerifiedPhonesOutput"
+ "$ref": "#/components/schemas/ReserveSlotOutputResponse_2024_09_04"
}
}
}
}
},
- "tags": ["Teams Verified Resources"]
- }
- },
- "/v2/teams/{teamId}/verified-resources/emails/{id}": {
- "get": {
- "operationId": "TeamsVerifiedResourcesController_getVerifiedEmailById",
- "summary": "Get verified email of a team by id",
+ "tags": ["Slots"]
+ },
+ "delete": {
+ "operationId": "SlotsController_2024_09_04_deleteReservedSlot",
+ "summary": "Delete a reserved slot",
+ "description": "<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>",
"parameters": [
{
- "name": "id",
+ "name": "cal-api-version",
+ "in": "header",
+ "description": "Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.",
"required": true,
- "in": "path",
"schema": {
- "type": "number"
+ "type": "string",
+ "default": "2024-09-04"
}
},
{
- "name": "teamId",
+ "name": "uid",
"required": true,
"in": "path",
"schema": {
- "type": "number"
+ "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",
- "required": true,
"schema": {
"type": "string"
}
@@ -13719,41 +14029,32 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamVerifiedEmailOutput"
+ "$ref": "#/components/schemas/StripConnectOutputResponseDto"
}
}
}
}
},
- "tags": ["Teams Verified Resources"]
+ "tags": ["Stripe"]
}
},
- "/v2/teams/{teamId}/verified-resources/phones/{id}": {
+ "/v2/stripe/save": {
"get": {
- "operationId": "TeamsVerifiedResourcesController_getVerifiedPhoneById",
- "summary": "Get verified phone number of a team by id",
+ "operationId": "StripeController_save",
+ "summary": "Save Stripe credentials",
"parameters": [
{
- "name": "teamId",
- "required": true,
- "in": "path",
- "schema": {
- "type": "number"
- }
- },
- {
- "name": "id",
+ "name": "state",
"required": true,
- "in": "path",
+ "in": "query",
"schema": {
- "type": "number"
+ "type": "string"
}
},
{
- "name": "Authorization",
- "in": "header",
- "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_ or managed user access token",
+ "name": "code",
"required": true,
+ "in": "query",
"schema": {
"type": "string"
}
@@ -13765,20 +14066,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TeamVerifiedPhoneOutput"
+ "$ref": "#/components/schemas/StripCredentialsSaveOutputResponseDto"
}
}
}
}
},
- "tags": ["Teams Verified Resources"]
+ "tags": ["Stripe"]
}
},
- "/v2/verified-resources/emails/verification-code/request": {
- "post": {
- "operationId": "UserVerifiedResourcesController_requestEmailVerificationCode",
- "summary": "Request email verification code",
- "description": "Sends a verification code to the email",
+ "/v2/stripe/check": {
+ "get": {
+ "operationId": "StripeController_check",
+ "summary": "Check Stripe connection",
"parameters": [
{
"name": "Authorization",
@@ -13790,41 +14090,30 @@
}
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RequestEmailVerificationInput"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RequestEmailVerificationOutput"
+ "$ref": "#/components/schemas/StripCredentialsCheckOutputResponseDto"
}
}
}
}
},
- "tags": ["Verified Resources"]
+ "tags": ["Stripe"]
}
},
- "/v2/verified-resources/phones/verification-code/request": {
+ "/v2/teams": {
"post": {
- "operationId": "UserVerifiedResourcesController_requestPhoneVerificationCode",
- "summary": "Request phone number verification code",
- "description": "Sends a verification code to the phone number",
+ "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_ or managed user access token",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
"required": true,
"schema": {
"type": "string"
@@ -13836,81 +14125,111 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RequestPhoneVerificationInput"
+ "$ref": "#/components/schemas/CreateTeamInput"
}
}
}
},
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RequestPhoneVerificationOutput"
+ "$ref": "#/components/schemas/CreateTeamOutput"
}
}
}
}
},
- "tags": ["Verified Resources"]
- }
- },
- "/v2/verified-resources/emails/verification-code/verify": {
- "post": {
- "operationId": "UserVerifiedResourcesController_verifyEmail",
- "summary": "Verify an email",
- "description": "Use code to verify an email",
+ "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_ 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/VerifyEmailInput"
- }
- }
- }
- },
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserVerifiedEmailOutput"
+ "$ref": "#/components/schemas/GetTeamsOutput"
}
}
}
}
},
- "tags": ["Verified Resources"]
+ "tags": ["Teams"]
}
},
- "/v2/verified-resources/phones/verification-code/verify": {
- "post": {
- "operationId": "UserVerifiedResourcesController_verifyPhoneNumber",
- "summary": "Verify a phone number",
- "description": "Use code to verify a phone number",
+ "/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_ 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"
+ }
+ }
+ ],
+ "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": {
@@ -13918,7 +14237,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/VerifyPhoneInput"
+ "$ref": "#/components/schemas/UpdateOrgTeamDto"
}
}
}
@@ -13929,52 +14248,33 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserVerifiedPhoneOutput"
+ "$ref": "#/components/schemas/UpdateTeamOutput"
}
}
}
}
},
- "tags": ["Verified Resources"]
- }
- },
- "/v2/verified-resources/emails": {
- "get": {
- "operationId": "UserVerifiedResourcesController_getVerifiedEmails",
- "summary": "Get list of verified emails",
+ "tags": ["Teams"]
+ },
+ "delete": {
+ "operationId": "TeamsController_deleteTeam",
+ "summary": "Delete a team",
"parameters": [
{
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
- "schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "name": "Authorization",
+ "in": "header",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": true,
"schema": {
- "minimum": 0,
- "default": 0,
- "type": "number"
+ "type": "string"
}
},
{
- "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"
}
}
],
@@ -13984,77 +14284,68 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserVerifiedEmailsOutput"
+ "$ref": "#/components/schemas/OrgTeamOutputResponseDto"
}
}
}
}
},
- "tags": ["Verified Resources"]
+ "tags": ["Teams"]
}
},
- "/v2/verified-resources/phones": {
- "get": {
- "operationId": "UserVerifiedResourcesController_getVerifiedPhoneNumbers",
- "summary": "Get list of verified phone numbers",
+ "/v2/teams/{teamId}/event-types": {
+ "post": {
+ "operationId": "TeamsEventTypesController_createTeamEventType",
+ "summary": "Create an event type",
"parameters": [
{
- "name": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
- "schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
- "type": "number"
- }
- },
- {
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "name": "teamId",
+ "required": true,
+ "in": "path",
"schema": {
- "minimum": 0,
- "default": 0,
"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/CreateTeamEventTypeInput_2024_06_14"
+ }
+ }
+ }
+ },
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserVerifiedPhonesOutput"
+ "$ref": "#/components/schemas/CreateTeamEventTypeOutput"
}
}
}
}
},
- "tags": ["Verified Resources"]
- }
- },
- "/v2/verified-resources/emails/{id}": {
+ "tags": ["Teams / Event Types"]
+ },
"get": {
- "operationId": "UserVerifiedResourcesController_getVerifiedEmailById",
- "summary": "Get verified email by id",
+ "operationId": "TeamsEventTypesController_getTeamEventTypes",
+ "summary": "Get a team event type",
"parameters": [
{
- "name": "id",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
@@ -14062,13 +14353,22 @@
}
},
{
- "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,
+ "name": "eventSlug",
+ "required": false,
+ "in": "query",
+ "description": "Slug of team event type to return.",
"schema": {
"type": "string"
}
+ },
+ {
+ "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": "number"
+ }
}
],
"responses": {
@@ -14077,22 +14377,30 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserVerifiedEmailOutput"
+ "$ref": "#/components/schemas/GetTeamEventTypesOutput"
}
}
}
}
},
- "tags": ["Verified Resources"]
+ "tags": ["Teams / Event Types"]
}
},
- "/v2/verified-resources/phones/{id}": {
+ "/v2/teams/{teamId}/event-types/{eventTypeId}": {
"get": {
- "operationId": "UserVerifiedResourcesController_getVerifiedPhoneById",
- "summary": "Get verified phone number by id",
+ "operationId": "TeamsEventTypesController_getTeamEventType",
+ "summary": "Get an event type",
"parameters": [
{
- "name": "id",
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "eventTypeId",
"required": true,
"in": "path",
"schema": {
@@ -14102,7 +14410,7 @@
{
"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"
@@ -14115,20 +14423,34 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserVerifiedPhoneOutput"
+ "$ref": "#/components/schemas/GetTeamEventTypeOutput"
}
}
}
}
},
- "tags": ["Verified Resources"]
- }
- },
- "/v2/webhooks": {
- "post": {
- "operationId": "WebhooksController_createWebhook",
- "summary": "Create a webhook",
+ "tags": ["Teams / Event Types"]
+ },
+ "patch": {
+ "operationId": "TeamsEventTypesController_updateTeamEventType",
+ "summary": "Update a team event type",
"parameters": [
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "eventTypeId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
{
"name": "Authorization",
"in": "header",
@@ -14144,62 +14466,52 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateWebhookInputDto"
+ "$ref": "#/components/schemas/UpdateTeamEventTypeInput_2024_06_14"
}
}
}
},
"responses": {
- "201": {
+ "200": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserWebhookOutputResponseDto"
+ "$ref": "#/components/schemas/UpdateTeamEventTypeOutput"
}
}
}
}
},
- "tags": ["Webhooks"]
+ "tags": ["Teams / Event Types"]
},
- "get": {
- "operationId": "WebhooksController_getWebhooks",
- "summary": "Get all webhooks",
- "description": "Gets a paginated list of webhooks for the authenticated user.",
+ "delete": {
+ "operationId": "TeamsEventTypesController_deleteTeamEventType",
+ "summary": "Delete a team event type",
"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": "take",
- "required": false,
- "in": "query",
- "description": "Maximum number of items to return",
- "example": 25,
+ "name": "eventTypeId",
+ "required": true,
+ "in": "path",
"schema": {
- "minimum": 1,
- "maximum": 250,
- "default": 250,
"type": "number"
}
},
{
- "name": "skip",
- "required": false,
- "in": "query",
- "description": "Number of items to skip",
- "example": 0,
+ "name": "Authorization",
+ "in": "header",
+ "description": "value must be `Bearer <token>` where `<token>` is api key prefixed with cal_",
+ "required": true,
"schema": {
- "minimum": 0,
- "default": 0,
- "type": "number"
+ "type": "string"
}
}
],
@@ -14209,19 +14521,75 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserWebhooksOutputResponseDto"
+ "$ref": "#/components/schemas/DeleteTeamEventTypeOutput"
}
}
}
}
},
- "tags": ["Webhooks"]
+ "tags": ["Teams / Event Types"]
}
},
- "/v2/webhooks/{webhookId}": {
- "patch": {
- "operationId": "WebhooksController_updateWebhook",
- "summary": "Update a webhook",
+ "/v2/teams/{teamId}/event-types/{eventTypeId}/create-phone-call": {
+ "post": {
+ "operationId": "TeamsEventTypesController_createPhoneCall",
+ "summary": "Create a phone call",
+ "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_",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreatePhoneCallInput"
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreatePhoneCallOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Teams / Event Types"]
+ }
+ },
+ "/v2/teams/{teamId}/memberships": {
+ "post": {
+ "operationId": "TeamsMembershipsController_createTeamMembership",
+ "summary": "Create a membership",
"parameters": [
{
"name": "Authorization",
@@ -14233,11 +14601,11 @@
}
},
{
- "name": "webhookId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
- "type": "string"
+ "type": "number"
}
}
],
@@ -14246,28 +14614,29 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateWebhookInputDto"
+ "$ref": "#/components/schemas/CreateTeamMembershipInput"
}
}
}
},
"responses": {
- "200": {
+ "201": {
"description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserWebhookOutputResponseDto"
+ "$ref": "#/components/schemas/CreateTeamMembershipOutput"
}
}
}
}
},
- "tags": ["Webhooks"]
+ "tags": ["Teams / Memberships"]
},
"get": {
- "operationId": "WebhooksController_getWebhook",
- "summary": "Get a webhook",
+ "operationId": "TeamsMembershipsController_getTeamMemberships",
+ "summary": "Get all memberships",
+ "description": "Retrieve team memberships with optional filtering by email addresses. Supports pagination.",
"parameters": [
{
"name": "Authorization",
@@ -14277,6 +14646,52 @@
"schema": {
"type": "string"
}
+ },
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
+ }
+ },
+ {
+ "name": "emails",
+ "required": false,
+ "in": "query",
+ "description": "Filter team memberships by email addresses. If you want to filter by multiple emails, separate them with a comma (max 20 emails for performance).",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
}
],
"responses": {
@@ -14285,17 +14700,19 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserWebhookOutputResponseDto"
+ "$ref": "#/components/schemas/GetTeamMembershipsOutput"
}
}
}
}
},
- "tags": ["Webhooks"]
- },
- "delete": {
- "operationId": "WebhooksController_deleteWebhook",
- "summary": "Delete a webhook",
+ "tags": ["Teams / Memberships"]
+ }
+ },
+ "/v2/teams/{teamId}/memberships/{membershipId}": {
+ "get": {
+ "operationId": "TeamsMembershipsController_getTeamMembership",
+ "summary": "Get a membership",
"parameters": [
{
"name": "Authorization",
@@ -14307,11 +14724,19 @@
}
},
{
- "name": "webhookId",
+ "name": "teamId",
"required": true,
"in": "path",
"schema": {
- "type": "string"
+ "type": "number"
+ }
+ },
+ {
+ "name": "membershipId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
}
}
],
@@ -14321,68 +14746,1183 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UserWebhookOutputResponseDto"
+ "$ref": "#/components/schemas/GetTeamMembershipOutput"
}
}
}
}
},
- "tags": ["Webhooks"]
- }
- }
- },
- "info": {
- "title": "Cal.com API v2",
- "description": "",
- "version": "1.0.0",
- "contact": {}
- },
- "tags": [],
- "servers": [],
- "components": {
- "schemas": {
- "ManagedUserOutput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "example": 1
- },
- "email": {
- "type": "string",
- "example": "[email protected]"
- },
- "username": {
- "type": "string",
- "nullable": true,
- "example": "alice"
- },
- "name": {
- "type": "string",
- "nullable": true,
- "example": "alice"
- },
- "bio": {
- "type": "string",
- "nullable": true,
- "example": "bio"
- },
- "timeZone": {
- "type": "string",
- "example": "America/New_York"
- },
- "weekStart": {
- "type": "string",
- "example": "Sunday"
+ "tags": ["Teams / Memberships"]
+ },
+ "patch": {
+ "operationId": "TeamsMembershipsController_updateTeamMembership",
+ "summary": "Update 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"
+ }
},
- "createdDate": {
- "type": "string",
- "example": "2024-04-01T00:00:00.000Z"
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
},
- "timeFormat": {
- "type": "number",
- "nullable": true,
- "example": 12
+ {
+ "name": "membershipId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateTeamMembershipInput"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateTeamMembershipOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Teams / Memberships"]
+ },
+ "delete": {
+ "operationId": "TeamsMembershipsController_deleteTeamMembership",
+ "summary": "Delete 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"
+ }
+ },
+ {
+ "name": "membershipId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeleteTeamMembershipOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Teams / Memberships"]
+ }
+ },
+ "/v2/teams/{teamId}/schedules": {
+ "get": {
+ "operationId": "TeamsSchedulesController_getTeamSchedules",
+ "summary": "Get all team member schedules",
+ "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": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GetSchedulesOutput_2024_06_11"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Teams / Schedules"]
+ }
+ },
+ "/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_ or managed user access token",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RequestEmailVerificationInput"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RequestEmailVerificationOutput"
+ }
+ }
+ }
+ }
+ },
+ "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_ 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/RequestPhoneVerificationOutput"
+ }
+ }
+ }
+ }
+ },
+ "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": "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_ 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/TeamVerifiedEmailOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Teams Verified Resources"]
+ }
+ },
+ "/v2/teams/{teamId}/verified-resources/phones/verification-code/verify": {
+ "post": {
+ "operationId": "TeamsVerifiedResourcesController_verifyPhoneNumber",
+ "summary": "Verify a phone number for an org team",
+ "description": "Use code to verify a phone number",
+ "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_ or managed user access token",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$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": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "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/phones": {
+ "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": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "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/TeamVerifiedPhonesOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Teams Verified Resources"]
+ }
+ },
+ "/v2/teams/{teamId}/verified-resources/emails/{id}": {
+ "get": {
+ "operationId": "TeamsVerifiedResourcesController_getVerifiedEmailById",
+ "summary": "Get verified email of a team by id",
+ "parameters": [
+ {
+ "name": "id",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "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_ or managed user access token",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/TeamVerifiedEmailOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Teams Verified Resources"]
+ }
+ },
+ "/v2/teams/{teamId}/verified-resources/phones/{id}": {
+ "get": {
+ "operationId": "TeamsVerifiedResourcesController_getVerifiedPhoneById",
+ "summary": "Get verified phone number of a team by id",
+ "parameters": [
+ {
+ "name": "teamId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "name": "id",
+ "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",
+ "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"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RequestEmailVerificationInput"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RequestEmailVerificationOutput"
+ }
+ }
+ }
+ }
+ },
+ "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": "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/RequestPhoneVerificationInput"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RequestPhoneVerificationOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Verified Resources"]
+ }
+ },
+ "/v2/verified-resources/emails/verification-code/verify": {
+ "post": {
+ "operationId": "UserVerifiedResourcesController_verifyEmail",
+ "summary": "Verify an email",
+ "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_ 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/UserVerifiedEmailOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Verified Resources"]
+ }
+ },
+ "/v2/verified-resources/phones/verification-code/verify": {
+ "post": {
+ "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_ or managed user access token",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/VerifyPhoneInput"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UserVerifiedPhoneOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Verified Resources"]
+ }
+ },
+ "/v2/verified-resources/emails": {
+ "get": {
+ "operationId": "UserVerifiedResourcesController_getVerifiedEmails",
+ "summary": "Get list of verified emails",
+ "parameters": [
+ {
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "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/UserVerifiedEmailsOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Verified Resources"]
+ }
+ },
+ "/v2/verified-resources/phones": {
+ "get": {
+ "operationId": "UserVerifiedResourcesController_getVerifiedPhoneNumbers",
+ "summary": "Get list of verified phone numbers",
+ "parameters": [
+ {
+ "name": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "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/UserVerifiedPhonesOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Verified Resources"]
+ }
+ },
+ "/v2/verified-resources/emails/{id}": {
+ "get": {
+ "operationId": "UserVerifiedResourcesController_getVerifiedEmailById",
+ "summary": "Get verified email by id",
+ "parameters": [
+ {
+ "name": "id",
+ "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",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UserVerifiedEmailOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Verified Resources"]
+ }
+ },
+ "/v2/verified-resources/phones/{id}": {
+ "get": {
+ "operationId": "UserVerifiedResourcesController_getVerifiedPhoneById",
+ "summary": "Get verified phone number by id",
+ "parameters": [
+ {
+ "name": "id",
+ "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",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UserVerifiedPhoneOutput"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Verified Resources"]
+ }
+ },
+ "/v2/webhooks": {
+ "post": {
+ "operationId": "WebhooksController_createWebhook",
+ "summary": "Create a webhook",
+ "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/CreateWebhookInputDto"
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UserWebhookOutputResponseDto"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Webhooks"]
+ },
+ "get": {
+ "operationId": "WebhooksController_getWebhooks",
+ "summary": "Get all webhooks",
+ "description": "Gets a paginated list of webhooks for the authenticated user.",
+ "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": "take",
+ "required": false,
+ "in": "query",
+ "description": "Maximum number of items to return",
+ "example": 25,
+ "schema": {
+ "minimum": 1,
+ "maximum": 250,
+ "default": 250,
+ "type": "number"
+ }
+ },
+ {
+ "name": "skip",
+ "required": false,
+ "in": "query",
+ "description": "Number of items to skip",
+ "example": 0,
+ "schema": {
+ "minimum": 0,
+ "default": 0,
+ "type": "number"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UserWebhooksOutputResponseDto"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Webhooks"]
+ }
+ },
+ "/v2/webhooks/{webhookId}": {
+ "patch": {
+ "operationId": "WebhooksController_updateWebhook",
+ "summary": "Update a webhook",
+ "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": "webhookId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateWebhookInputDto"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UserWebhookOutputResponseDto"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Webhooks"]
+ },
+ "get": {
+ "operationId": "WebhooksController_getWebhook",
+ "summary": "Get a webhook",
+ "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/UserWebhookOutputResponseDto"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Webhooks"]
+ },
+ "delete": {
+ "operationId": "WebhooksController_deleteWebhook",
+ "summary": "Delete a webhook",
+ "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": "webhookId",
+ "required": true,
+ "in": "path",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UserWebhookOutputResponseDto"
+ }
+ }
+ }
+ }
+ },
+ "tags": ["Webhooks"]
+ }
+ }
+ },
+ "info": {
+ "title": "Cal.com API v2",
+ "description": "",
+ "version": "1.0.0",
+ "contact": {}
+ },
+ "tags": [],
+ "servers": [],
+ "components": {
+ "schemas": {
+ "ManagedUserOutput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "example": 1
+ },
+ "email": {
+ "type": "string",
+ "example": "[email protected]"
+ },
+ "username": {
+ "type": "string",
+ "nullable": true,
+ "example": "alice"
+ },
+ "name": {
+ "type": "string",
+ "nullable": true,
+ "example": "alice"
+ },
+ "bio": {
+ "type": "string",
+ "nullable": true,
+ "example": "bio"
+ },
+ "timeZone": {
+ "type": "string",
+ "example": "America/New_York"
+ },
+ "weekStart": {
+ "type": "string",
+ "example": "Sunday"
+ },
+ "createdDate": {
+ "type": "string",
+ "example": "2024-04-01T00:00:00.000Z"
+ },
+ "timeFormat": {
+ "type": "number",
+ "nullable": true,
+ "example": 12
},
"defaultScheduleId": {
"type": "number",
@@ -23596,67 +25136,328 @@
"theme": {
"type": "string"
},
- "brandColor": {
+ "brandColor": {
+ "type": "string"
+ },
+ "darkBrandColor": {
+ "type": "string"
+ },
+ "bannerUrl": {
+ "type": "string"
+ },
+ "timeFormat": {
+ "type": "number"
+ },
+ "timeZone": {
+ "type": "string",
+ "default": "Europe/London"
+ },
+ "weekStart": {
+ "type": "string",
+ "default": "Sunday"
+ }
+ },
+ "required": ["id", "name", "isOrganization"]
+ },
+ "CreateTeamOutputData": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "paymentLink": {
+ "type": "string"
+ },
+ "pendingTeam": {
+ "$ref": "#/components/schemas/TeamOutputDto"
+ }
+ },
+ "required": ["message", "paymentLink", "pendingTeam"]
+ },
+ "CreateTeamOutput": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/CreateTeamOutputData"
+ },
+ {
+ "$ref": "#/components/schemas/TeamOutputDto"
+ }
+ ],
+ "description": "Either an Output object or a TeamOutputDto."
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "GetTeamOutput": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "$ref": "#/components/schemas/TeamOutputDto"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "GetTeamsOutput": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TeamOutputDto"
+ }
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "UpdateTeamOutput": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "$ref": "#/components/schemas/TeamOutputDto"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "ConferencingAppsOutputDto": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Id of the conferencing app credentials"
+ },
+ "type": {
+ "type": "string",
+ "example": "google_video",
+ "description": "Type of conferencing app"
+ },
+ "userId": {
+ "type": "number",
+ "description": "Id of the user associated to the conferencing app"
+ },
+ "invalid": {
+ "type": "boolean",
+ "nullable": true,
+ "example": true,
+ "description": "Whether if the connection is working or not."
+ }
+ },
+ "required": ["id", "type", "userId"]
+ },
+ "ConferencingAppOutputResponseDto": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "$ref": "#/components/schemas/ConferencingAppsOutputDto"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "GetConferencingAppsOauthUrlResponseDto": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ }
+ },
+ "required": ["status"]
+ },
+ "ConferencingAppsOutputResponseDto": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ConferencingAppsOutputDto"
+ }
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "SetDefaultConferencingAppOutputResponseDto": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ }
+ },
+ "required": ["status"]
+ },
+ "DefaultConferencingAppsOutputDto": {
+ "type": "object",
+ "properties": {
+ "appSlug": {
+ "type": "string"
+ },
+ "appLink": {
+ "type": "string"
+ }
+ }
+ },
+ "GetDefaultConferencingAppOutputResponseDto": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "$ref": "#/components/schemas/DefaultConferencingAppsOutputDto"
+ }
+ },
+ "required": ["status"]
+ },
+ "DisconnectConferencingAppOutputResponseDto": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ }
+ },
+ "required": ["status"]
+ },
+ "GoogleServiceAccountKeyInput": {
+ "type": "object",
+ "properties": {
+ "private_key": {
+ "type": "string"
+ },
+ "client_email": {
+ "type": "string"
+ },
+ "client_id": {
+ "type": "string"
+ }
+ },
+ "required": ["private_key", "client_email", "client_id"]
+ },
+ "MicrosoftServiceAccountKeyInput": {
+ "type": "object",
+ "properties": {
+ "private_key": {
+ "type": "string"
+ },
+ "tenant_id": {
"type": "string"
},
- "darkBrandColor": {
+ "client_id": {
"type": "string"
- },
- "bannerUrl": {
+ }
+ },
+ "required": ["private_key", "tenant_id", "client_id"]
+ },
+ "CreateDelegationCredentialInput": {
+ "type": "object",
+ "properties": {
+ "workspacePlatformSlug": {
"type": "string"
},
- "timeFormat": {
- "type": "number"
- },
- "timeZone": {
- "type": "string",
- "default": "Europe/London"
+ "domain": {
+ "type": "string"
},
- "weekStart": {
- "type": "string",
- "default": "Sunday"
+ "serviceAccountKey": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/GoogleServiceAccountKeyInput"
+ },
+ {
+ "$ref": "#/components/schemas/MicrosoftServiceAccountKeyInput"
+ }
+ ]
+ }
}
},
- "required": ["id", "name", "isOrganization"]
+ "required": ["workspacePlatformSlug", "domain", "serviceAccountKey"]
},
- "CreateTeamOutputData": {
+ "WorkspacePlatformDto": {
"type": "object",
"properties": {
- "message": {
+ "name": {
"type": "string"
},
- "paymentLink": {
+ "slug": {
"type": "string"
- },
- "pendingTeam": {
- "$ref": "#/components/schemas/TeamOutputDto"
}
},
- "required": ["message", "paymentLink", "pendingTeam"]
+ "required": ["name", "slug"]
},
- "CreateTeamOutput": {
+ "DelegationCredentialOutput": {
"type": "object",
"properties": {
- "status": {
- "type": "string",
- "example": "success",
- "enum": ["success", "error"]
+ "id": {
+ "type": "string"
},
- "data": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/CreateTeamOutputData"
- },
- {
- "$ref": "#/components/schemas/TeamOutputDto"
- }
- ],
- "description": "Either an Output object or a TeamOutputDto."
+ "enabled": {
+ "type": "boolean"
+ },
+ "domain": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "number"
+ },
+ "workspacePlatform": {
+ "$ref": "#/components/schemas/WorkspacePlatformDto"
+ },
+ "createdAt": {
+ "format": "date-time",
+ "type": "string"
+ },
+ "updatedAt": {
+ "format": "date-time",
+ "type": "string"
}
},
- "required": ["status", "data"]
+ "required": [
+ "id",
+ "enabled",
+ "domain",
+ "organizationId",
+ "workspacePlatform",
+ "createdAt",
+ "updatedAt"
+ ]
},
- "GetTeamOutput": {
+ "CreateDelegationCredentialOutput": {
"type": "object",
"properties": {
"status": {
@@ -23665,29 +25466,33 @@
"enum": ["success", "error"]
},
"data": {
- "$ref": "#/components/schemas/TeamOutputDto"
+ "$ref": "#/components/schemas/DelegationCredentialOutput"
}
},
"required": ["status", "data"]
},
- "GetTeamsOutput": {
+ "UpdateDelegationCredentialInput": {
"type": "object",
"properties": {
- "status": {
- "type": "string",
- "example": "success",
- "enum": ["success", "error"]
+ "enabled": {
+ "type": "boolean"
},
- "data": {
+ "serviceAccountKey": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/TeamOutputDto"
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/GoogleServiceAccountKeyInput"
+ },
+ {
+ "$ref": "#/components/schemas/MicrosoftServiceAccountKeyInput"
+ }
+ ]
}
}
- },
- "required": ["status", "data"]
+ }
},
- "UpdateTeamOutput": {
+ "UpdateDelegationCredentialOutput": {
"type": "object",
"properties": {
"status": {
@@ -23696,263 +25501,365 @@
"enum": ["success", "error"]
},
"data": {
- "$ref": "#/components/schemas/TeamOutputDto"
+ "$ref": "#/components/schemas/DelegationCredentialOutput"
}
},
"required": ["status", "data"]
},
- "ConferencingAppsOutputDto": {
+ "CreateIcsFeedInputDto": {
+ "type": "object",
+ "properties": {
+ "urls": {
+ "type": "array",
+ "example": ["https://cal.com/ics/feed.ics", "http://cal.com/ics/feed.ics"],
+ "description": "An array of ICS URLs",
+ "items": {
+ "type": "string",
+ "example": "https://cal.com/ics/feed.ics"
+ }
+ },
+ "readOnly": {
+ "type": "boolean",
+ "default": true,
+ "example": false,
+ "description": "Whether to allowing writing to the calendar or not"
+ }
+ },
+ "required": ["urls"]
+ },
+ "CreateIcsFeedOutput": {
"type": "object",
"properties": {
"id": {
"type": "number",
- "description": "Id of the conferencing app credentials"
+ "example": 1234567890,
+ "description": "The id of the calendar credential"
},
"type": {
"type": "string",
- "example": "google_video",
- "description": "Type of conferencing app"
+ "example": "ics-feed_calendar",
+ "description": "The type of the calendar"
},
"userId": {
- "type": "number",
- "description": "Id of the user associated to the conferencing app"
+ "type": "integer",
+ "nullable": true,
+ "example": 1234567890,
+ "description": "The user id of the user that created the calendar"
+ },
+ "teamId": {
+ "type": "integer",
+ "nullable": true,
+ "example": 1234567890,
+ "description": "The team id of the user that created the calendar"
+ },
+ "appId": {
+ "type": "string",
+ "nullable": true,
+ "example": "ics-feed",
+ "description": "The slug of the calendar"
},
"invalid": {
"type": "boolean",
"nullable": true,
- "example": true,
- "description": "Whether if the connection is working or not."
+ "example": false,
+ "description": "Whether the calendar credentials are valid or not"
}
},
- "required": ["id", "type", "userId"]
+ "required": ["id", "type", "userId", "teamId", "appId", "invalid"]
},
- "ConferencingAppOutputResponseDto": {
+ "CreateIcsFeedOutputResponseDto": {
"type": "object",
"properties": {
"status": {
"type": "string",
+ "example": "success",
"enum": ["success", "error"]
},
"data": {
- "$ref": "#/components/schemas/ConferencingAppsOutputDto"
+ "$ref": "#/components/schemas/CreateIcsFeedOutput"
}
},
"required": ["status", "data"]
},
- "GetConferencingAppsOauthUrlResponseDto": {
+ "BusyTimesOutput": {
"type": "object",
"properties": {
- "status": {
+ "start": {
+ "format": "date-time",
+ "type": "string"
+ },
+ "end": {
+ "format": "date-time",
+ "type": "string"
+ },
+ "source": {
"type": "string",
- "example": "success",
- "enum": ["success", "error"]
+ "nullable": true
}
},
- "required": ["status"]
+ "required": ["start", "end"]
},
- "ConferencingAppsOutputResponseDto": {
+ "GetBusyTimesOutput": {
"type": "object",
"properties": {
"status": {
"type": "string",
+ "example": "success",
"enum": ["success", "error"]
},
"data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/ConferencingAppsOutputDto"
+ "$ref": "#/components/schemas/BusyTimesOutput"
}
}
},
"required": ["status", "data"]
},
- "SetDefaultConferencingAppOutputResponseDto": {
- "type": "object",
- "properties": {
- "status": {
- "type": "string",
- "example": "success",
- "enum": ["success", "error"]
- }
- },
- "required": ["status"]
- },
- "DefaultConferencingAppsOutputDto": {
+ "Integration": {
"type": "object",
"properties": {
- "appSlug": {
+ "appData": {
+ "type": "object",
+ "nullable": true
+ },
+ "dirName": {
+ "type": "string"
+ },
+ "__template": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "installed": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "variant": {
"type": "string"
},
- "appLink": {
+ "category": {
"type": "string"
- }
- }
- },
- "GetDefaultConferencingAppOutputResponseDto": {
- "type": "object",
- "properties": {
- "status": {
- "type": "string",
- "example": "success",
- "enum": ["success", "error"]
},
- "data": {
- "$ref": "#/components/schemas/DefaultConferencingAppsOutputDto"
- }
- },
- "required": ["status"]
- },
- "DisconnectConferencingAppOutputResponseDto": {
- "type": "object",
- "properties": {
- "status": {
- "type": "string",
- "example": "success",
- "enum": ["success", "error"]
+ "categories": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "logo": {
+ "type": "string"
+ },
+ "publisher": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "locationOption": {
+ "type": "object",
+ "nullable": true
}
},
- "required": ["status"]
+ "required": [
+ "name",
+ "description",
+ "type",
+ "variant",
+ "categories",
+ "logo",
+ "publisher",
+ "slug",
+ "url",
+ "email",
+ "locationOption"
+ ]
},
- "GoogleServiceAccountKeyInput": {
+ "Primary": {
"type": "object",
"properties": {
- "private_key": {
+ "externalId": {
"type": "string"
},
- "client_email": {
+ "integration": {
"type": "string"
},
- "client_id": {
+ "name": {
+ "type": "string"
+ },
+ "primary": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "readOnly": {
+ "type": "boolean"
+ },
+ "email": {
"type": "string"
+ },
+ "isSelected": {
+ "type": "boolean"
+ },
+ "credentialId": {
+ "type": "number"
+ },
+ "delegationCredentialId": {
+ "type": "string",
+ "nullable": true
}
},
- "required": ["private_key", "client_email", "client_id"]
+ "required": ["externalId", "primary", "readOnly", "isSelected", "credentialId"]
},
- "MicrosoftServiceAccountKeyInput": {
+ "Calendar": {
"type": "object",
"properties": {
- "private_key": {
+ "externalId": {
"type": "string"
},
- "tenant_id": {
+ "integration": {
"type": "string"
},
- "client_id": {
+ "name": {
+ "type": "string"
+ },
+ "primary": {
+ "type": "boolean",
+ "nullable": true
+ },
+ "readOnly": {
+ "type": "boolean"
+ },
+ "email": {
"type": "string"
+ },
+ "isSelected": {
+ "type": "boolean"
+ },
+ "credentialId": {
+ "type": "number"
+ },
+ "delegationCredentialId": {
+ "type": "string",
+ "nullable": true
}
},
- "required": ["private_key", "tenant_id", "client_id"]
+ "required": ["externalId", "readOnly", "isSelected", "credentialId"]
},
- "CreateDelegationCredentialInput": {
+ "ConnectedCalendar": {
"type": "object",
"properties": {
- "workspacePlatformSlug": {
- "type": "string"
+ "integration": {
+ "$ref": "#/components/schemas/Integration"
},
- "domain": {
- "type": "string"
+ "credentialId": {
+ "type": "number"
},
- "serviceAccountKey": {
+ "delegationCredentialId": {
+ "type": "string",
+ "nullable": true
+ },
+ "primary": {
+ "$ref": "#/components/schemas/Primary"
+ },
+ "calendars": {
"type": "array",
"items": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/GoogleServiceAccountKeyInput"
- },
- {
- "$ref": "#/components/schemas/MicrosoftServiceAccountKeyInput"
- }
- ]
+ "$ref": "#/components/schemas/Calendar"
}
}
},
- "required": ["workspacePlatformSlug", "domain", "serviceAccountKey"]
+ "required": ["integration", "credentialId"]
},
- "WorkspacePlatformDto": {
+ "DestinationCalendar": {
"type": "object",
"properties": {
- "name": {
- "type": "string"
+ "id": {
+ "type": "object"
},
- "slug": {
+ "integration": {
"type": "string"
- }
- },
- "required": ["name", "slug"]
- },
- "DelegationCredentialOutput": {
- "type": "object",
- "properties": {
- "id": {
+ },
+ "externalId": {
"type": "string"
},
- "enabled": {
- "type": "boolean"
+ "primaryEmail": {
+ "type": "string",
+ "nullable": true
},
- "domain": {
- "type": "string"
+ "userId": {
+ "type": "number",
+ "nullable": true
},
- "organizationId": {
- "type": "number"
+ "eventTypeId": {
+ "type": "number",
+ "nullable": true
},
- "workspacePlatform": {
- "$ref": "#/components/schemas/WorkspacePlatformDto"
+ "credentialId": {
+ "type": "number",
+ "nullable": true
},
- "createdAt": {
- "format": "date-time",
+ "delegationCredentialId": {
+ "type": "string",
+ "nullable": true
+ },
+ "name": {
+ "type": "string",
+ "nullable": true
+ },
+ "primary": {
+ "type": "boolean"
+ },
+ "readOnly": {
+ "type": "boolean"
+ },
+ "email": {
"type": "string"
},
- "updatedAt": {
- "format": "date-time",
+ "integrationTitle": {
"type": "string"
}
},
"required": [
"id",
- "enabled",
- "domain",
- "organizationId",
- "workspacePlatform",
- "createdAt",
- "updatedAt"
+ "integration",
+ "externalId",
+ "primaryEmail",
+ "userId",
+ "eventTypeId",
+ "credentialId"
]
},
- "CreateDelegationCredentialOutput": {
- "type": "object",
- "properties": {
- "status": {
- "type": "string",
- "example": "success",
- "enum": ["success", "error"]
- },
- "data": {
- "$ref": "#/components/schemas/DelegationCredentialOutput"
- }
- },
- "required": ["status", "data"]
- },
- "UpdateDelegationCredentialInput": {
+ "ConnectedCalendarsData": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "serviceAccountKey": {
+ "connectedCalendars": {
"type": "array",
"items": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/GoogleServiceAccountKeyInput"
- },
- {
- "$ref": "#/components/schemas/MicrosoftServiceAccountKeyInput"
- }
- ]
+ "$ref": "#/components/schemas/ConnectedCalendar"
}
+ },
+ "destinationCalendar": {
+ "$ref": "#/components/schemas/DestinationCalendar"
}
- }
+ },
+ "required": ["connectedCalendars", "destinationCalendar"]
},
- "UpdateDelegationCredentialOutput": {
+ "ConnectedCalendarsOutput": {
"type": "object",
"properties": {
"status": {
@@ -23961,73 +25868,63 @@
"enum": ["success", "error"]
},
"data": {
- "$ref": "#/components/schemas/DelegationCredentialOutput"
+ "$ref": "#/components/schemas/ConnectedCalendarsData"
}
},
"required": ["status", "data"]
},
- "CreateIcsFeedInputDto": {
+ "CreateCalendarCredentialsInput": {
"type": "object",
"properties": {
- "urls": {
- "type": "array",
- "example": ["https://cal.com/ics/feed.ics", "http://cal.com/ics/feed.ics"],
- "description": "An array of ICS URLs",
- "items": {
- "type": "string",
- "example": "https://cal.com/ics/feed.ics"
- }
+ "username": {
+ "type": "string"
},
- "readOnly": {
- "type": "boolean",
- "default": true,
- "example": false,
- "description": "Whether to allowing writing to the calendar or not"
+ "password": {
+ "type": "string"
}
},
- "required": ["urls"]
+ "required": ["username", "password"]
},
- "CreateIcsFeedOutput": {
+ "DeleteCalendarCredentialsInputBodyDto": {
"type": "object",
"properties": {
"id": {
- "type": "number",
- "example": 1234567890,
- "description": "The id of the calendar credential"
+ "type": "integer",
+ "example": 10,
+ "description": "Credential ID of the calendar to delete, as returned by the /calendars endpoint"
+ }
+ },
+ "required": ["id"]
+ },
+ "DeletedCalendarCredentialsOutputDto": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
},
"type": {
- "type": "string",
- "example": "ics-feed_calendar",
- "description": "The type of the calendar"
+ "type": "string"
},
"userId": {
- "type": "integer",
- "nullable": true,
- "example": 1234567890,
- "description": "The user id of the user that created the calendar"
+ "type": "number",
+ "nullable": true
},
"teamId": {
- "type": "integer",
- "nullable": true,
- "example": 1234567890,
- "description": "The team id of the user that created the calendar"
+ "type": "number",
+ "nullable": true
},
"appId": {
"type": "string",
- "nullable": true,
- "example": "ics-feed",
- "description": "The slug of the calendar"
+ "nullable": true
},
"invalid": {
"type": "boolean",
- "nullable": true,
- "example": false,
- "description": "Whether the calendar credentials are valid or not"
+ "nullable": true
}
},
"required": ["id", "type", "userId", "teamId", "appId", "invalid"]
},
- "CreateIcsFeedOutputResponseDto": {
+ "DeletedCalendarCredentialsOutputResponseDto": {
"type": "object",
"properties": {
"status": {
@@ -24036,30 +25933,73 @@
"enum": ["success", "error"]
},
"data": {
- "$ref": "#/components/schemas/CreateIcsFeedOutput"
+ "$ref": "#/components/schemas/DeletedCalendarCredentialsOutputDto"
}
},
"required": ["status", "data"]
},
- "BusyTimesOutput": {
+ "CreateOrganizationInput": {
"type": "object",
"properties": {
- "start": {
- "format": "date-time",
- "type": "string"
+ "apiKeyDaysValid": {
+ "type": "number",
+ "minimum": 1,
+ "description": "For how many days is managed organization api key valid. Defaults to 30 days.",
+ "example": 60,
+ "default": 30
},
- "end": {
- "format": "date-time",
- "type": "string"
+ "apiKeyNeverExpires": {
+ "type": "boolean",
+ "description": "If true, organization api key never expires.",
+ "example": true
},
- "source": {
+ "name": {
"type": "string",
- "nullable": true
+ "minLength": 1,
+ "description": "Name of the organization",
+ "example": "CalTeam"
+ },
+ "slug": {
+ "type": "string",
+ "description": "Organization slug in kebab-case - if not provided will be generated automatically based on name.",
+ "example": "cal-tel"
+ },
+ "metadata": {
+ "type": "object",
+ "description": "You can store any additional data you want here.\nMetadata must have at most 50 keys, each key up to 40 characters.\nValues can be strings (up to 500 characters), numbers, or booleans.",
+ "example": {
+ "key": "value"
+ }
}
},
- "required": ["start", "end"]
+ "required": ["name"]
},
- "GetBusyTimesOutput": {
+ "ManagedOrganizationWithApiKeyOutput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1
+ },
+ "slug": {
+ "type": "string"
+ },
+ "metadata": {
+ "type": "object",
+ "example": {
+ "key": "value"
+ }
+ },
+ "apiKey": {
+ "type": "string"
+ }
+ },
+ "required": ["id", "name", "apiKey"]
+ },
+ "CreateManagedOrganizationOutput": {
"type": "object",
"properties": {
"status": {
@@ -24068,258 +26008,335 @@
"enum": ["success", "error"]
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/BusyTimesOutput"
- }
+ "$ref": "#/components/schemas/ManagedOrganizationWithApiKeyOutput"
}
},
"required": ["status", "data"]
},
- "Integration": {
+ "ManagedOrganizationOutput": {
"type": "object",
"properties": {
- "appData": {
- "type": "object",
- "nullable": true
- },
- "dirName": {
- "type": "string"
- },
- "__template": {
- "type": "string"
+ "id": {
+ "type": "number"
},
"name": {
- "type": "string"
- },
- "description": {
- "type": "string"
- },
- "installed": {
- "type": "boolean"
- },
- "type": {
- "type": "string"
- },
- "title": {
- "type": "string"
- },
- "variant": {
- "type": "string"
- },
- "category": {
- "type": "string"
- },
- "categories": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "logo": {
- "type": "string"
- },
- "publisher": {
- "type": "string"
+ "type": "string",
+ "minLength": 1
},
"slug": {
"type": "string"
},
- "url": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "locationOption": {
+ "metadata": {
"type": "object",
- "nullable": true
+ "example": {
+ "key": "value"
+ }
}
},
- "required": [
- "name",
- "description",
- "type",
- "variant",
- "categories",
- "logo",
- "publisher",
- "slug",
- "url",
- "email",
- "locationOption"
- ]
+ "required": ["id", "name"]
},
- "Primary": {
+ "GetManagedOrganizationOutput": {
"type": "object",
"properties": {
- "externalId": {
- "type": "string"
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
},
- "integration": {
- "type": "string"
+ "data": {
+ "$ref": "#/components/schemas/ManagedOrganizationOutput"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "PaginationMetaDto": {
+ "type": "object",
+ "properties": {
+ "totalItems": {
+ "type": "number",
+ "description": "The total number of items available across all pages, matching the query criteria.",
+ "example": 123,
+ "minimum": 0
},
- "name": {
- "type": "string"
+ "remainingItems": {
+ "type": "number",
+ "description": "The number of items remaining to be fetched *after* the current page. Calculated as: `totalItems - (skip + itemsPerPage)`.",
+ "example": 103,
+ "minimum": 0
},
- "primary": {
- "type": "boolean",
- "nullable": true
+ "returnedItems": {
+ "type": "number",
+ "description": "The number of items returned in the current page.",
+ "example": 10
},
- "readOnly": {
- "type": "boolean"
+ "itemsPerPage": {
+ "type": "number",
+ "description": "The maximum number of items requested per page.",
+ "example": 10,
+ "minimum": 1
},
- "email": {
- "type": "string"
+ "currentPage": {
+ "type": "number",
+ "description": "The current page number being returned.",
+ "example": 2,
+ "minimum": 1
},
- "isSelected": {
- "type": "boolean"
+ "totalPages": {
+ "type": "number",
+ "description": "The total number of pages available.",
+ "example": 13,
+ "minimum": 0
},
- "credentialId": {
- "type": "number"
+ "hasNextPage": {
+ "type": "boolean",
+ "description": "Indicates if there is a subsequent page available after the current one.",
+ "example": true
},
- "delegationCredentialId": {
- "type": "string",
- "nullable": true
+ "hasPreviousPage": {
+ "type": "boolean",
+ "description": "Indicates if there is a preceding page available before the current one.",
+ "example": true
}
},
- "required": ["externalId", "primary", "readOnly", "isSelected", "credentialId"]
+ "required": [
+ "totalItems",
+ "remainingItems",
+ "returnedItems",
+ "itemsPerPage",
+ "currentPage",
+ "totalPages",
+ "hasNextPage",
+ "hasPreviousPage"
+ ]
},
- "Calendar": {
+ "GetManagedOrganizationsOutput": {
"type": "object",
"properties": {
- "externalId": {
- "type": "string"
- },
- "integration": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "primary": {
- "type": "boolean",
- "nullable": true
- },
- "readOnly": {
- "type": "boolean"
- },
- "email": {
- "type": "string"
- },
- "isSelected": {
- "type": "boolean"
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
},
- "credentialId": {
- "type": "number"
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ManagedOrganizationOutput"
+ }
},
- "delegationCredentialId": {
- "type": "string",
- "nullable": true
+ "pagination": {
+ "$ref": "#/components/schemas/PaginationMetaDto"
}
},
- "required": ["externalId", "readOnly", "isSelected", "credentialId"]
+ "required": ["status", "data", "pagination"]
},
- "ConnectedCalendar": {
+ "UpdateOrganizationInput": {
"type": "object",
"properties": {
- "integration": {
- "$ref": "#/components/schemas/Integration"
- },
- "credentialId": {
- "type": "number"
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Name of the organization",
+ "example": "CalTeam"
},
- "delegationCredentialId": {
+ "metadata": {
+ "type": "object",
+ "description": "You can store any additional data you want here.\nMetadata must have at most 50 keys, each key up to 40 characters.\nValues can be strings (up to 500 characters), numbers, or booleans.",
+ "example": {
+ "key": "value"
+ }
+ }
+ }
+ },
+ "CreateOrgRoleInput": {
+ "type": "object",
+ "properties": {
+ "color": {
"type": "string",
- "nullable": true
+ "description": "Color for the role (hex code)"
},
- "primary": {
- "$ref": "#/components/schemas/Primary"
+ "description": {
+ "type": "string",
+ "description": "Description of the role"
},
- "calendars": {
+ "permissions": {
"type": "array",
+ "description": "Permissions for this role (format: resource.action). On update, this field replaces the entire permission set for the role (full replace). Use granular permission endpoints for one-by-one changes.",
+ "example": ["eventType.read", "eventType.create", "booking.read"],
"items": {
- "$ref": "#/components/schemas/Calendar"
+ "type": "string",
+ "enum": [
+ "*.*",
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "eventType.create",
+ "eventType.read",
+ "eventType.update",
+ "eventType.delete",
+ "team.create",
+ "team.read",
+ "team.update",
+ "team.delete",
+ "team.invite",
+ "team.remove",
+ "team.listMembers",
+ "team.listMembersPrivate",
+ "team.changeMemberRole",
+ "team.impersonate",
+ "organization.create",
+ "organization.read",
+ "organization.listMembers",
+ "organization.listMembersPrivate",
+ "organization.invite",
+ "organization.remove",
+ "organization.manageBilling",
+ "organization.changeMemberRole",
+ "organization.impersonate",
+ "organization.update",
+ "booking.read",
+ "booking.readOrgBookings",
+ "booking.readRecordings",
+ "booking.update",
+ "insights.read",
+ "workflow.create",
+ "workflow.read",
+ "workflow.update",
+ "workflow.delete",
+ "organization.attributes.read",
+ "organization.attributes.update",
+ "organization.attributes.delete",
+ "organization.attributes.create",
+ "routingForm.create",
+ "routingForm.read",
+ "routingForm.update",
+ "routingForm.delete",
+ "webhook.create",
+ "webhook.read",
+ "webhook.update",
+ "webhook.delete",
+ "watchlist.create",
+ "watchlist.read",
+ "watchlist.update",
+ "watchlist.delete"
+ ]
}
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Name of the role"
}
},
- "required": ["integration", "credentialId"]
+ "required": ["name"]
},
- "DestinationCalendar": {
+ "OrgRoleOutput": {
"type": "object",
"properties": {
"id": {
- "type": "object"
- },
- "integration": {
- "type": "string"
- },
- "externalId": {
- "type": "string"
- },
- "primaryEmail": {
"type": "string",
- "nullable": true
- },
- "userId": {
- "type": "number",
- "nullable": true
- },
- "eventTypeId": {
- "type": "number",
- "nullable": true
+ "description": "Unique identifier for the role"
},
- "credentialId": {
- "type": "number",
- "nullable": true
- },
- "delegationCredentialId": {
+ "name": {
"type": "string",
- "nullable": true
+ "description": "Name of the role"
},
- "name": {
+ "color": {
"type": "string",
- "nullable": true
+ "nullable": true,
+ "description": "Color for the role (hex code)"
},
- "primary": {
- "type": "boolean"
+ "description": {
+ "type": "string",
+ "nullable": true,
+ "description": "Description of the role"
},
- "readOnly": {
- "type": "boolean"
+ "organizationId": {
+ "type": "number",
+ "nullable": true,
+ "description": "Organization ID this role belongs to"
},
- "email": {
- "type": "string"
+ "type": {
+ "type": "string",
+ "description": "Type of role",
+ "enum": ["SYSTEM", "CUSTOM"]
},
- "integrationTitle": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "integration",
- "externalId",
- "primaryEmail",
- "userId",
- "eventTypeId",
- "credentialId"
- ]
- },
- "ConnectedCalendarsData": {
- "type": "object",
- "properties": {
- "connectedCalendars": {
+ "permissions": {
"type": "array",
+ "description": "Permissions assigned to this role in 'resource.action' format.",
+ "example": ["booking.read", "eventType.create"],
"items": {
- "$ref": "#/components/schemas/ConnectedCalendar"
+ "type": "string",
+ "enum": [
+ "*.*",
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "eventType.create",
+ "eventType.read",
+ "eventType.update",
+ "eventType.delete",
+ "team.create",
+ "team.read",
+ "team.update",
+ "team.delete",
+ "team.invite",
+ "team.remove",
+ "team.listMembers",
+ "team.listMembersPrivate",
+ "team.changeMemberRole",
+ "team.impersonate",
+ "organization.create",
+ "organization.read",
+ "organization.listMembers",
+ "organization.listMembersPrivate",
+ "organization.invite",
+ "organization.remove",
+ "organization.manageBilling",
+ "organization.changeMemberRole",
+ "organization.impersonate",
+ "organization.update",
+ "booking.read",
+ "booking.readOrgBookings",
+ "booking.readRecordings",
+ "booking.update",
+ "insights.read",
+ "workflow.create",
+ "workflow.read",
+ "workflow.update",
+ "workflow.delete",
+ "organization.attributes.read",
+ "organization.attributes.update",
+ "organization.attributes.delete",
+ "organization.attributes.create",
+ "routingForm.create",
+ "routingForm.read",
+ "routingForm.update",
+ "routingForm.delete",
+ "webhook.create",
+ "webhook.read",
+ "webhook.update",
+ "webhook.delete",
+ "watchlist.create",
+ "watchlist.read",
+ "watchlist.update",
+ "watchlist.delete"
+ ]
}
},
- "destinationCalendar": {
- "$ref": "#/components/schemas/DestinationCalendar"
+ "createdAt": {
+ "type": "string",
+ "description": "When the role was created"
+ },
+ "updatedAt": {
+ "type": "string",
+ "description": "When the role was last updated"
}
},
- "required": ["connectedCalendars", "destinationCalendar"]
+ "required": ["id", "name", "type", "permissions", "createdAt", "updatedAt"]
},
- "ConnectedCalendarsOutput": {
+ "CreateOrgRoleOutput": {
"type": "object",
"properties": {
"status": {
@@ -24328,63 +26345,139 @@
"enum": ["success", "error"]
},
"data": {
- "$ref": "#/components/schemas/ConnectedCalendarsData"
+ "$ref": "#/components/schemas/OrgRoleOutput"
}
},
"required": ["status", "data"]
},
- "CreateCalendarCredentialsInput": {
+ "GetOrgRoleOutput": {
"type": "object",
"properties": {
- "username": {
- "type": "string"
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
},
- "password": {
- "type": "string"
+ "data": {
+ "$ref": "#/components/schemas/OrgRoleOutput"
}
},
- "required": ["username", "password"]
+ "required": ["status", "data"]
},
- "DeleteCalendarCredentialsInputBodyDto": {
+ "GetAllOrgRolesOutput": {
"type": "object",
"properties": {
- "id": {
- "type": "integer",
- "example": 10,
- "description": "Credential ID of the calendar to delete, as returned by the /calendars endpoint"
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OrgRoleOutput"
+ }
}
},
- "required": ["id"]
+ "required": ["status", "data"]
},
- "DeletedCalendarCredentialsOutputDto": {
+ "UpdateOrgRoleInput": {
"type": "object",
"properties": {
- "id": {
- "type": "number"
- },
- "type": {
- "type": "string"
+ "color": {
+ "type": "string",
+ "description": "Color for the role (hex code)"
},
- "userId": {
- "type": "number",
- "nullable": true
+ "description": {
+ "type": "string",
+ "description": "Description of the role"
},
- "teamId": {
- "type": "number",
- "nullable": true
+ "permissions": {
+ "type": "array",
+ "description": "Permissions for this role (format: resource.action). On update, this field replaces the entire permission set for the role (full replace). Use granular permission endpoints for one-by-one changes.",
+ "example": ["eventType.read", "eventType.create", "booking.read"],
+ "items": {
+ "type": "string",
+ "enum": [
+ "*.*",
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "eventType.create",
+ "eventType.read",
+ "eventType.update",
+ "eventType.delete",
+ "team.create",
+ "team.read",
+ "team.update",
+ "team.delete",
+ "team.invite",
+ "team.remove",
+ "team.listMembers",
+ "team.listMembersPrivate",
+ "team.changeMemberRole",
+ "team.impersonate",
+ "organization.create",
+ "organization.read",
+ "organization.listMembers",
+ "organization.listMembersPrivate",
+ "organization.invite",
+ "organization.remove",
+ "organization.manageBilling",
+ "organization.changeMemberRole",
+ "organization.impersonate",
+ "organization.update",
+ "booking.read",
+ "booking.readOrgBookings",
+ "booking.readRecordings",
+ "booking.update",
+ "insights.read",
+ "workflow.create",
+ "workflow.read",
+ "workflow.update",
+ "workflow.delete",
+ "organization.attributes.read",
+ "organization.attributes.update",
+ "organization.attributes.delete",
+ "organization.attributes.create",
+ "routingForm.create",
+ "routingForm.read",
+ "routingForm.update",
+ "routingForm.delete",
+ "webhook.create",
+ "webhook.read",
+ "webhook.update",
+ "webhook.delete",
+ "watchlist.create",
+ "watchlist.read",
+ "watchlist.update",
+ "watchlist.delete"
+ ]
+ }
},
- "appId": {
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Name of the role"
+ }
+ }
+ },
+ "UpdateOrgRoleOutput": {
+ "type": "object",
+ "properties": {
+ "status": {
"type": "string",
- "nullable": true
+ "example": "success",
+ "enum": ["success", "error"]
},
- "invalid": {
- "type": "boolean",
- "nullable": true
+ "data": {
+ "$ref": "#/components/schemas/OrgRoleOutput"
}
},
- "required": ["id", "type", "userId", "teamId", "appId", "invalid"]
+ "required": ["status", "data"]
},
- "DeletedCalendarCredentialsOutputResponseDto": {
+ "DeleteOrgRoleOutput": {
"type": "object",
"properties": {
"status": {
@@ -24393,73 +26486,247 @@
"enum": ["success", "error"]
},
"data": {
- "$ref": "#/components/schemas/DeletedCalendarCredentialsOutputDto"
+ "$ref": "#/components/schemas/OrgRoleOutput"
}
},
"required": ["status", "data"]
},
- "CreateOrganizationInput": {
+ "CreateOrgRolePermissionsInput": {
"type": "object",
"properties": {
- "apiKeyDaysValid": {
- "type": "number",
- "minimum": 1,
- "description": "For how many days is managed organization api key valid. Defaults to 30 days.",
- "example": 60,
- "default": 30
- },
- "apiKeyNeverExpires": {
- "type": "boolean",
- "description": "If true, organization api key never expires.",
- "example": true
+ "permissions": {
+ "type": "array",
+ "description": "Permissions to add (format: resource.action)",
+ "example": ["eventType.read", "booking.read"],
+ "items": {
+ "type": "string",
+ "enum": [
+ "*.*",
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "eventType.create",
+ "eventType.read",
+ "eventType.update",
+ "eventType.delete",
+ "team.create",
+ "team.read",
+ "team.update",
+ "team.delete",
+ "team.invite",
+ "team.remove",
+ "team.listMembers",
+ "team.listMembersPrivate",
+ "team.changeMemberRole",
+ "team.impersonate",
+ "organization.create",
+ "organization.read",
+ "organization.listMembers",
+ "organization.listMembersPrivate",
+ "organization.invite",
+ "organization.remove",
+ "organization.manageBilling",
+ "organization.changeMemberRole",
+ "organization.impersonate",
+ "organization.update",
+ "booking.read",
+ "booking.readOrgBookings",
+ "booking.readRecordings",
+ "booking.update",
+ "insights.read",
+ "workflow.create",
+ "workflow.read",
+ "workflow.update",
+ "workflow.delete",
+ "organization.attributes.read",
+ "organization.attributes.update",
+ "organization.attributes.delete",
+ "organization.attributes.create",
+ "routingForm.create",
+ "routingForm.read",
+ "routingForm.update",
+ "routingForm.delete",
+ "webhook.create",
+ "webhook.read",
+ "webhook.update",
+ "webhook.delete",
+ "watchlist.create",
+ "watchlist.read",
+ "watchlist.update",
+ "watchlist.delete"
+ ]
+ }
+ }
+ },
+ "required": ["permissions"]
+ },
+ "GetOrgRolePermissionsOutput": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success"
},
- "name": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "CreateTeamRoleInput": {
+ "type": "object",
+ "properties": {
+ "color": {
"type": "string",
- "minLength": 1,
- "description": "Name of the organization",
- "example": "CalTeam"
+ "description": "Color for the role (hex code)"
},
- "slug": {
+ "description": {
"type": "string",
- "description": "Organization slug in kebab-case - if not provided will be generated automatically based on name.",
- "example": "cal-tel"
+ "description": "Description of the role"
},
- "metadata": {
- "type": "object",
- "description": "You can store any additional data you want here.\nMetadata must have at most 50 keys, each key up to 40 characters.\nValues can be strings (up to 500 characters), numbers, or booleans.",
- "example": {
- "key": "value"
+ "permissions": {
+ "type": "array",
+ "description": "Permissions for this role (format: resource.action). On update, this field replaces the entire permission set for the role (full replace). Use granular permission endpoints for one-by-one changes.",
+ "example": ["eventType.read", "eventType.create", "booking.read"],
+ "items": {
+ "type": "string",
+ "enum": [
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "eventType.create",
+ "eventType.read",
+ "eventType.update",
+ "eventType.delete",
+ "team.read",
+ "team.update",
+ "team.delete",
+ "team.invite",
+ "team.remove",
+ "team.listMembers",
+ "team.listMembersPrivate",
+ "team.changeMemberRole",
+ "team.impersonate",
+ "booking.read",
+ "booking.readTeamBookings",
+ "booking.readRecordings",
+ "booking.update",
+ "insights.read",
+ "workflow.create",
+ "workflow.read",
+ "workflow.update",
+ "workflow.delete",
+ "routingForm.create",
+ "routingForm.read",
+ "routingForm.update",
+ "routingForm.delete",
+ "webhook.create",
+ "webhook.read",
+ "webhook.update",
+ "webhook.delete"
+ ]
}
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Name of the role"
}
},
"required": ["name"]
},
- "ManagedOrganizationWithApiKeyOutput": {
+ "TeamRoleOutput": {
"type": "object",
"properties": {
"id": {
- "type": "number"
+ "type": "string",
+ "description": "Unique identifier for the role"
},
"name": {
"type": "string",
- "minLength": 1
+ "description": "Name of the role"
},
- "slug": {
- "type": "string"
+ "color": {
+ "type": "string",
+ "nullable": true,
+ "description": "Color for the role (hex code)"
},
- "metadata": {
- "type": "object",
- "example": {
- "key": "value"
+ "description": {
+ "type": "string",
+ "nullable": true,
+ "description": "Description of the role"
+ },
+ "teamId": {
+ "type": "number",
+ "nullable": true,
+ "description": "Team ID this role belongs to"
+ },
+ "type": {
+ "type": "string",
+ "description": "Type of role",
+ "enum": ["SYSTEM", "CUSTOM"]
+ },
+ "permissions": {
+ "type": "array",
+ "description": "Permissions assigned to this role in 'resource.action' format.",
+ "example": ["booking.read", "eventType.create"],
+ "items": {
+ "type": "string",
+ "enum": [
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "eventType.create",
+ "eventType.read",
+ "eventType.update",
+ "eventType.delete",
+ "team.read",
+ "team.update",
+ "team.delete",
+ "team.invite",
+ "team.remove",
+ "team.listMembers",
+ "team.listMembersPrivate",
+ "team.changeMemberRole",
+ "team.impersonate",
+ "booking.read",
+ "booking.readTeamBookings",
+ "booking.readRecordings",
+ "booking.update",
+ "insights.read",
+ "workflow.create",
+ "workflow.read",
+ "workflow.update",
+ "workflow.delete",
+ "routingForm.create",
+ "routingForm.read",
+ "routingForm.update",
+ "routingForm.delete",
+ "webhook.create",
+ "webhook.read",
+ "webhook.update",
+ "webhook.delete"
+ ]
}
},
- "apiKey": {
- "type": "string"
+ "createdAt": {
+ "type": "string",
+ "description": "When the role was created"
+ },
+ "updatedAt": {
+ "type": "string",
+ "description": "When the role was last updated"
}
},
- "required": ["id", "name", "apiKey"]
+ "required": ["id", "name", "type", "permissions", "createdAt", "updatedAt"]
},
- "CreateManagedOrganizationOutput": {
+ "CreateTeamRoleOutput": {
"type": "object",
"properties": {
"status": {
@@ -24468,34 +26735,26 @@
"enum": ["success", "error"]
},
"data": {
- "$ref": "#/components/schemas/ManagedOrganizationWithApiKeyOutput"
+ "$ref": "#/components/schemas/TeamRoleOutput"
}
},
"required": ["status", "data"]
},
- "ManagedOrganizationOutput": {
+ "GetTeamRoleOutput": {
"type": "object",
"properties": {
- "id": {
- "type": "number"
- },
- "name": {
+ "status": {
"type": "string",
- "minLength": 1
- },
- "slug": {
- "type": "string"
+ "example": "success",
+ "enum": ["success", "error"]
},
- "metadata": {
- "type": "object",
- "example": {
- "key": "value"
- }
+ "data": {
+ "$ref": "#/components/schemas/TeamRoleOutput"
}
},
- "required": ["id", "name"]
+ "required": ["status", "data"]
},
- "GetManagedOrganizationOutput": {
+ "GetAllTeamRolesOutput": {
"type": "object",
"properties": {
"status": {
@@ -24504,72 +26763,91 @@
"enum": ["success", "error"]
},
"data": {
- "$ref": "#/components/schemas/ManagedOrganizationOutput"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TeamRoleOutput"
+ }
}
},
"required": ["status", "data"]
},
- "PaginationMetaDto": {
+ "UpdateTeamRoleInput": {
"type": "object",
"properties": {
- "totalItems": {
- "type": "number",
- "description": "The total number of items available across all pages, matching the query criteria.",
- "example": 123,
- "minimum": 0
- },
- "remainingItems": {
- "type": "number",
- "description": "The number of items remaining to be fetched *after* the current page. Calculated as: `totalItems - (skip + itemsPerPage)`.",
- "example": 103,
- "minimum": 0
- },
- "returnedItems": {
- "type": "number",
- "description": "The number of items returned in the current page.",
- "example": 10
- },
- "itemsPerPage": {
- "type": "number",
- "description": "The maximum number of items requested per page.",
- "example": 10,
- "minimum": 1
+ "color": {
+ "type": "string",
+ "description": "Color for the role (hex code)"
},
- "currentPage": {
- "type": "number",
- "description": "The current page number being returned.",
- "example": 2,
- "minimum": 1
+ "description": {
+ "type": "string",
+ "description": "Description of the role"
},
- "totalPages": {
- "type": "number",
- "description": "The total number of pages available.",
- "example": 13,
- "minimum": 0
+ "permissions": {
+ "type": "array",
+ "description": "Permissions for this role (format: resource.action). On update, this field replaces the entire permission set for the role (full replace). Use granular permission endpoints for one-by-one changes.",
+ "example": ["eventType.read", "eventType.create", "booking.read"],
+ "items": {
+ "type": "string",
+ "enum": [
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "eventType.create",
+ "eventType.read",
+ "eventType.update",
+ "eventType.delete",
+ "team.read",
+ "team.update",
+ "team.delete",
+ "team.invite",
+ "team.remove",
+ "team.listMembers",
+ "team.listMembersPrivate",
+ "team.changeMemberRole",
+ "team.impersonate",
+ "booking.read",
+ "booking.readTeamBookings",
+ "booking.readRecordings",
+ "booking.update",
+ "insights.read",
+ "workflow.create",
+ "workflow.read",
+ "workflow.update",
+ "workflow.delete",
+ "routingForm.create",
+ "routingForm.read",
+ "routingForm.update",
+ "routingForm.delete",
+ "webhook.create",
+ "webhook.read",
+ "webhook.update",
+ "webhook.delete"
+ ]
+ }
},
- "hasNextPage": {
- "type": "boolean",
- "description": "Indicates if there is a subsequent page available after the current one.",
- "example": true
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Name of the role"
+ }
+ }
+ },
+ "UpdateTeamRoleOutput": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "example": "success",
+ "enum": ["success", "error"]
},
- "hasPreviousPage": {
- "type": "boolean",
- "description": "Indicates if there is a preceding page available before the current one.",
- "example": true
+ "data": {
+ "$ref": "#/components/schemas/TeamRoleOutput"
}
},
- "required": [
- "totalItems",
- "remainingItems",
- "returnedItems",
- "itemsPerPage",
- "currentPage",
- "totalPages",
- "hasNextPage",
- "hasPreviousPage"
- ]
+ "required": ["status", "data"]
},
- "GetManagedOrganizationsOutput": {
+ "DeleteTeamRoleOutput": {
"type": "object",
"properties": {
"status": {
@@ -24578,34 +26856,76 @@
"enum": ["success", "error"]
},
"data": {
+ "$ref": "#/components/schemas/TeamRoleOutput"
+ }
+ },
+ "required": ["status", "data"]
+ },
+ "CreateTeamRolePermissionsInput": {
+ "type": "object",
+ "properties": {
+ "permissions": {
"type": "array",
+ "description": "Permissions to add (format: resource.action)",
+ "example": ["eventType.read", "booking.read"],
"items": {
- "$ref": "#/components/schemas/ManagedOrganizationOutput"
+ "type": "string",
+ "enum": [
+ "role.create",
+ "role.read",
+ "role.update",
+ "role.delete",
+ "eventType.create",
+ "eventType.read",
+ "eventType.update",
+ "eventType.delete",
+ "team.read",
+ "team.update",
+ "team.delete",
+ "team.invite",
+ "team.remove",
+ "team.listMembers",
+ "team.listMembersPrivate",
+ "team.changeMemberRole",
+ "team.impersonate",
+ "booking.read",
+ "booking.readTeamBookings",
+ "booking.readRecordings",
+ "booking.update",
+ "insights.read",
+ "workflow.create",
+ "workflow.read",
+ "workflow.update",
+ "workflow.delete",
+ "routingForm.create",
+ "routingForm.read",
+ "routingForm.update",
+ "routingForm.delete",
+ "webhook.create",
+ "webhook.read",
+ "webhook.update",
+ "webhook.delete"
+ ]
}
- },
- "pagination": {
- "$ref": "#/components/schemas/PaginationMetaDto"
}
},
- "required": ["status", "data", "pagination"]
+ "required": ["permissions"]
},
- "UpdateOrganizationInput": {
+ "GetTeamRolePermissionsOutput": {
"type": "object",
"properties": {
- "name": {
+ "status": {
"type": "string",
- "minLength": 1,
- "description": "Name of the organization",
- "example": "CalTeam"
+ "example": "success"
},
- "metadata": {
- "type": "object",
- "description": "You can store any additional data you want here.\nMetadata must have at most 50 keys, each key up to 40 characters.\nValues can be strings (up to 500 characters), numbers, or booleans.",
- "example": {
- "key": "value"
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "string"
}
}
- }
+ },
+ "required": ["status", "data"]
},
"RoutingFormResponseOutput": {
"type": "object",
diff --git a/packages/features/pbac/domain/models/Role.ts b/packages/features/pbac/domain/models/Role.ts
index f7a1543360b..decbbe3c793 100644
--- a/packages/features/pbac/domain/models/Role.ts
+++ b/packages/features/pbac/domain/models/Role.ts
@@ -39,7 +39,7 @@ export interface CreateRoleData {
export interface UpdateRolePermissionsData {
roleId: string;
- permissions: PermissionString[];
+ permissions?: PermissionString[];
updates?: {
color?: string;
name?: string;
diff --git a/packages/features/pbac/domain/types/permission-registry.ts b/packages/features/pbac/domain/types/permission-registry.ts
index 7511b7ae850..90efdbd3ce9 100644
--- a/packages/features/pbac/domain/types/permission-registry.ts
+++ b/packages/features/pbac/domain/types/permission-registry.ts
@@ -168,6 +168,25 @@ export const getPermissionsForScope = (scope: Scope, isPrivate?: boolean): Permi
return filteredRegistry as PermissionRegistry;
};
+export const getAllPermissionStringsForScope = (scope: Scope): PermissionString[] => {
+ const registry = getPermissionsForScope(scope);
+ return Object.entries(registry).flatMap(([resource, config]) =>
+ Object.keys(config)
+ .filter((k) => k !== "_resource")
+ .map((action) => `${resource}.${action}` as PermissionString)
+ );
+};
+
+const getPermissionSetForScope = (scope: Scope): Set<PermissionString> => {
+ return new Set(getAllPermissionStringsForScope(scope));
+};
+
+export const isValidPermissionStringForScope = (val: unknown, scope: Scope): val is PermissionString => {
+ if (!isValidPermissionString(val)) return false;
+ const allowed = getPermissionSetForScope(scope);
+ return allowed.has(val as PermissionString);
+};
+
// Keep in mind these are on a team/organization level, not a user level
export const PERMISSION_REGISTRY: PermissionRegistry = {
[Resource.All]: {
@@ -514,12 +533,14 @@ export const PERMISSION_REGISTRY: PermissionRegistry = {
category: "attributes",
i18nKey: "pbac_action_read",
descriptionI18nKey: "pbac_desc_view_organization_attributes",
+ scope: [Scope.Organization],
},
[CrudAction.Update]: {
description: "Update organization attributes",
category: "attributes",
i18nKey: "pbac_action_update",
descriptionI18nKey: "pbac_desc_update_organization_attributes",
+ scope: [Scope.Organization],
dependsOn: ["organization.attributes.read"],
},
[CrudAction.Delete]: {
@@ -527,6 +548,7 @@ export const PERMISSION_REGISTRY: PermissionRegistry = {
category: "attributes",
i18nKey: "pbac_action_delete",
descriptionI18nKey: "pbac_desc_delete_organization_attributes",
+ scope: [Scope.Organization],
dependsOn: ["organization.attributes.read"],
},
[CrudAction.Create]: {
@@ -534,6 +556,7 @@ export const PERMISSION_REGISTRY: PermissionRegistry = {
category: "attributes",
i18nKey: "pbac_action_create",
descriptionI18nKey: "pbac_desc_create_organization_attributes",
+ scope: [Scope.Organization],
dependsOn: ["organization.attributes.read"],
},
},
diff --git a/packages/features/pbac/services/role.service.ts b/packages/features/pbac/services/role.service.ts
index 2eecce7ab32..30375e64fec 100644
--- a/packages/features/pbac/services/role.service.ts
+++ b/packages/features/pbac/services/role.service.ts
@@ -91,19 +91,32 @@ export class RoleService {
if (role.type === DomainRoleType.SYSTEM) {
throw new Error("Cannot update default roles");
}
- // Validate permissions
+
+ const permissionChanges = await this.getUpdatePermissionChanges(data);
+
+ return this.repository.update(data.roleId, permissionChanges, {
+ color: data.updates?.color,
+ name: data.updates?.name,
+ });
+ }
+
+ private async getUpdatePermissionChanges(data: UpdateRolePermissionsData) {
+ if (!data.permissions) {
+ return {
+ toAdd: [],
+ toRemove: [],
+ };
+ }
+
const validationResult = this.permissionService.validatePermissions(data.permissions);
+
if (!validationResult.isValid) {
throw new Error(validationResult.error || "Invalid permissions provided");
}
const existingPermissions = await this.repository.getPermissions(data.roleId);
const permissionChanges = this.permissionDiffService.calculateDiff(data.permissions, existingPermissions);
-
- return this.repository.update(data.roleId, permissionChanges, {
- color: data.updates?.color,
- name: data.updates?.name,
- });
+ return permissionChanges;
}
async roleBelongsToTeam(roleId: string, teamId: number) {
diff --git a/packages/platform/libraries/package.json b/packages/platform/libraries/package.json
index 1e75dc1ea96..4eb67fb3cf0 100644
--- a/packages/platform/libraries/package.json
+++ b/packages/platform/libraries/package.json
@@ -83,6 +83,11 @@
"import": "./dist/private-links.js",
"require": "./dist/private-links.cjs",
"types": "./dist/private-links.d.ts"
+ },
+ "./pbac": {
+ "import": "./dist/pbac.js",
+ "require": "./dist/pbac.cjs",
+ "types": "./dist/pbac.d.ts"
}
},
"typesVersions": {
@@ -116,6 +121,9 @@
],
"private-links": [
"dist/private-links.d.ts"
+ ],
+ "pbac": [
+ "dist/pbac.d.ts"
]
}
}
diff --git a/packages/platform/libraries/pbac.ts b/packages/platform/libraries/pbac.ts
new file mode 100644
index 00000000000..649eb5797cc
--- /dev/null
+++ b/packages/platform/libraries/pbac.ts
@@ -0,0 +1,10 @@
+export type { PermissionString } from "@calcom/features/pbac/domain/types/permission-registry";
+export { Scope } from "@calcom/features/pbac/domain/types/permission-registry";
+export { getAllPermissionStringsForScope } from "@calcom/features/pbac/domain/types/permission-registry";
+export { PermissionCheckService } from "@calcom/features/pbac/services/permission-check.service";
+export { FeaturesRepository } from "@calcom/features/flags/features.repository";
+export { RoleService } from "@calcom/features/pbac/services/role.service";
+export type { Role } from "@calcom/features/pbac/domain/models/Role";
+export type { CreateRoleData, UpdateRolePermissionsData } from "@calcom/features/pbac/domain/models/Role";
+export { isValidPermissionString } from "@calcom/features/pbac/domain/types/permission-registry";
+export { isValidPermissionStringForScope } from "@calcom/features/pbac/domain/types/permission-registry";
diff --git a/packages/platform/libraries/vite.config.js b/packages/platform/libraries/vite.config.js
index da6a1981efe..d975221306d 100644
--- a/packages/platform/libraries/vite.config.js
+++ b/packages/platform/libraries/vite.config.js
@@ -3,9 +3,14 @@
import react from "@vitejs/plugin-react";
import { resolve } from "path";
import path from "path";
+import { dirname } from "path";
+import { fileURLToPath } from "url";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = dirname(__filename);
+
// https://vitejs.dev/guide/build.html#library-mode
export default defineConfig({
define: {
@@ -32,6 +37,7 @@ export default defineConfig({
repositories: resolve(__dirname, "./repositories.ts"),
bookings: resolve(__dirname, "./bookings.ts"),
"private-links": resolve(__dirname, "./private-links.ts"),
+ pbac: resolve(__dirname, "./pbac.ts"),
},
name: "calcom-lib",
fileName: "calcom-lib",