Skip to main content
The Cal.com Platform API supports two authentication methods: API keys for server-to-server communication and OAuth 2.0 for third-party applications.

Authentication Methods

API Keys

Simple authentication for server-to-server integrations

OAuth 2.0

Secure authentication for third-party applications

API Key Authentication

API keys are the simplest way to authenticate with the Platform API. They’re ideal for:
  • Server-to-server integrations
  • Internal tools and scripts
  • Testing and development

Creating an API Key

  1. Log in to your Cal.com account
  2. Navigate to Settings > Security > API Keys
  3. Click Create New API Key
  4. Give your key a descriptive name
  5. Copy the key immediately (it won’t be shown again)

Using API Keys

Include your API key in the Authorization header as a Bearer token:
API keys start with cal_live_ for production and cal_test_ for development environments.

API Key Formats

Example Request with API Key

Refreshing API Keys

You can refresh an API key to generate a new one and invalidate the old one:
Request:
Response:
The old API key will be immediately invalidated. Update all systems using the old key before refreshing.

OAuth 2.0 Authentication

OAuth 2.0 is recommended for third-party applications that need to access Cal.com data on behalf of users. It provides:
  • Secure delegated access
  • User authorization
  • Token-based authentication
  • Scope-based permissions
See the OAuth 2.0 Guide for detailed implementation instructions.

OAuth Flow Overview

1

Register OAuth Client

Create an OAuth client in your Cal.com settings
2

Redirect User to Authorization

Send users to the authorization endpoint
3

Receive Authorization Code

User authorizes and you receive a code
4

Exchange Code for Tokens

Exchange the authorization code for access and refresh tokens
5

Make API Requests

Use the access token to make authenticated requests

Using Access Tokens

Access tokens are used the same way as API keys:

Authentication Guard Types

The Platform API uses different authentication guards for different endpoints:

ApiAuthGuard

Requires valid authentication (API key or OAuth token):

OptionalApiAuthGuard

Authentication is optional but will extract user info if provided:

Authentication Methods Comparison

Security Best Practices

  • Never commit API keys to version control
  • Use environment variables or secure vaults
  • Rotate keys regularly
  • Use different keys for different environments
  • Always use HTTPS for API requests
  • Never send credentials over unencrypted connections
  • Verify SSL certificates
  • Refresh OAuth tokens before they expire
  • Handle token expiration gracefully
  • Store refresh tokens securely
  • Request only the scopes you need
  • Use read-only scopes when possible
  • Review permissions regularly

Error Handling

401 Unauthorized

Returned when authentication credentials are missing or invalid:
Common causes:
  • Missing Authorization header
  • Invalid API key format
  • Expired access token
  • Revoked credentials

403 Forbidden

Returned when the authenticated user lacks permissions:
Common causes:
  • Insufficient OAuth scopes
  • Attempting to access another user’s resources
  • Organization/team permission restrictions

Testing Authentication

Test your authentication setup with a simple request:
Successful authentication returns a 200 status code and your bookings data.

Rate Limits by Authentication Type

See Rate Limits for more details.

Migration from v1 to v2

If you’re migrating from API v1:
  • API keys remain the same
  • Base URL changes from /api/v1 to /v2
  • Add cal-api-version header for version control
  • OAuth 2.0 implementation is new in v2

Next Steps

OAuth 2.0 Guide

Learn how to implement OAuth 2.0

Rate Limits

Understand rate limiting policies

Webhooks

Set up webhook authentication

API Reference

Browse all available endpoints