Back

Cal.com API Essential Guide

Aug 16, 20246 minute read

What type of API does Cal.com provide?

Based on the search results, Cal.com has a REST API. The key points are:

  1. Cal.com provides a REST-styled API that gives control over almost the entire Cal.com platform.

  2. The API is described as "REST-styled" multiple times in the search results.

  3. The API exposes resources as simple HTTP endpoints, allowing users to perform operations like creating, modifying, fetching, and removing event types, bookings, availabilities, and other resources.

  4. The API uses conventional HTTP response codes to indicate the success or failure of requests.

  5. API requests are made using standard HTTP methods like GET, POST, and PATCH.

  6. The API responses are encoded in JSON format.

The API supports HTTP versions 1, 1.1, and 2, with HTTP/2 being preferred. It uses TLS versions 1.2 and 1.3 for security. All requests must be encoded as JSON with the Content-Type: application/json header. The API requires authentication using API keys, which can be generated from the Settings > Security section.

Does the Cal.com API have webhooks?

Yes, the official Cal.com API does have webhooks. Here are the key points about Cal.com's webhook functionality:

Webhook Availability

Cal.com offers webhooks as part of their API to allow automation and integration with other apps.

Event Types

You can subscribe to the following event types with Cal.com webhooks:

  • Booking Created
  • Booking Cancelled
  • Booking Rescheduled
  • Booking Rejected
  • Booking Requested
  • Booking Payment Initiated
  • Booking Paid
  • Meeting Started
  • Recording Ready
  • Form Submitted
  • Meeting Ended
  • Instant Meeting Created

Key Features

  • Webhooks can be associated with individual users or event types, including team event types.
  • You can provide a secret key to secure and verify webhook payloads.
  • The webhook payload can be customized.
  • Webhooks are triggered by events rather than requests, allowing real-time notifications.

Setting Up Webhooks

To set up a webhook in Cal.com:

  1. Go to /settings/developer/webhooks
  2. Enter the subscriber URL where the payload will be sent
  3. Select the event triggers you want to listen for
  4. Optionally add a secret key for security
  5. Customize the payload if desired

Use Cases

Common use cases for Cal.com webhooks include:

  • Automating workflows when bookings are scheduled, cancelled, or rescheduled
  • Sending notifications to other systems when meetings start or end
  • Integrating Cal.com data with CRMs, accounting software, or other business tools

In summary, Cal.com's webhook functionality provides a flexible way to integrate Cal.com's scheduling capabilities with other applications and automate workflows based on booking events.

Rate Limits and other limitations

The Cal.com API has the following rate limits:

Rate Limit Details

Cal.com limits the number of API calls you can make over a certain period of time. The rate limits are specified by the following headers in all API responses:

  • X-RateLimit-Limit: The maximum number of requests permitted to make.
  • X-RateLimit-Remaining: The number of requests remaining in the current rate limit window.
  • X-RateLimit-Reset: The time at which the current rate limit window resets in UTC epoch seconds.

Exceeding Rate Limits

When the rate limit is exceeded, an error is returned with the status "429 Too Many Requests". The error response will look like this:

{ "error": { "code": "too_many_requests", "message": "Rate limit exceeded" } }

Key Points to Consider

  • The specific numerical values for the rate limits are not provided in the documentation. The actual limits may vary depending on your account type or subscription level.
  • Rate limits are enforced to ensure fair usage of the API and maintain system stability.
  • It's important to monitor the rate limit headers in API responses to avoid hitting the limits unexpectedly.

Best Practices

  1. Implement proper error handling in your code to catch and handle 429 errors gracefully.
  2. Use exponential backoff and retry mechanisms when encountering rate limit errors.
  3. Monitor your API usage and stay well below the rate limits to avoid disruptions to your application.
  4. If you consistently hit rate limits, consider optimizing your API usage or contacting Cal.com support for potential limit increases.

While the exact numerical values of the rate limits are not specified in the provided documentation, these headers and error responses allow developers to manage their API usage effectively and avoid exceeding the permitted request rates.

Latest API Version

The most recent version of the Cal.com API is not explicitly stated in the provided search results. However, based on the available information, here are the key points to consider:

