curl -X POST https://api.magpipe.ai/functions/v1/cal-com-create-booking \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"start_time": "2024-01-15T14:00:00-08:00",
"name": "John Smith",
"email": "john@example.com",
"phone": "+14155551234",
"notes": "Interested in dental cleaning"
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/cal-com-create-booking',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
start_time: '2024-01-15T14:00:00-08:00',
name: 'John Smith',
email: 'john@example.com',
phone: '+14155551234',
notes: 'Interested in dental cleaning'
}),
}
);
const booking = await response.json();
console.log('Booked:', booking.uid);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/cal-com-create-booking',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'start_time': '2024-01-15T14:00:00-08:00',
'name': 'John Smith',
'email': 'john@example.com',
'phone': '+14155551234',
'notes': 'Interested in dental cleaning'
}
)
booking = response.json()
print(f"Booked: {booking['uid']}")
{
"booking_id": 123456,
"uid": "bkg_a1b2c3d4e5f6",
"start_time": "2024-01-15T14:00:00-08:00",
"end_time": "2024-01-15T15:00:00-08:00",
"attendee": {
"name": "John Smith",
"email": "john@example.com"
},
"status": "confirmed",
"meeting_url": null
}
{
"error": {
"code": "slot_unavailable",
"message": "This time slot is no longer available"
}
}
Calendar
Create Calendar Booking
Book an appointment on your connected Cal.com calendar
POST
/
cal-com-create-booking
curl -X POST https://api.magpipe.ai/functions/v1/cal-com-create-booking \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"start_time": "2024-01-15T14:00:00-08:00",
"name": "John Smith",
"email": "john@example.com",
"phone": "+14155551234",
"notes": "Interested in dental cleaning"
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/cal-com-create-booking',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
start_time: '2024-01-15T14:00:00-08:00',
name: 'John Smith',
email: 'john@example.com',
phone: '+14155551234',
notes: 'Interested in dental cleaning'
}),
}
);
const booking = await response.json();
console.log('Booked:', booking.uid);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/cal-com-create-booking',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'start_time': '2024-01-15T14:00:00-08:00',
'name': 'John Smith',
'email': 'john@example.com',
'phone': '+14155551234',
'notes': 'Interested in dental cleaning'
}
)
booking = response.json()
print(f"Booked: {booking['uid']}")
{
"booking_id": 123456,
"uid": "bkg_a1b2c3d4e5f6",
"start_time": "2024-01-15T14:00:00-08:00",
"end_time": "2024-01-15T15:00:00-08:00",
"attendee": {
"name": "John Smith",
"email": "john@example.com"
},
"status": "confirmed",
"meeting_url": null
}
{
"error": {
"code": "slot_unavailable",
"message": "This time slot is no longer available"
}
}
Create a new appointment booking through your connected Cal.com calendar. The booking will be added to your calendar and the attendee will receive a confirmation email.
Request Body
string
required
Appointment start time in ISO 8601 format. Must be an available slot.Example:
2024-01-15T14:00:00-08:00string
required
Attendee’s full name.Example:
John Smithstring
required
Attendee’s email address for confirmation.Example:
john@example.comstring
Attendee’s phone number.Example:
+14155551234string
Additional notes or reason for appointment.Example:
Interested in dental cleaninginteger
Cal.com event type ID. Uses default if not specified.
string
default:"America/Los_Angeles"
Attendee’s timezone.
Response
integer
Cal.com booking ID.
string
Unique booking identifier.
string
Confirmed start time.
string
Confirmed end time.
string
Video meeting URL (if applicable).
curl -X POST https://api.magpipe.ai/functions/v1/cal-com-create-booking \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"start_time": "2024-01-15T14:00:00-08:00",
"name": "John Smith",
"email": "john@example.com",
"phone": "+14155551234",
"notes": "Interested in dental cleaning"
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/cal-com-create-booking',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
start_time: '2024-01-15T14:00:00-08:00',
name: 'John Smith',
email: 'john@example.com',
phone: '+14155551234',
notes: 'Interested in dental cleaning'
}),
}
);
const booking = await response.json();
console.log('Booked:', booking.uid);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/cal-com-create-booking',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'start_time': '2024-01-15T14:00:00-08:00',
'name': 'John Smith',
'email': 'john@example.com',
'phone': '+14155551234',
'notes': 'Interested in dental cleaning'
}
)
booking = response.json()
print(f"Booked: {booking['uid']}")
{
"booking_id": 123456,
"uid": "bkg_a1b2c3d4e5f6",
"start_time": "2024-01-15T14:00:00-08:00",
"end_time": "2024-01-15T15:00:00-08:00",
"attendee": {
"name": "John Smith",
"email": "john@example.com"
},
"status": "confirmed",
"meeting_url": null
}
{
"error": {
"code": "slot_unavailable",
"message": "This time slot is no longer available"
}
}
AI Agent Booking Flow
Your AI agent can book appointments automatically during calls:Agent: "I have 2pm available on Monday. Should I book that for you?"
Caller: "Yes, please"
Agent: "Great! What's your email address so I can send you a confirmation?"
Caller: "john@example.com"
Agent: "Perfect. I've booked your appointment for Monday at 2pm.
You'll receive a confirmation email at john@example.com.
Is there anything else I can help you with?"