https://retellai.com/?utm_source=discord&utm_medium=seo logo
I'm having an issue where I try to update a custom...
# ❓・ai-evy-support
h
@AI Evy I'm having an issue where I try to update a custom function for an agent and the update won't save and I get error 400.
a
Thanks for tagging me @hopper_butcher. I'll look through relevant sources and get back to you shortly.
### Answer The Error 400 when updating custom functions is almost always caused by an invalid function schema. [(1) ]() Common causes: 1. Missing
"type": "object"
at the top level
- Your parameters must include this at the top level of the JSON schema. 2. Not removing the JSON schema after removing parameters - If you remove parameters but don't update the corresponding JSON schema, this can cause the error. [(2) ]() 3. Updating too frequently - If you update the function too quickly in succession, it may show Error 400 even if you didn't change anything. Correct parameter format: [(1) ]()
Copy code
json
{
  "type": "object",
  "properties": {
    "city": {
      "type": "string",
      "description": "City to look up."
    },
    "units": {
      "type": "string",
      "enum": ["metric", "imperial"]
    }
  },
  "required": ["city"]
}
Try verifying your JSON schema includes
"type": "object"
at the top level and ensure your schema matches your defined parameters. [(1) ]() [(1) ]()
​ To learn more, see the sources I considered: [[1] 400 error when creating new Custom functions in multi-state agents.](https://discord.com/channels/1186424376300679209/1389298560268374149) [[2] Issue creating function Error 400](https://discord.com/channels/1186424376300679209/1415753289714237460) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.