To connect a voice agent to Cal.com, add two HTTP API tools, one for open times and one for booking, each with its own version header and your key as a Bearer token. To put both tools in one phone agent, use Dograh, the open-source AI voice agent platform, whether you self-host it or use Dograh Cloud.
Key Takeaways
- Cal.com's slots and bookings endpoints each need a different cal-api-version header.
- Slots come back in your time zone, but a booking's start must be UTC.
- In Dograh, the Cal.com key goes straight into a Bearer Token credential.
A booking only exists once Cal.com says it does, so the agent's read-back has to come from Cal.com's reply. We build the two Cal.com tools step by step in Dograh, our open-source AI voice agent platform, and then deal with time zones, taken slots and repeated requests.
What you need before you start
These steps follow the published Dograh and Cal.com docs. Build against a test event type on a calendar nobody books from, and move to production only after the trial calls pass.
Dograh talks to Cal.com over its API, and here the agent calls it directly from two HTTP API tools during the call. A one-click connector would set this up for you, while the API route takes two tool definitions and a prompt, and in exchange you see every request and choose every field that goes out.
On the Cal.com side you need the event type the agent books into and its event type ID, plus an API key. Check that your Cal.com plan includes API access before you build. On the Dograh side you need an agent with one node that handles booking.
The main difference from our post on connecting a voice agent to Google Calendar is the key. Google's tokens are short-lived, so that post puts them behind your own endpoint. A Cal.com API key is fixed, so it can go straight into a Dograh credential, and no code of your own is needed.
Step 1: Store the Cal.com key as a credential
The key goes into Dograh once and both tools reuse it. In Cal.com, create the key under Settings > Security. Live keys start with cal_live_, and Cal.com limits each key to 120 requests a minute, which is plenty for one agent and worth knowing if several share a key.
In Dograh, open Credentials in the sidebar and choose Add Credential. Give it a Name such as "Cal.com live key", pick Bearer Token as the Credential Type and paste the key into Token. Dograh then sends it as an Authorization: Bearer header on every request from a tool that uses this credential, and masks it in test previews.
Keep the key to one agent where you can. If the key leaks, you revoke one key and update one credential, and every tool that uses it picks up the change.
Check: the credential appears on the Credentials page with the type Bearer Token.
Step 2: Add the tool that checks open times
The first tool asks Cal.com which times are free on one day. Open Tools, choose Create Tool and pick External HTTP API. Name it check_open_times, set the HTTP Method to GET and the Endpoint URL to https://api.cal.com/v2/slots, and pick the Cal.com credential on the Authentication tab.
Cal.com's slots endpoint needs the header cal-api-version: 2024-09-04. Add it under Custom Headers with Add Header. Then, on the Parameters tab, add two Preset Parameters, eventTypeId with your event type ID and timeZone with the business's zone, such as America/New_York. Add two LLM Parameters, start and end, described as "The start and end of one day, in UTC, for example 2026-12-08T00:00:00Z". For a business outside UTC, the day runs from local midnight to local midnight, so a New York day is 2026-12-08T05:00:00Z to 2026-12-09T04:59:59Z. A GET sends all four as query parameters.
Keep the window to one day. The agent receives the whole reply, and a week of 15-minute slots is a long list to read into the prompt. The reply is grouped by date, with each slot's start in the zone you asked for, as in this shortened sample:
{
"status": "success",
"data": {
"2026-12-08": [
{ "start": "2026-12-08T10:00:00.000-05:00" },
{ "start": "2026-12-08T14:30:00.000-05:00" }
]
}
}
What this does: It shows two open times on 8 December in New York time, with the
-05:00offset that Step 4 needs. When a day has no free time, Cal.com returnsdataas an empty object,{}.
Slot entries can arrive as plain strings or as objects with start, so run the tool once and write the prompt around the shape your reply uses.
Check: the tool's test run for a day with open times returns a data object keyed by that date.
Step 3: Add the tool that books the time
The second tool creates the booking once the caller has picked a time. Create another External HTTP API tool named book_time, with POST, the Endpoint URL https://api.cal.com/v2/bookings and the same credential. The bookings endpoint needs cal-api-version: 2026-02-25, and a missing or wrong value falls back to an older version of it. If you made this tool by copying the first one, change the header now.
Add LLM Parameters start, name and time_zone, then turn on Tool Body Template on the Parameters tab. The template below sends start, your fixed eventTypeId, the attendee with the caller's name and zone, and the call's ID in metadata:
{
"start": "{{start}}",
"eventTypeId": 123456,
"attendee": {
"name": "{{name}}",
"timeZone": "{{time_zone}}"
},
"metadata": {
"workflow_run_id": "run-{{initial_context.workflow_run_id}}"
}
}
What this does: It books event type 123456 for the caller at the chosen UTC time and tags the booking with this call's run ID. Cal.com answers 201 on success, with the booked
startand a bookingstatusin the reply.
Cal.com accepts only text values in metadata, so the run ID goes in with a short prefix. Cal.com requires only name and timeZone for the attendee. A phoneNumber becomes required when the event type sends SMS reminders, and an email is optional. Spelling an email by voice goes wrong often, so add it only if your flow needs it and the agent reads it back letter by letter. The HTTP API tool page shows the template syntax in full.
Check: a test run with a free UTC time creates one booking in Cal.com. On your first test call, confirm the booking carries the run ID in its metadata.
Open Source Alternative to Vapi / Retell
Self-hosted voice agent platform — no per-minute fees
dograh-hq/dograh
Star on GitHub
Step 4: Get the time zones right
Time zones are where a direct setup can slip. Slots come back in the time zone you ask for, so the agent can say "10 in the morning" straight from 10:00:00.000-05:00. A booking's start must be in UTC, so the same slot goes to Cal.com as 2026-12-08T15:00:00Z.

