https://retellai.com/?utm_source=discord&utm_medium=seo logo
I'm trying to make a custom function, a book appoi...
# ❓・ai-evy-support
s
@AI Evy I'm trying to make a custom function, a book appointment cal, to be specific. But everytime i press "save function" it gives me an error code; "Error. Failed request with status code 400" and I cant figure out why it keeps on giving me that error
a
Thanks for tagging me @Salty. I'll look through relevant sources and get back to you shortly.
### Answer The 400 error when saving a custom function for booking appointments typically indicates an issue with the JSON configuration. Here are the most common causes and solutions: Verify Your Parameter Schema When defining parameters for POST, PATCH, or PUT requests, ensure your JSON schema includes
"type": "object"
at the top level [(1) ]() [(2) ]() . A common mistake is omitting this required field [(2) ]() . Example of correct parameter schema:
Copy code
json
{
 "type": "object",
 "properties": {
 "city": {
 "type": "string",
 "description": "The city of the weather"
 }
 },
 "required": [
 "city"
 ]
}
[(1) ]() Check Your Cal.com Configuration If you're using the built-in Cal.com function, verify: - Your Cal.com API key is correct and not expired [(3) ]() - The event type ID is accurate - The timezone is properly formatted Troubleshooting Steps If the function still fails to save, the parameters are likely not valid [(2) ]() . You can: 1. Use a JSON validator to check your configuration [(4) ]() 2. Click one of the example functions in the dashboard and update accordingly [(2) ]() 3. Ensure your JSON includes all required fields:
llm_id
,
version
,
general_prompt
,
general_tools
,
states
,
starting_state
, and
last_modification_timestamp
[(4) ]() Community-Reported Workaround Some users have resolved this by recreating the agent from scratch, particularly when working with Retell agent templates [(3) ]() . If you continue experiencing issues after checking these items, I'd recommend sharing your JSON configuration (with sensitive data removed) so we can identify the specific validation error.
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[3] Failed to update client: Request failed status code 400](https://discord.com/channels/1186424376300679209/1296487004464222391) [[4] Request failed with status code 400](https://discord.com/channels/1186424376300679209/1379532913703391384) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.