Steps to create a custom function
When a custom function is called, Retell sends a request (POST, GET, PUT, PATCH, DELETE) to your specified URL with the function name and parameters. You can include headers and query parameters in the request, and extract data from the response.1
Configure function details
Add a name and description for the custom function. The name should be unique and separated with underscore.
For example:

- Name:
get_user_details
- Description:
Get user details based on name and age
2
Select HTTP Method
Choose the HTTP method that Retell will use to send the request to your endpoint. Available methods include:
- GET
- POST
- PATCH
- PUT
- DELETE
3
Add endpoint URL
Add the URL where Retell will send the request to execute your custom function. This has to be a valid URL.
4
Set request headers (optional)
You can define custom headers to include with the request Retell sends to your endpoint.
Header values can be static or include dynamic variables.

5
Set query parameters (optional)
You can define query parameters to include in the request URL that Retell appends to your endpoint.
Query parameter values can be static or include dynamic variables.

6
Define parameters
Define the parameters for the custom function using JSON schema format or JSON form. Only available for POST, PATCH and PUT requests. For guidance, refer to:Example parameter schema:Example JSON form:

7
Set response variables (optional)
Extract values from the API response and save them as dynamic variables for use later in the conversation.For example, you can extract a user’s name from the response and reference it later using 
{{user_name}}
.Example response body
Troubleshooting
If you failed to save the custom function, it is likely because the parameters are not valid. One common mistake is not adding"type": "object",
to the top level of the JSON schema. We recommend clicking one of the examples and update accordingly.
Request & response spec
Retell will send the request to your endpoint with the following request spec. Request- header
X-Retell-Signature
: encrypted request body using your secret key, used to verify the request is from Retell. Read more below.- Content-Type: application/json. This indicates the payload is in JSON format.
- body (in JSON format, for POST, PUT and PATCH request)
name
: the name of the custom function.call
: the call object for you to get more context about the call, it also contains real time transcript up to the time the request is sent. Check out Get Call API for more details about the call object.args
: the arguments for the custom function, as a JSON object.
- string
- buffer
- JSON object
- blob
The function result is capped at 15000 characteres to prevent overloading LLM context window.
Verifying Request is from Retell
To verify that the request is coming from Retell, you can check theX-Retell-Signature
header. The value is a encrypted request body using your secret key.
You can also secure your server from public network by only allowlisting Retell IP addresses:
100.20.5.228