https://retellai.com/?utm_source=discord&utm_medium=seo logo
i have an issue with custom functions
# ❓・ai-evy-support
f
@AI Evy i have an issue with custom functions. Im setting an URL that is public and can be reached out. However, when retell calls the function i get this error
Axios Error: error code: ERR_BAD_REQUEST, error message: Request failed with status code 400 response status: 400 response data: [{"error":"1"},"Invalid parameters"]
Why?
a
Thanks for tagging me @frnk2099. I'll look through relevant sources and get back to you shortly.
### Answer The error you're encountering is likely due to how Retell sends data to your custom function endpoint. Here are the most common causes and solutions: ## Parameter Schema Issues The most common cause of "Invalid parameters" errors is incorrect parameter definition [(1) ]() . When defining parameters for your custom function, you need to provide a JSON schema format, not actual JSON data [(2) ]() . For example, instead of providing actual JSON data in the parameters section, you should define the schema structure [(1) ]() :
Copy code
json
{
 "type": "object",
 "properties": {
 "city": {
 "type": "string",
 "description": "The city of the weather"
 }
 },
 "required": [
 "city"
 ]
}
[(2) ]() ## Request Body Structure When Retell calls your custom function, it sends the data in a specific format [(3) ]() . The request body includes: - `name`: the name of the custom function - `call`: the call object for context - `args`: the arguments for the custom function, as a JSON object Your endpoint might be expecting the parameters at the top level, but Retell sends them nested under the
args
object [(4) ]() . If your API expects the data directly, you may need to use an option that sends only the items you defined in the tool config [(5) ]() . ## Troubleshooting Steps 1. **Verify parameter schema**: Ensure you're using proper JSON schema format, not actual JSON data [(2) ]() [(1) ]() 2. **Check request structure**: Your endpoint should expect the parameters nested under an
args
object [(3) ]() 3. **Validate endpoint**: Test your endpoint independently to ensure it works with the expected request format [(2) ]() If your external API expects a different format than what Retell sends, you may need to create an intermediate API that reformats the request before calling your target endpoint [(1) ]() .
​ To learn more, see the sources I considered: [[1] Custom Function Error 400](https://discord.com/channels/1186424376300679209/1308150652978987129) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[4] Discord message from @benlikescrypto on 2025-07-29](https://discord.com/channels/1186424376300679209/1186462578310910112/1399816863776772307) [[5] Custom Tool call fails](https://discord.com/channels/1186424376300679209/1400798045930651718) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
f
a
Thanks for the follow-up, @frnk2099. I'll get back to you soon.
### Answer I can't see the screenshot you mentioned, but I can help troubleshoot your GET request error based on the Retell AI documentation. For GET requests with custom functions, there are some important considerations: ## Parameter Limitations for GET Requests Parameters are only available for POST, PATCH and PUT requests [(1) ]() [(2) ]() . Since you're using a GET request, you cannot define parameters in the JSON schema format. Instead, you should use query parameters to pass data to your endpoint . ## Query Parameters Setup You can define query parameters that Retell will append to your endpoint URL . Query parameter values can be static or include dynamic variables . ## Request Structure for GET For GET requests, Retell will still send headers including : - `X-Retell-Signature`: encrypted request body using your secret key -
Content-Type: application/json
However, since it's a GET request, the function arguments will be passed as query parameters rather than in the request body. ## Troubleshooting Steps 1. **Remove parameter definitions**: If you have parameters defined in your custom function configuration, remove them since they're not supported for GET requests 2. **Use query parameters instead**: Set up query parameters in your function configuration to pass the needed data 3. **Verify endpoint**: Ensure your endpoint expects the data as query parameters, not in the request body The 400 error suggests your endpoint is receiving data in a format it doesn't expect. Since you're using GET, make sure your API expects query parameters rather than a JSON body.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
f
@AI Evy im testing and im not using parameters, my endpoint is not receiven anytihng, . i'm using this public api that exposses a simple get endpoint, get_package_info and doesnt work
a
Thanks for the follow-up, @frnk2099. I'll get back to you soon.
### Answer Based on the troubleshooting information available, here are the steps to diagnose your GET request issue: ## Verify Your Function Configuration For GET requests, ensure you have properly configured the custom function with these elements [(1) ]() : 1. **Function name**: Use underscores (e.g.,
get_package_info
) 2. **HTTP Method**: Set to GET 3. **Endpoint URL**: Your public API endpoint 4. **Headers**: Any required headers for your API 5. **Query parameters**: If your API needs any query parameters ## Common Issues with GET Requests Since you're getting a 400 error and your endpoint isn't receiving anything, the issue might be: 1. **URL Format**: Ensure your endpoint URL is valid and accessible 2. **Headers**: Retell sends specific headers with requests, which might cause issues if your API doesn't expect them ## Troubleshooting Steps Follow these verification steps [(2) ]() : 1. **Check endpoint accessibility**: Test your public API directly with a simple GET request outside of Retell 2. **Verify URL format**: Ensure there are no trailing slashes or formatting issues that might cause problems 3. **Review server logs**: Check if your endpoint is receiving any requests at all from Retell ## Request Structure for GET When Retell calls your GET endpoint, it will still send headers including authentication and content-type headers [(1) ]() . Some APIs might reject requests with unexpected headers. If your public API is very simple and doesn't expect any special headers, you might need to create a wrapper endpoint that can handle Retell's request format and then call your target API. Without seeing your exact configuration, I'd recommend first testing your pu
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Troubleshooting Guide](https://docs.retellai.com/integrate-llm/troubleshooting) ​
blic API endpoint independently to confirm it works, then comparing what Retell sends versus what your API expects.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.