https://retellai.com/?utm_source=discord&utm_medium=seo logo
Why did the cal
# ❓・ai-evy-support
j
@AI Evy Why did the cal.com booking integration fail to book, even though it was successful in finding availabilties? The API key and event ID are correct.
a
Thanks for tagging me @joyful_chipmunk_03581. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, there are a few common causes for Cal.com booking failures even when availability checks succeed: Location Parameter Structure Issue The most common cause is incorrect location parameter formatting in the booking request [(1) ]() . The API requires explicitly passing
location.type
and
location.integration
in the correct structure . Users have reported that detailed prompting to ensure the correct API structure for the location field resolved their booking errors . Prompt Configuration Make sure your prompt explicitly instructs when to call the booking function [(2) ]() . For example:
Copy code
When user selected a slot, please book the appointment by calling the `book_appointment` function.
Function Setup Verification Verify your Cal.com integration includes all required fields : - Tool name (must be unique within the agent) - API Key from Cal.com - Event Type ID - Tool description - Optional: timezone parameter Error Pattern The error pattern you're experiencing matches reported issues where the booking integration throws errors like
ERR_BAD_REQUEST
with status code 400, even when availability checks work correctly [(1) ]() . If you've confirmed your API key and event ID are correct, focus on ensuring your prompt explicitly instructs the agent on the exact structure needed for the location parameters when making the booking call .
​ To learn more, see the sources I considered: [[1] Cal.com booking errors](https://discord.com/channels/1186424376300679209/1377380250954105064) [[2] 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.
j
@User Could it be because one of the calendar functions had a time zone inputted while the other didn't?
@AI Evy Could it be because one of the calendar functions had a time zone inputted while the other didn't?
@AI Evy Could it be because one of the calendar functions had a time zone inputted while the other didn't?
a
Thanks for the follow-up, @joyful_chipmunk_03581. I'll get back to you soon.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer Yes, timezone inconsistency between calendar functions could definitely cause booking failures [(1) ]() . According to community reports, when the
book_appointment
function is set to one timezone (e.g., Australia/Brisbane) and Cal.com is also configured to that same timezone, but the call still defaults to a different timezone (e.g., America/Los Angeles) , this mismatch can prevent successful bookings . Recommended Solutions: 1. Include timezone in your prompt - Explicitly state in your agent's prompt which timezone should be used when sending booking requests to Cal.com . 2. Ensure consistency across all functions - Make sure both your availability check function and booking function use the same timezone parameter . 3. Use custom functions for more control - If the timezone issue persists with preset tools, consider using custom functions with automation tools to gain more precise control over timezone variables . The timezone parameter is optional in Cal.com integration setup, but inconsistent timezone handling between checking availability and actually booking can cause the booking to fail even when slots appear available. **
​ To learn more, see the sources I considered: [[1] Time Zone Issue](https://discord.com/channels/1186424376300679209/1344216990830559263) ​