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
- Log in to your Cal.com account
- Navigate to Settings > Security > API Keys
- Click Create New API Key
- Give your key a descriptive name
- Copy the key immediately (it won’t be shown again)
Using API Keys
Include your API key in theAuthorization 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: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
OAuth Flow Overview
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
| Feature | API Keys | OAuth 2.0 |
|---|---|---|
| Use Case | Server-to-server | Third-party apps |
| Setup Complexity | Simple | Moderate |
| User Authorization | Not required | Required |
| Token Expiration | Optional | Automatic |
| Scope-based Permissions | No | Yes |
| Best For | Internal integrations | Public applications |
Security Best Practices
Store Credentials Securely
Store Credentials Securely
- Never commit API keys to version control
- Use environment variables or secure vaults
- Rotate keys regularly
- Use different keys for different environments
Use HTTPS Only
Use HTTPS Only
- Always use HTTPS for API requests
- Never send credentials over unencrypted connections
- Verify SSL certificates
Implement Token Refresh
Implement Token Refresh
- Refresh OAuth tokens before they expire
- Handle token expiration gracefully
- Store refresh tokens securely
Limit Scope and Permissions
Limit Scope and Permissions
- 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:- Missing
Authorizationheader - Invalid API key format
- Expired access token
- Revoked credentials
403 Forbidden
Returned when the authenticated user lacks permissions:- Insufficient OAuth scopes
- Attempting to access another user’s resources
- Organization/team permission restrictions
Testing Authentication
Test your authentication setup with a simple request:Rate Limits by Authentication Type
| Authentication Method | Default Limit | Time Window |
|---|---|---|
| API Key | 120 requests | 60 seconds |
| OAuth Client | 500 requests | 60 seconds |
| Access Token | 500 requests | 60 seconds |
| Unauthenticated (IP) | 120 requests | 60 seconds |
Migration from v1 to v2
If you’re migrating from API v1:- API keys remain the same
- Base URL changes from
/api/v1to/v2 - Add
cal-api-versionheader 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