---
name: cal-com-6562cc35e4bb
description: >-
  Cal.com is an open-source scheduling platform for booking pages, availability and calendar sync, with an embed, a REST API v2 and webhooks. Use when the user wants to add a booking widget to a React or plain site, create event types, list free slots, create, cancel or reschedule bookings through the Cal.com API, verify booking webhooks, set up round-robin team events, or self-host a community edition (Cal.diy) with Docker.
license: Apache-2.0
compatibility: "Node.js 18+ and a Cal.com account with an API key for the API; Docker for self-hosting"
metadata:
  author: terminal-skills
  version: 1.1.0
  category: development
  repository: https://github.com/calcom/cal.com
  tags: "scheduling, calendar, booking, webhooks, api"
---

# Cal.com — Scheduling Infrastructure

## Overview

Cal.com lets people book time on your calendars. You can use it three ways: share a booking link, embed the booker in your site (`@calcom/embed-react`), or drive it from code through API v2 at `https://api.cal.com/v2` and webhooks. Authentication is an API key (`Authorization: Bearer cal_live_...`, created under Settings > Security) or OAuth; Cal.com recommends OAuth for apps that act for other users. API keys are limited to 120 requests per minute.

Two things changed recently. API v2 versions each endpoint family separately through a required `cal-api-version` header, and a wrong or missing value silently selects an older, different shape. The Platform plan no longer takes new signups (since 15 December 2025), so the managed-user and `x-cal-client-id` flows are for existing customers only. Self-hosting now means Cal.diy, an MIT community edition without Teams, Organizations, workflows or SSO.

## Instructions

### Embed in React

```bash
npm install @calcom/embed-react
```

```tsx
// src/components/BookingWidget.tsx
import Cal, { getCalApi } from "@calcom/embed-react";
import { useEffect } from "react";

export function BookingWidget() {
  useEffect(() => {
    (async () => {
      const cal = await getCalApi({ namespace: "discovery-call" });
      cal("ui", {
        theme: "light",
        hideEventTypeDetails: false,
        layout: "month_view",
      });
    })();
  }, []);

  return (
    <Cal
      namespace="discovery-call"
      calLink="maria-lopez/discovery-call"
      style={{ width: "100%", height: "100%", overflow: "scroll" }}
      config={{ layout: "month_view", name: "Dmitri Volkov", email: "dmitri@northwind-logistics.eu" }}
    />
  );
}
```

`calLink` is `maria-lopez/discovery-call` (or `team/sales-eu/product-demo` for a team event). Pass the same `namespace` to `getCalApi` and `<Cal>` when a page has more than one embed. Use `calOrigin` for a self-hosted instance. The package is at 1.5.3 and supports React 18 and 19. Prefilling goes in `config` (`name`, `email`, `notes`, custom field slugs).

### API v2: pick the right version header

Send `cal-api-version` on every call. The values documented today:

| Endpoint family | `cal-api-version` |
|---|---|
| `/v2/bookings` (create, get, cancel, reschedule) | `2026-02-25` |
| `/v2/event-types`, `/v2/teams/{teamId}/event-types` | `2026-06-12` |
| `/v2/slots` | `2024-09-04` |
| `/v2/schedules` | `2024-06-11` |

```typescript
// src/cal/client.ts
const CAL_API_URL = "https://api.cal.com/v2";

export async function calFetch(path: string, version: string, init: RequestInit = {}) {
  const response = await fetch(`${CAL_API_URL}${path}`, {
    ...init,
    headers: {
      "Content-Type": "application/json",
      "cal-api-version": version,
      Authorization: `Bearer ${process.env.CAL_API_KEY}`,
      ...init.headers,
    },
  });
  const body = await response.json();
  if (!response.ok) throw new Error(`Cal.com ${response.status}: ${JSON.stringify(body)}`);
  return body.data;
}
```

Responses are `{ "status": "success", "data": ... }`; the helper returns `data`.

### Event types, slots, bookings

