curl -X POST https://api.magpipe.ai/functions/v1/cal-com-get-slots \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"date_from": "2024-01-15",
"date_to": "2024-01-22",
"timezone": "America/Los_Angeles"
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/cal-com-get-slots',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
date_from: '2024-01-15',
date_to: '2024-01-22',
timezone: 'America/Los_Angeles'
}),
}
);
const { slots } = await response.json();
console.log('Available slots:', slots);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/cal-com-get-slots',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'date_from': '2024-01-15',
'date_to': '2024-01-22',
'timezone': 'America/Los_Angeles'
}
)
data = response.json()
for date, times in data['slots'].items():
print(f"{date}: {len(times)} slots available")
{
"slots": {
"2024-01-15": [
{ "time": "2024-01-15T09:00:00-08:00" },
{ "time": "2024-01-15T10:00:00-08:00" },
{ "time": "2024-01-15T14:00:00-08:00" },
{ "time": "2024-01-15T15:00:00-08:00" }
],
"2024-01-16": [
{ "time": "2024-01-16T09:00:00-08:00" },
{ "time": "2024-01-16T11:00:00-08:00" }
],
"2024-01-17": []
}
}
{
"error": {
"code": "no_calendar",
"message": "No Cal.com calendar connected. Connect in Apps."
}
}
Calendar
Get Available Calendar Slots
Get available appointment slots from your connected Cal.com calendar
POST
/
cal-com-get-slots
curl -X POST https://api.magpipe.ai/functions/v1/cal-com-get-slots \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"date_from": "2024-01-15",
"date_to": "2024-01-22",
"timezone": "America/Los_Angeles"
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/cal-com-get-slots',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
date_from: '2024-01-15',
date_to: '2024-01-22',
timezone: 'America/Los_Angeles'
}),
}
);
const { slots } = await response.json();
console.log('Available slots:', slots);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/cal-com-get-slots',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'date_from': '2024-01-15',
'date_to': '2024-01-22',
'timezone': 'America/Los_Angeles'
}
)
data = response.json()
for date, times in data['slots'].items():
print(f"{date}: {len(times)} slots available")
{
"slots": {
"2024-01-15": [
{ "time": "2024-01-15T09:00:00-08:00" },
{ "time": "2024-01-15T10:00:00-08:00" },
{ "time": "2024-01-15T14:00:00-08:00" },
{ "time": "2024-01-15T15:00:00-08:00" }
],
"2024-01-16": [
{ "time": "2024-01-16T09:00:00-08:00" },
{ "time": "2024-01-16T11:00:00-08:00" }
],
"2024-01-17": []
}
}
{
"error": {
"code": "no_calendar",
"message": "No Cal.com calendar connected. Connect in Apps."
}
}
Retrieve available time slots for booking appointments through your connected Cal.com calendar integration.
Request Body
string
required
Start date for availability search (YYYY-MM-DD format).Example:
2024-01-15string
required
End date for availability search (YYYY-MM-DD format).Example:
2024-01-22integer
Cal.com event type ID. If not specified, uses your default event type.
string
default:"America/Los_Angeles"
Timezone for the returned slots.Example:
America/New_YorkResponse
object
Object with dates as keys, each containing an array of available times.
curl -X POST https://api.magpipe.ai/functions/v1/cal-com-get-slots \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"date_from": "2024-01-15",
"date_to": "2024-01-22",
"timezone": "America/Los_Angeles"
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/cal-com-get-slots',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
date_from: '2024-01-15',
date_to: '2024-01-22',
timezone: 'America/Los_Angeles'
}),
}
);
const { slots } = await response.json();
console.log('Available slots:', slots);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/cal-com-get-slots',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'date_from': '2024-01-15',
'date_to': '2024-01-22',
'timezone': 'America/Los_Angeles'
}
)
data = response.json()
for date, times in data['slots'].items():
print(f"{date}: {len(times)} slots available")
{
"slots": {
"2024-01-15": [
{ "time": "2024-01-15T09:00:00-08:00" },
{ "time": "2024-01-15T10:00:00-08:00" },
{ "time": "2024-01-15T14:00:00-08:00" },
{ "time": "2024-01-15T15:00:00-08:00" }
],
"2024-01-16": [
{ "time": "2024-01-16T09:00:00-08:00" },
{ "time": "2024-01-16T11:00:00-08:00" }
],
"2024-01-17": []
}
}
{
"error": {
"code": "no_calendar",
"message": "No Cal.com calendar connected. Connect in Apps."
}
}
AI Agent Integration
Your AI agent can automatically check availability and offer times to callers:Caller: "I'd like to schedule an appointment"
Agent: "I'd be happy to help you schedule an appointment.
I have availability this week on Monday at 9am, 10am, 2pm, or 3pm,
and Tuesday at 9am or 11am. Which time works best for you?"
⌘I