Get your API key
All integrations Scheduling

Calendly + MailKite

Calendly is a scheduling platform. Use MailKite to receive inbound email and create booking confirmations, reminders, or notifications that route through your own SMTP — ensuring deliverability on your domain.

What you need

  • A verified domain with SPF + DKIM published
  • Your API key (mk_live_…)
  • Calendly account with API access (Professional plan or higher)

How it works

MailKite can receive inbound email (e.g., booking requests, reschedule notifications) and forward them to Calendly's API, or you can use MailKite's SMTP to send Calendly-style notifications from your own domain. The handler parses date/time from the email body to extract booking details.

Set up the webhook

Deploy this handler as a serverless function or worker. It parses booking requests from inbound email and extracts date and time information. Set CALENDLY_API_KEY as an environment variable if calling the Calendly API directly.

calendly-webhook.js
// Calendly-style booking notification handler
// Receives inbound email → creates/updates a Calendly event

const CALENDLY_API = 'https://api.calendly.com';

async function handleInbound(email) {
// Parse booking details from the email
const dateMatch = email.text.match(/(\d{4}-\d{2}-\d{2})/);
const timeMatch = email.text.match(/(\d{2}:\d{2})/);

if (!dateMatch || !timeMatch) {
return { ok: true, skipped: true };
}

// Create a scheduling link or trigger a Calendly workflow
// (Calendly API is primarily for reading events, not creating them)
// Use this to forward booking requests to your team via Slack/email

console.log(`Booking request from ${email.from}: ${dateMatch[1]} ${timeMatch[1]}`);
return { ok: true };
}

Receive inbound email

Configure your MailKite domain's webhook URL to point at your handler. Every inbound email delivers this payload:

  • from — sender address
  • to — recipient address
  • subject — email subject
  • text — plain text body
  • html — HTML body
  • attachments — array of file objects

Test it

test
curl -X POST https://your-worker.example.com/mailkite-inbound \
-H "Content-Type: application/json" \
-d '{"from":"client@example.com","to":"book@yourdomain.com","subject":"Meeting request","text":"Can we meet on 2025-03-15 at 14:00?"}'

Troubleshooting

  • Calendly's API is read-heavy (list events, invitees); for outbound notifications, use MailKite SMTP to send confirmations from your own domain.
  • Ensure the target Calendly email is on your MailKite domain to receive booking notifications.
  • The date regex looks for ISO format (YYYY-MM-DD); adjust it if your booking emails use a different format.

See the SMTP relay docs for connection details, or Inbound webhooks for the full payload.