```typescript
// Create an event type. Required fields: title, slug, lengthInMinutes.
const eventType = await calFetch("/event-types", "2026-06-12", {
  method: "POST",
  body: JSON.stringify({
    title: "Discovery Call",
    slug: "discovery-call",
    lengthInMinutes: 30,
    locations: [{ type: "integration", integration: "google-meet" }],
    bookingFields: [
      { field: "custom", type: "shortText", slug: "company", label: "Company", required: true },
      { field: "custom", type: "select", slug: "team-size", label: "Team size",
        options: ["1-10", "11-50", "51-200", "200+"], required: true },
    ],
  }),
});

// Free slots: query is start/end (UTC ISO 8601 or a date), not startTime/endTime.
const slots = await calFetch(
  `/slots?${new URLSearchParams({
    eventTypeId: String(eventType.id),
    start: "2026-11-02",
    end: "2026-11-06",
    timeZone: "Europe/Berlin",
  })}`,
  "2024-09-04",
);
// slots = { "2026-11-02": [{ start: "2026-11-02T09:00:00.000+01:00" }, ...], ... }

// Book one. attendee needs name and timeZone; email is the usual contact.
const booking = await calFetch("/bookings", "2026-02-25", {
  method: "POST",
  body: JSON.stringify({
    eventTypeId: eventType.id,
    start: "2026-11-02T08:00:00Z",
    attendee: { name: "Dmitri Volkov", email: "dmitri@northwind-logistics.eu", timeZone: "Europe/Berlin", language: "en" },
    bookingFieldsResponses: { company: "Northwind Logistics", "team-size": "51-200" },
    metadata: { utm_source: "pricing-page" },
  }),
});

// Rescheduling cancels the old booking and returns a new one with a new uid.
const moved = await calFetch(`/bookings/${booking.uid}/reschedule`, "2026-02-25", {
  method: "POST",
  body: JSON.stringify({ start: "2026-11-03T08:00:00Z", reschedulingReason: "Customer asked for Tuesday" }),
});
// Cancel the new uid; the original one is already cancelled and would be rejected.
await calFetch(`/bookings/${moved.uid}/cancel`, "2026-02-25", {
  method: "POST",
  body: JSON.stringify({ cancellationReason: "Duplicate booking" }),
});
```

`start` is UTC. Custom field values go in `bookingFieldsResponses` keyed by slug. A location of type `integration` only works if that app is already installed on the account (via API only Google Meet, Teams and Zoom can be installed; Cal Video is the default). Rescheduling creates a new booking with a new `uid`. If the event type has seats or recurrence, the cancel and create bodies differ (`seatUid`, `recurrenceCount`); read the booking reference.

### Team round-robin and schedules

Team event types are created at `POST /v2/teams/{teamId}/event-types` (organization and team plan). Scheduling types are lowercase: `collective`, `roundRobin`, `managed`.

```typescript
await calFetch("/teams/4217/event-types", "2026-06-12", {
  method: "POST",
  body: JSON.stringify({
    title: "Product Demo",
    slug: "product-demo",
    lengthInMinutes: 45,
    schedulingType: "roundRobin",
    hosts: [
      { userId: 101 },
      { userId: 102 },
      { userId: 103, mandatory: true },   // fixed host, always attends
    ],
    beforeEventBuffer: 15,
    afterEventBuffer: 10,
    minimumBookingNotice: 120,            // minutes
    slotInterval: 15,
  }),
});

await calFetch("/schedules", "2024-06-11", {
  method: "POST",
  body: JSON.stringify({
    name: "Business Hours",
    timeZone: "America/New_York",
    isDefault: true,
    availability: [{ days: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], startTime: "09:00", endTime: "17:00" }],
    overrides: [{ date: "2026-12-31", startTime: "09:00", endTime: "12:00" }],
  }),
});
```

Days are names, not numbers. An override replaces that date's availability with the given window.

### Webhooks

Create a subscription at `/settings/developer/webhooks` (or per event type): a subscriber URL, triggers, and an optional secret. On Cal.com cloud the URL must be HTTPS and public. The signature is HMAC-SHA256 of the raw body in the `x-cal-signature-256` header.

```typescript
// app/api/cal-webhook/route.ts
import { NextRequest, NextResponse } from "next/server";
import crypto from "node:crypto";

function validSignature(rawBody: string, header: string | null): boolean {
  if (!header) return false;
  const expected = crypto.createHmac("sha256", process.env.CAL_WEBHOOK_SECRET!).update(rawBody).digest("hex");
  const a = Buffer.from(header);
  const b = Buffer.from(expected);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

export async function POST(request: NextRequest) {
  const rawBody = await request.text();
  if (!validSignature(rawBody, request.headers.get("x-cal-signature-256"))) {
    return NextResponse.json({ error: "Invalid signature" }, { status: 401 });
  }
  const event = JSON.parse(rawBody);

  switch (event.triggerEvent) {
    case "BOOKING_CREATED":
      await saveBooking(event.payload.uid, event.payload.attendees[0], event.payload.startTime);
      break;
    case "BOOKING_CANCELLED":
      await markCancelled(event.payload.uid, event.payload.cancellationReason);
      break;
    case "BOOKING_RESCHEDULED":
      await moveBooking(event.payload.rescheduleUid, event.payload.uid, event.payload.startTime);
      break;
    case "MEETING_ENDED":
      await sendFollowUp(event.uid);   // flat payload: no "payload" wrapper
      break;
  }
  return NextResponse.json({ received: true });
}
```

