https://retellai.com/?utm_source=discord&utm_medium=seo logo
- I'm stuck a bit on the book_appointment_cal func...
# ❓・ai-evy-support
r
@AI Evy - I'm stuck a bit on the book_appointment_cal function: an error occurs during the call. The request shows the following error while booking with Postman is successful for the same event https://cdn.discordapp.com/attachments/1302816169367044149/1435618700374839416/retell-error.png?ex=690c9f9a&is=690b4e1a&hm=dd3a8ac2ad85509e87cac8e3aecb688310f9ffd85f39f15f5e0fe07463b5774c&
a
Thanks for tagging me @roman_16864_07881. I'll look through relevant sources and get back to you shortly.
### Answer Based on the sources, there are several common issues with the
book_appointment_cal
function that could cause errors during calls even when Postman requests succeed: Common Cal.com Integration Issues: 1. Date/Time Format Problems - The booking function may fail due to incorrect date and time formatting or timezone handling [(1) ]() . Ensure the time parameter follows the correct ISO 8601 format (e.g., "2025-10-28T16:00:00Z") [(2) ]() . 2. Already Booked Slots - When attempting to book an already occupied time slot, Cal.com returns an error: "User either already has booking at this time or is not available" . This generates an Axios error with status code 400 . 3. Missing usernameList - For multi-host events, you need to include the correct host(s) in the booking request via
usernameList
[(3) ]() . Without proper definition or injection, Retell will leave placeholders unresolved . Configuration Requirements: When setting up the
book_appointment_cal
function, ensure you have [(4) ]() : - Valid Cal.com API Key - Correct Event Type ID - Proper timezone configuration (optional but recommended) The function structure should include [(5) ]() [(6) ]() :
Copy code
json
{
  "type": "book_appointment_cal",
  "name": "book_appointment",
  "description": "Book an annual check up.",
  "cal_api_key": "cal_live_xxxxxxxxxxxx",
  "event_type_id": 60444,
  "timezone": "America/Los_Angeles"
}
​ To learn more, see the sources I considered: [[1] Discord message from @orney_dev on 2025-03-18](https://discord.com/channels/1186424376300679209/1294891368505937952/1351395480189403207) [[2] Book Appointment fails (Axios Error) when there is no availability](https://discord.com/channels/1186424376300679209/1431689539222769704) [[3] Cal.com Appointments](https://discord.com/channels/1186424376300679209/1358842036635173104) [[4] Book Calendar](https://docs.retellai.com/build/book-calendar) [[5] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[6] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) ​
[(5) ]() , [(6) ]() Troubleshooting Steps: 1. Check availability before booking to avoid conflicts [(2) ]() 2. Verify time format and timezone settings [(3) ]() 3. Test with a simple single-host event first 4. Ensure all required parameters (time, name, email, timezone) are properly formatted [(2) ]() Could you share the specific error message from your call logs? This would help identify whether it's a formatting issue, availability conflict, or configuration problem.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
@AI Evy added the log
a
Thanks for the follow-up, @roman_16864_07881. I'll get back to you soon.
### Answer I understand you're experiencing errors with the
book_appointment_cal
function during calls, even though Postman requests work successfully. To help diagnose the issue, I need to see the actual call log you mentioned. However, based on the available documentation, here are the key configuration requirements for the
book_appointment_cal
tool [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() : Required Configuration:
Copy code
json
{
  "type": "book_appointment_cal",
  "name": "book_appointment",
  "description": "Book an annual check up.",
  "cal_api_key": "cal_live_xxxxxxxxxxxx",
  "event_type_id": 60444,
  "timezone": "America/Los_Angeles"
}
[(2) ]() , [(3) ]() , [(4) ]() , [(5) ]() Setup Steps: [(1) ]() 1. Obtain your Cal.com API Key from Settings → Developer → API Keys 2. Get your Event Type ID from the URL when viewing your event type (e.g., the number
1427703
in ` 3. Configure the tool in Retell with these credentials 4. Update your prompt to specify when to invoke the function Prompt Example:
Copy code
When user selected a slot, please book the appointment by calling the `book_appointment` function.
Please share the call log details so I can identify the specific error and provide targeted troubleshooting steps.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @judepatton. I'll get back to you soon.
j
@AI Evy For some reason, the book appointment function is not working, the ai gathers the phone number and email but the appointment doesnt actually book in, what is the problem?
a
### Answer When the AI gathers information but the appointment doesn't actually book, here are the key areas to verify: Configuration Requirements: Ensure your
book_appointment_cal
tool is properly configured with [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() :
Copy code
json
{
  "type": "book_appointment_cal",
  "name": "book_appointment",
  "description": "Book an annual check up.",
  "cal_api_key": "cal_live_xxxxxxxxxxxx",
  "event_type_id": 60444,
  "timezone": "America/Los_Angeles"
}
Critical Setup Steps: [(1) ]() 1. Verify your Cal.com API Key is correct (from Settings → Developer → API Keys) 2. Confirm your Event Type ID matches your Cal.com event (the number in the URL like
1427703
) 3. Check that timezone is properly set (optional but recommended) Prompt Configuration: Your prompt must explicitly instruct when to invoke the booking function :
Copy code
When user selected a slot, please book the appointment by calling the `book_appointment` function.
Common Issues: Based on the thread context, typical problems include: - Date/time format issues - Already booked time slots - Missing or incorrect Cal.com credentials - Timezone mismatches between what the AI collects and what Cal.com expects Since the AI is collecting the information but not completing the booking, check your call logs for the actual error message when the
book_appointment
function is invoked. The error details will indicate whether it's an authentication issue, format problem, or availability conflict. Can you share the specific error from your call logs when the booking attempt occurs?
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy Here is the error: tool_call_id: tool_call_3b0ccb {"error":"Error calling Cal Event Type API: Axios Error: error code: ERR_BAD_REQUEST, error message: Request failed with status code 401\nresponse status: 401\nresponse data: [{\"status\":\"1\",\"timestamp\":\"2\",\"path\":\"3\",\"error\":\"4\"},\"error\",\"2025-11-05T21:42:54.261Z\",\"/v2/event-types/3834663\",{\"code\":\"5\",\"message\":\"6\",\"details\":\"7\"},\"UnauthorizedException\",\"CustomThrottlerGuard - Invalid API Key\",{\"message\":\"6\",\"error\":\"8\",\"statusCode\":401},\"Unauthorized\"]"
a
Thanks for the follow-up, @judepatton. I'll get back to you soon.
### Answer ### Answer The error shows "CustomThrottlerGuard - Invalid API Key" with status code 401, which means your Cal.com API key is incorrect or invalid [(1) ]() [(2) ]() . Solution: 1. Get a fresh Cal.com API Key: [(3) ]() - Go to your Cal.com dashboard - Navigate to "Settings" - Go to "Developer" section - Click on "API Keys" to retrieve or regenerate your API key 2. Update your Retell LLM configuration with the correct API key: [(4) ]() [(5) ]() [(6) ]() [(7) ]()
Copy code
json
{
  "type": "book_appointment_cal",
  "name": "book_appointment",
  "description": "Book an annual check up.",
  "cal_api_key": "cal_live_xxxxxxxxxxxx",
  "event_type_id": 60444,
  "timezone": "America/Los_Angeles"
}
[(4) ]() , [(5) ]() , [(6) ]() , [(7) ]() Key points: - The API key format should be
cal_live_xxxxxxxxxxxx
[(3) ]() [(4) ]() [(5) ]() [(6) ]() [(7) ]() - Make sure you're using the correct Event Type ID (
3834663
in your case) [(3) ]() - The timezone parameter is optional but recommended [(3) ]() [(4) ]() [(5) ]() [(6) ]() [(7) ]() Since your Postman requests work successfully, double-check that the API key in your Retell configuration exactly matches the one you're using in Postman. Even a small difference (extra space, missing character) will cause the 401 error [(2) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy I already did that, the API key is working, it said it's an unauthorized error, so it's just not letting the ai actually book the appointment
a
Thanks for the follow-up, @judepatton. I'll get back to you soon.
retellai.com/api-references/update-retell-llm) [(4) ]() [(5) ]() [(6) ]() :
### Answer --- ### Answer Since you're getting a 401 "Unauthorized" error specifically when the AI tries to book (even though your API key works in Postman) , this points to a permissions issue rather than an invalid key [(1) ]() . Key Insight from Community Experience: A 403 error means "Forbidden" - the API key is valid but lacks permissions for the requested operation . Your 401 error is similar: Cal.com recognizes your key but won't authorize the booking action. Troubleshooting Steps: 1. Verify Event Type ID Permissions [(1) ]() [(2) ]() - Confirm the Event Type ID (
3834663
) is correct - Check that your Cal.com API key has permissions to book appointments for this specific event type - The API key must have write/booking permissions, not just read permissions 2. Check Cal.com API Key Scopes - In Cal.com Settings → Developer → API Keys, verify your key has booking permissions enabled - Some API keys are read-only by default 3. Event Type Configuration [(2) ]() - Ensure the event type exists and is active in your Cal.com account - Verify you're using the correct event type ID (not confusing it with another event) 4. Test Direct Cal.com API Call - Since Postman works, compare the exact headers and authentication method between your Postman request and what Retell sends - Cal.com may require specific authentication headers that differ between check availability and booking operations Configuration Reference: Your
book_appointment_cal
tool should be configured as [(3) ](
Copy code
json
{
  "type": "book_appointment_cal",
  "name": "book_appointment",
  "description": "Book an annual check up.",
  "cal_api_key": "cal_live_xxxxxxxxxxxx",
  "event_type_id": 60444,
  "timezone": "America/Los_Angeles"
}
[(3) ]() , [(4) ]() , [(5) ]() , [(6) ]() Most Likely Cause: Based on community experience, the event type ID is often the culprit [(1) ]() [(2) ]() . Double-check that
3834663
is the correct event type ID and that your API key has explicit permissions to create bookings for that event type. Can you verify in your Cal.com dashboard that this event type ID exists and your API key has booking permissions for it? ---
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
I'm getting an "Error validating Cal.com tools"
a
Thanks for the follow-up, @judepatton. I'll get back to you soon.
### Answer "Error validating Cal.com tools" typically occurs when there's an issue with your Cal.com credentials or event type configuration [(1) ]() . Common Causes: 1. Invalid Event Type ID - The event type ID you entered doesn't exist or was deleted from your Cal.com account . 2. Incorrect API Key - The Cal.com API key is invalid, expired, or doesn't have proper permissions . 3. Round Robin Events - Round robin event types have been reported to cause validation errors . Users have found success by switching to normal (non-round robin) event types . Troubleshooting Steps: 1. Verify Event Type ID [(2) ]() [(3) ]() : - Open your Cal.com event type - Check the URL in your browser - The event type ID is the number in the URL (e.g., in ` the ID is
1427703
) 2. Regenerate API Key : - Go to Cal.com Settings → Developer → API Keys - Generate a new API key - Update it in your Retell configuration 3. Switch Event Type [(1) ]() : - If using a round robin event, try creating a regular event type instead - Round robin events have been problematic for multiple users 4. Check Event Requirements : - Ensure phone number is NOT required in your Cal.com event settings - Retell doesn't send phone numbers to Cal.com, so required phone fields will cause errors Given your earlier 401 error and now this validation error, double-check that your Event Type ID
3834663
still exists in your Cal.com account and that you're using a fresh API key with the correct permissions.
​ To learn more, see the sources I considered: [[1] Cal.com error validating tools](https://discord.com/channels/1186424376300679209/1432750783580999862) [[2] Check Calendar Availability](https://docs.retellai.com/build/check-availability) [[3] Book Calendar](https://docs.retellai.com/build/book-calendar) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.