The agent does that conversion from the offset in the slot string. Write it into the start parameter's description, for example "The chosen slot in UTC. Take the start from check_open_times and remove the offset, so 10:00 at -05:00 becomes 15:00Z." Models handle a stated offset well, but a slot near midnight also changes the date, so test one.
Use the booking as the check. After book_time succeeds, the agent reads back the day and time it offered, and your test confirms the booking appears at that same local time in Cal.com. If a test ever shows the wrong hour, put a few lines of code in front of Cal.com that take the zoned slot and send the UTC value, the same endpoint route the Google Calendar post uses.
Check: a booking made for 10:00 New York time shows at 10:00 in the host's Cal.com calendar set to that zone.
Step 5: Write the booking prompt
The prompt keeps the agent to times Cal.com returned and to what Cal.com said about the booking. Attach both tools to the booking node, under Tools, and write the rules in that node's prompt. The prompt below covers the happy path, an empty day and a failed booking:
Ask which day suits the caller, then call check_open_times for that day.
Offer two of the returned times, spaced apart, in the business's local time.
If the day has no times, offer to check the next day.
When the caller picks one, call book_time with that time in UTC.
If book_time succeeds and the status is accepted, read back the day and time.
If the status is pending, say the request is sent and the host will confirm it.
If book_time returns an error, say that time was just taken and check again.
What this does: It turns each Cal.com answer into one spoken result. An event type that needs the host's approval returns a
pendingbooking, so the agent never calls that a confirmed meeting.
Cal.com lookups take a moment, and each tool's Messages can cover that wait. A line such as "Let me check the calendar" goes under "When the tool starts", and a second line under "While the tool is running" plays if the lookup passes about 3 seconds. Timeout (ms) starts at 5,000 on both tools.
Check: a test call offers two real times, books one and reads back the same day and time that appear in Cal.com.
Join the Dograh Community
Dograh is an OSS alternative to Vapi. Join our Slack community for queries, releases, best practices & community interactions.
Step 6: Handle a taken slot and repeated requests
Another person can book the same time between the offer and the booking. Cal.com runs its own availability conflict checks when a booking arrives, so treat any error from book_time as the time being gone. The agent checks again and offers the next open time, and never sets allowConflicts, which skips those checks for authorized users. Our post on booking Calendly meetings mid-call explains the slot race in more depth.
HTTP API tools do not retry on their own, so Dograh never sends a booking twice behind your back. The model can still call the tool twice in one call, and the workflow_run_id in the booking's metadata lets your team spot a pair from the same call in Cal.com.
When the calendar cannot be reached at all, the agent offers a callback request through a third HTTP API tool that writes to your own system. On Twilio, Telnyx, Plivo, Cloudonix and Asterisk ARI numbers, Transfer Call can pass the caller to your team instead. Dograh calls the destination first and connects the caller only when someone answers.
After the call, Cal.com's own booking webhooks, included on every plan, can tell your other systems about each new booking. For the call itself, a Webhook node posts the outcome with a call_disposition key, retries temporary failures up to five attempts in all, and also fires on calls nobody answered.
Check: book a slot by hand in Cal.com after the agent offers it, then accept it on the call, and the agent says it was taken and offers another time.
Before you ship it
Run the full call on the trial event type first. Book a normal slot, try a day with no times, take a slot by hand mid-call and try a time near midnight in UTC. Each should end in a clear sentence and the right entry in Cal.com, or none.
Then place a real phone call, since times and names are harder to catch on a phone line than in a browser. Open View Trace on each run to see how long each tool took, and in each tool's test run, check that the request headers show the cal-api-version you set.
Where the agent runs changes nothing on the Cal.com side, because both tools call Cal.com's public API. When you self-host Dograh, there is no per-minute platform fee, but servers, model keys and phone minutes still cost money. Dograh Cloud charges a 1¢-a-minute platform fee.
Glossary
- cal-api-version
- The header that picks which version of a Cal.com API v2 endpoint answers. Slots use 2024-09-04 and bookings use 2026-02-25.
- Event type ID
- The number that identifies a Cal.com event type, such as a 30-minute consultation. Both tools send it so slots and bookings match.
- Slot race
- Two people choosing the same open time, where the first booking wins and the second request fails, so the agent checks again.
- Tool Body Template
- The Dograh setting that shapes an HTTP API tool's JSON body, filling values such as {{start}} from the call.

