Skip to content

Commit 3f053b4

Browse files
feat: add Cal.com APIv2 skills for AI agents (calcom#27445)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 73f5192 commit 3f053b4

8 files changed

Lines changed: 2642 additions & 0 deletions

File tree

skills/calcom-api/SKILL.md

Lines changed: 321 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,321 @@
1+
---
2+
name: calcom-api
3+
description: Interact with the Cal.com API v2 to manage scheduling, bookings, event types, availability, and calendars. Use this skill when building integrations that need to create or manage bookings, check availability, configure event types, or sync calendars with Cal.com's scheduling infrastructure.
4+
license: MIT
5+
metadata:
6+
author: calcom
7+
version: "1.0.0"
8+
api-version: "v2"
9+
---
10+
11+
# Cal.com API v2
12+
13+
This skill provides guidance for AI agents to interact with the Cal.com API v2, enabling scheduling automation, booking management, and calendar integrations.
14+
15+
## Base URL
16+
17+
All API requests should be made to:
18+
```
19+
https://api.cal.com/v2
20+
```
21+
22+
## Authentication
23+
24+
All API requests require authentication via Bearer token in the Authorization header:
25+
26+
```
27+
Authorization: Bearer cal_<your_api_key>
28+
```
29+
30+
API keys must be prefixed with `cal_`. You can generate API keys from your Cal.com dashboard under Settings > Developer > API Keys.
31+
32+
## Core Concepts
33+
34+
### Event Types
35+
Event types define bookable meeting configurations (duration, location, availability rules). Each event type has a unique slug used in booking URLs.
36+
37+
### Bookings
38+
Bookings are confirmed appointments created when someone books an event type. Each booking has a unique UID for identification.
39+
40+
### Schedules
41+
Schedules define when a user is available for bookings. Users can have multiple schedules with different working hours.
42+
43+
### Slots
44+
Slots represent available time windows that can be booked based on event type configuration and user availability.
45+
46+
## Common Operations
47+
48+
### Check Available Slots
49+
50+
Before creating a booking, check available time slots:
51+
52+
```http
53+
GET /v2/slots?startTime=2024-01-15T00:00:00Z&endTime=2024-01-22T00:00:00Z&eventTypeId=123&eventTypeSlug=30min
54+
```
55+
56+
Query parameters:
57+
- `startTime` (required): ISO 8601 start of range
58+
- `endTime` (required): ISO 8601 end of range
59+
- `eventTypeId` or `eventTypeSlug`: Identify the event type
60+
- `timeZone`: Timezone for slot display (default: UTC)
61+
62+
Response contains available slots grouped by date.
63+
64+
### Create a Booking
65+
66+
```http
67+
POST /v2/bookings
68+
Content-Type: application/json
69+
70+
{
71+
"start": "2024-01-15T10:00:00Z",
72+
"eventTypeId": 123,
73+
"attendee": {
74+
"name": "John Doe",
75+
"email": "john@example.com",
76+
"timeZone": "America/New_York"
77+
},
78+
"meetingUrl": "https://cal.com/team/meeting",
79+
"metadata": {}
80+
}
81+
```
82+
83+
Required fields:
84+
- `start`: ISO 8601 booking start time
85+
- `eventTypeId`: ID of the event type to book
86+
- `attendee.name`: Attendee's full name
87+
- `attendee.email`: Attendee's email address
88+
- `attendee.timeZone`: Attendee's timezone
89+
90+
### Get Bookings
91+
92+
List bookings with optional filters:
93+
94+
```http
95+
GET /v2/bookings?status=upcoming&take=10
96+
```
97+
98+
Query parameters:
99+
- `status`: Filter by status (upcoming, recurring, past, cancelled, unconfirmed)
100+
- `attendeeEmail`: Filter by attendee email
101+
- `eventTypeId`: Filter by event type
102+
- `take`: Number of results (max 250)
103+
- `skip`: Pagination offset
104+
105+
### Get a Single Booking
106+
107+
```http
108+
GET /v2/bookings/{bookingUid}
109+
```
110+
111+
### Cancel a Booking
112+
113+
```http
114+
POST /v2/bookings/{bookingUid}/cancel
115+
Content-Type: application/json
116+
117+
{
118+
"cancellationReason": "Schedule conflict"
119+
}
120+
```
121+
122+
### Reschedule a Booking
123+
124+
```http
125+
POST /v2/bookings/{bookingUid}/reschedule
126+
Content-Type: application/json
127+
128+
{
129+
"start": "2024-01-16T14:00:00Z",
130+
"reschedulingReason": "Conflict with another meeting"
131+
}
132+
```
133+
134+
### List Event Types
135+
136+
```http
137+
GET /v2/event-types
138+
```
139+
140+
Returns all event types for the authenticated user.
141+
142+
### Get a Single Event Type
143+
144+
```http
145+
GET /v2/event-types/{eventTypeId}
146+
```
147+
148+
### Create an Event Type
149+
150+
```http
151+
POST /v2/event-types
152+
Content-Type: application/json
153+
154+
{
155+
"title": "30 Minute Meeting",
156+
"slug": "30min",
157+
"lengthInMinutes": 30,
158+
"locations": [
159+
{
160+
"type": "integration",
161+
"integration": "cal-video"
162+
}
163+
]
164+
}
165+
```
166+
167+
### List Schedules
168+
169+
```http
170+
GET /v2/schedules
171+
```
172+
173+
### Get Default Schedule
174+
175+
```http
176+
GET /v2/schedules/default
177+
```
178+
179+
### Create a Schedule
180+
181+
```http
182+
POST /v2/schedules
183+
Content-Type: application/json
184+
185+
{
186+
"name": "Working Hours",
187+
"timeZone": "America/New_York",
188+
"isDefault": true,
189+
"availability": [
190+
{
191+
"days": [1, 2, 3, 4, 5],
192+
"startTime": "09:00",
193+
"endTime": "17:00"
194+
}
195+
]
196+
}
197+
```
198+
199+
Days are 0-indexed (0 = Sunday, 1 = Monday, etc.).
200+
201+
### Get Current User
202+
203+
```http
204+
GET /v2/me
205+
```
206+
207+
Returns the authenticated user's profile information.
208+
209+
## Team and Organization Endpoints
210+
211+
For team bookings and organization management, use the organization-scoped endpoints:
212+
213+
### List Organization Teams
214+
215+
```http
216+
GET /v2/organizations/{orgId}/teams
217+
```
218+
219+
### Get Team Event Types
220+
221+
```http
222+
GET /v2/organizations/{orgId}/teams/{teamId}/event-types
223+
```
224+
225+
### Create Team Booking
226+
227+
Team event types support different scheduling modes:
228+
- `COLLECTIVE`: All team members must attend
229+
- `ROUND_ROBIN`: Distributes bookings among team members
230+
231+
## Webhooks
232+
233+
Configure webhooks to receive real-time notifications:
234+
235+
### List Webhooks
236+
237+
```http
238+
GET /v2/webhooks
239+
```
240+
241+
### Create a Webhook
242+
243+
```http
244+
POST /v2/webhooks
245+
Content-Type: application/json
246+
247+
{
248+
"subscriberUrl": "https://your-app.com/webhook",
249+
"triggers": ["BOOKING_CREATED", "BOOKING_CANCELLED"],
250+
"active": true
251+
}
252+
```
253+
254+
Available triggers:
255+
- `BOOKING_CREATED`
256+
- `BOOKING_CANCELLED`
257+
- `BOOKING_RESCHEDULED`
258+
- `BOOKING_CONFIRMED`
259+
- `MEETING_STARTED`
260+
- `MEETING_ENDED`
261+
262+
## Calendar Integration
263+
264+
### List Connected Calendars
265+
266+
```http
267+
GET /v2/calendars
268+
```
269+
270+
### Check Busy Times
271+
272+
```http
273+
GET /v2/calendars/busy-times?startTime=2024-01-15T00:00:00Z&endTime=2024-01-22T00:00:00Z
274+
```
275+
276+
## Error Handling
277+
278+
The API returns standard HTTP status codes:
279+
280+
- `200`: Success
281+
- `201`: Created
282+
- `400`: Bad Request (invalid parameters)
283+
- `401`: Unauthorized (invalid or missing API key)
284+
- `403`: Forbidden (insufficient permissions)
285+
- `404`: Not Found
286+
- `422`: Unprocessable Entity (validation error)
287+
- `500`: Internal Server Error
288+
289+
Error responses include a message field:
290+
291+
```json
292+
{
293+
"status": "error",
294+
"message": "Booking not found"
295+
}
296+
```
297+
298+
## Rate Limiting
299+
300+
The API implements rate limiting. If you exceed the limit, you'll receive a `429 Too Many Requests` response. Implement exponential backoff for retries.
301+
302+
## Pagination
303+
304+
List endpoints support pagination via `take` and `skip` parameters:
305+
306+
- `take`: Number of items to return (default: 10, max: 250)
307+
- `skip`: Number of items to skip
308+
309+
## Best Practices
310+
311+
1. Always check slot availability before creating bookings
312+
2. Store booking UIDs for future reference (cancel, reschedule)
313+
3. Handle timezone conversions carefully - always use ISO 8601 format
314+
4. Implement webhook handlers for real-time booking updates
315+
5. Cache event type data to reduce API calls
316+
6. Use appropriate error handling for all API calls
317+
318+
## Additional Resources
319+
320+
- [Full API Reference](https://cal.com/docs/api-reference/v2)
321+
- [OpenAPI Specification](https://api.cal.com/v2/docs)

0 commit comments

Comments
 (0)