`MEETING_STARTED` and `MEETING_ENDED` have a flat payload (booking fields at the top level next to `triggerEvent`); all other triggers wrap the booking in `payload`. The payload version is in the `x-cal-webhook-version` header. Other triggers include `BOOKING_REQUESTED`, `BOOKING_REJECTED`, `BOOKING_PAID`, `BOOKING_NO_SHOW_UPDATED` and `FORM_SUBMITTED`. For seated events `attendees` holds only the seat that triggered the call.

### Self-hosting (Cal.diy)

The `calcom/cal.com` repository README now points self-hosters to `calcom/cal.diy`: MIT, no Enterprise features, no hosted version, and the maintainers call it unsuitable for production use. Teams, Organizations, Insights and workflows are removed.

```bash
git clone --recursive https://github.com/calcom/cal.diy.git
cd cal.diy
cp .env.example .env
openssl rand -base64 32   # put in NEXTAUTH_SECRET
openssl rand -base64 24   # put in CALENDSO_ENCRYPTION_KEY (32 bytes for AES-256)
docker compose pull
docker compose up -d
```

The image is `calcom/cal.diy` (use the `-arm` tag suffix on ARM). Push notifications need VAPID keys from `npx web-push generate-vapid-keys`. For local development, `yarn dx` starts Postgres in Docker and seeds test users with well-known passwords; never expose that.

## Examples

### Example 1: Demo booking on the pricing page

**User request:** "Put a Cal.com booking widget on our pricing page and prefill the visitor's name and email when they are logged in."

Install `@calcom/embed-react`, render `<Cal calLink="maria-lopez/discovery-call" namespace="discovery-call" config={{ name, email }} />` with the values from the session, and call `getCalApi({ namespace: "discovery-call" })` once to set `theme` and `layout`. The page shows the month view with the visitor's details already filled in; confirmation goes to their email.

### Example 2: Sync bookings into a CRM

**User request:** "When someone books, cancels or moves a call, update our CRM."

Add the route from the Webhooks section, set `CAL_WEBHOOK_SECRET` in the environment and the same value in the Cal.com webhook form, and subscribe to Booking Created, Cancelled, Rescheduled. A test delivery with a wrong secret returns 401; a real booking creates one `saveBooking` call keyed by `payload.uid`, and the response `{ "received": true }` marks it delivered. Use `uid` (not the numeric `bookingId`) as the key, since a reschedule produces a new uid and carries the old one in `rescheduleUid`.

## Guidelines

1. Always send `cal-api-version` and use the value for that endpoint family; otherwise an older shape is returned or the call 404s.
2. Verify `x-cal-signature-256` against the raw request body before parsing; compare buffers of equal length with `timingSafeEqual`.
3. Respond to webhooks quickly with 2xx and do heavy work asynchronously; deduplicate by `uid` and `idempotencyKey`.
4. Keep API keys on the server in environment variables; never ship them to the browser. Prefer OAuth for multi-user apps.
5. Stay under 120 requests per minute per API key; cache slot queries.
6. All times in requests are UTC ISO 8601; pass `timeZone` for display and attendee.
7. For compliance-driven self-hosting, check that Cal.diy has the features you need (no Teams or SSO); the hosted product or an enterprise license is the supported production route.


---
Source attribution: TerminalSkills
Original project: https://github.com/TerminalSkills/skills/blob/3bfbf7f76459d89422eddc0e5f572ad0e6c393c9/skills/cal-com/SKILL.md
License: Apache-2.0
License information: https://www.apache.org/licenses/LICENSE-2.0
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to the Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by the Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding any notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   Copyright 2025 Terminal Skills

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.



# Dave AI resource metadata

Creator / publisher: TerminalSkills
Original project: https://github.com/TerminalSkills/skills/blob/3bfbf7f76459d89422eddc0e5f572ad0e6c393c9/skills/cal-com/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering, Product Management, Sales
Roles: Backend Developer, Customer Success Manager, Growth Product Manager, Product Manager, Technical Product Manager
Specialties: API, Backend, Cross Platform
Tools: Cal.Com
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: fa484ea3d6576d7a263c2d95aa93483b7c42a969a0f72dbdbdf55ebfd38cee13
