https://retellai.com/?utm_source=discord&utm_medium=seo logo
I'm struggling to use custom function calls
# ❓・ai-evy-support
h
@AI Evy I'm struggling to use custom function calls. I set up an integration with an API, and the error displayed states that fields are missing. However, these fields are present in the request body in the debug message. Is there any further way to debug exactly what's happening here?
a
Thanks for tagging me @hxshimr. I'll look through relevant sources and get back to you shortly.
### Answer For debugging custom function calls, here are several troubleshooting steps based on the documentation: Common Configuration Issues: 1. **Parameter Schema Validation**: If you failed to save the custom function, it's likely because the parameters are not valid [(1) ]() . One common mistake is not adding
"type": "object",
to the top level of the JSON schema . 2. **HTTP Method Configuration**: Ensure you've selected the correct HTTP method (GET, POST, PATCH, PUT, DELETE) [(2) ]() [(1) ]() . Parameters are only available for POST, PATCH and PUT requests . 3. **URL Format Issues**: A community user reported that the problem was a trailing slash in their endpoint URL [(3) ]() , which caused Retell to send GET requests instead of POST requests . Request Verification: To verify that requests are coming from Retell, you can check the
X-Retell-Signature
header [(2) ]() [(1) ]() . The value is an encrypted request body using your secret key . Request Structure: Retell sends requests with the following structure : - **Header**:
X-Retell-Signature
for verification and
Content-Type: application/json
- Body (for POST, PUT, PATCH) : Contains
name
(function name) ,
call
(call object with context) , and
args
(function arguments as JSON) Response Requirements: Your response should have a status code between 200-299 to indicate success . The function result is capped at 15,000 characters to prevent overloading the LLM context window . *
Timeout and Retry Logic:* The request will timeout in your specified timeout period, or 2 minutes if not specified . When a request fails, it will be retried up to 2 times . I recommend checking your endpoint URL for trailing slashes, verifying your JSON schema includes the proper
"type": "object"
declaration, and ensuring your server is properly handling the request method you've configured.
​ 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) [[3] Custom Tool Function Call sends a "GET" from Retell to my URL and not a "POST" . Empty request body.](https://discord.com/channels/1186424376300679209/1284824056801132678) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
Found issue - needed to tick only send payload args, as it was automatically sending other stuff