API Overview

  • The Cal.com API is a REST-styled API that provides full control over the entire Cal.com platform [5].
  • It offers access to all resources available to customers, exposed as simple HTTP endpoints [5].
  • The API is organized around REST principles, with predictable resource-oriented URLs [5].

API Specifications

  • The API accepts JSON-encoded request bodies and returns JSON-encoded responses [1].
  • It uses standard HTTP response codes, authentication, and verbs [1].
  • The API supports HTTP versions 1, 1.1, and 2, with HTTP/2 being preferred [1].
  • TLS versions 1.2 and 1.3 are supported, with resumption [1].

API Access and Authentication

  • All requests must be encoded as JSON with the Content-Type: application/json header [1].
  • Only Application Admins have access to the Admin API key for elevated requests [1].

API Documentation

  • Cal.com provides comprehensive API documentation, including a complete API reference [2].
  • The API gives access to every single data model within the application [2].

Recent Updates

While the search results don't mention a specific version number for the API, they do reference recent Cal.com platform updates:

  • Cal.com v4.0, v4.3, and v4.4 are mentioned, suggesting ongoing development and improvements [4].
  • The platform has seen significant progress, with 2,730 commits and 67 contributors since version 3.0 [4].

Best Practices

  • When using the API, refer to the official documentation for the most up-to-date information on endpoints and usage.
  • Check the API reference for specific details on available routes and functionalities [2].
  • Be aware of any rate limits or versioning information, which may be detailed in the full API documentation.

In conclusion, while the exact version number of the most recent Cal.com API is not provided, the platform and its API are actively maintained and updated. For the most accurate and current information, it's recommended to consult the official Cal.com API documentation directly.

How to get a Cal.com developer account and API Keys?

To get a developer account for Cal.com and create an API integration, you can follow these steps:

1. Sign up for a Cal.com account

First, you need to create a Cal.com account if you don't already have one. You can do this by visiting the Cal.com website and signing up for an account.

2. Choose the appropriate plan

Cal.com offers different plans, including a Platform plan which is recommended for developers who want to start a scheduling business or customize the product extensively. Consider choosing this plan if you need advanced developer features.

3. Generate API keys

Once you have an account:

  1. Log in to your Cal.com account
  2. Go to Settings > Security
  3. Look for the API keys section
  4. Generate a new API key

Make sure to copy and store this API key securely, as you won't be able to recover it later.

4. Explore the developer documentation

Cal.com provides comprehensive developer documentation to help you get started with API integration:

  • Visit the developer docs at cal.dev to learn more about the API and test it without affecting your live data.
  • Review the API reference documentation to understand the available endpoints and resources.

What can you do with the Cal.com API?

Based on the provided search results, here's a list of data models you can interact with using the Cal.com API, along with what is possible for each:

Bookings

  • Create, read, update, and delete (CRUD) booking data
  • Fetch all bookings in an account
  • Automate booking-related flows

Event Types

  • CRUD event type data
  • Modify event type details (e.g., duration)
  • Create secret event types

Users

  • CRUD user data (only available on self-hosted enterprise instances)

Teams

  • CRUD team data

Attendees

  • CRUD data related to who is attending a particular booking
  • Useful for creating events with multiple invitees

Schedules

  • Set out time blocks for availability

Availabilities

  • Map schedules to event types

Booking References

  • Manage booking reference data

Custom Inputs

  • Control which custom inputs are required for event types

Destination Calendars

  • Map bookings for event types to particular calendars

Memberships

  • Control mappings of users to particular roles within teams

Payments

  • Track charges required to book certain events

Selected Calendars

  • Keep track of which calendars should be checked for conflicts

Slots

  • Manage available time slots

Webhooks

  • Set up and manage webhooks for automation

Workflows

  • Manage workflows for tasks like setting SMS and email reminders

Insights

  • Access data for analytics and reporting

Me

  • Manage personal user data

Availability

  • Manage general availability settings

Event References

  • Handle event reference data

API Keys

  • Generate and manage API keys for authentication

This list covers the main data models that can be interacted with using the Cal.com API. The API provides extensive control over almost all aspects of the Cal.com platform, allowing developers to replicate and customize the entire functionality of Cal.com in their own applications.