Recommended: Use the Cal.com CLI
For agents that can execute commands on a machine, use the official Cal.com CLI instead of calling the API directly. The CLI handles authentication, versioning, and common workflows automatically.- npm
- curl
--help flags on all commands to learn about available options:
Only fall back to the API approach below if your agent cannot install or execute the CLI on its machine.
Overview
Cal.com API v2 enables AI agents to:- Check availability - Query available time slots for any user or team
- Create bookings - Schedule meetings on behalf of users
- Manage event types - Create and configure different meeting types
- Handle rescheduling and cancellations - Modify existing bookings
- Manage schedules - Set and update user availability
- Track credit usage - Check balances and charge credits for agent interactions
Authentication
AI agents should authenticate using an API key. Generate one in Settings → Developer → API Keys.Common workflows
1. Check availability
Query available slots using username and event slug—no need to look up IDs first:2. Create a booking
Schedule a meeting using username and event slug. This is the most common pattern for AI agents that extract scheduling intent from natural language (e.g., “book 15min with bailey”):The booking creation endpoint is public and does not require authentication. This allows agents to book on behalf of external users.
3. Handle custom booking questions
Most Cal.com users have required questions on their booking pages (e.g., “What is this meeting about?”). If you omit required fields, the API returns a 400 error. Include responses inbookingFieldsResponses:
4. Instant bookings for urgent requests
For teams handling urgent requests, use theinstant flag to bypass normal scheduling and immediately ring available team members:
Instant bookings require the event type to be configured for instant meetings. This is ideal for AI agents routing urgent customer requests.
5. Get user’s event types
Retrieve available event types to offer booking options:6. Reschedule a booking
Move an existing booking to a new time:7. Cancel a booking
Credit management
If your AI agent runs on the Cal.com platform, you can track usage by checking and charging credits through the API. This is useful for metering agent interactions against your account’s credit balance.Check available credits
Before performing a billable action, verify that the user or team has sufficient credits:balance object breaks down your remaining credits:
monthlyRemaining— credits included in your current billing cycleadditional— purchased credits outside the monthly allowance
Charge credits
After a completed agent interaction, charge the appropriate number of credits:| Parameter | Required | Description |
|---|---|---|
credits | Yes | Number of credits to charge (minimum 1) |
creditFor | Yes | Usage type — use AI_AGENT for agent interactions |
externalRef | No | Unique reference string for idempotency. Prevents double-charging if the same request is retried. |
Example: check-then-charge pattern
Best practices for AI agents
Handle time zones correctly
Always specify time zones explicitly. Store user preferences and pass them in requests:Implement retry logic
API requests may occasionally fail. Implement exponential backoff:Validate availability before booking
Always check slots before attempting to create a booking to avoid conflicts:Use webhooks for real-time updates
Configure webhooks to receive notifications when bookings are created, rescheduled, or cancelled:Rate limits
API key authentication allows 120 requests per minute by default. Contact support if you need higher limits for production agents.API reference
For complete endpoint documentation, see the API v2 Reference. Key endpoints for agents:| Endpoint | Description |
|---|---|
GET /v2/slots | Check available time slots |
POST /v2/bookings | Create a new booking |
POST /v2/bookings/:uid/reschedule | Reschedule a booking |
POST /v2/bookings/:uid/cancel | Cancel a booking |
GET /v2/event-types | List event types |
GET /v2/schedules | Get user schedules |
POST /v2/webhooks | Configure webhooks |
GET /v2/credits/available | Check credit balance |
POST /v2/credits/charge | Charge credits for usage |