https://retellai.com/?utm_source=discord&utm_medium=seo logo
Is there a way to send information in a post reque...
# ❓・ai-evy-support
m
@AI Evy Is there a way to send information in a post request using custom functions?
a
Thanks for tagging me @minus.ace. I'll look through relevant sources and get back to you shortly.
### Answer Yes, you can send information in POST requests using custom functions [(1) ]() [(2) ]() . When you create a custom function, you can select POST as the HTTP method and define parameters that will be sent in the request body . Here's how it works: 1. Configure the HTTP Method You can choose POST (along with PATCH, PUT, DELETE, or GET) when setting up your custom function . 2. Define Parameters For POST requests, you define parameters using JSON schema format . Here's an example parameter schema:
Copy code
json
{
 "type": "object",
 "properties": {
 "city": {
 "type": "string",
 "description": "The city of the weather"
 }
 },
 "required": [
 "city"
 ]
}
[(1) ]() 3. Request Structure When the function is called, Retell sends a POST request to your endpoint with this structure [(1) ]() [(2) ]() : - **Headers**: Include
X-Retell-Signature
for verification and
Content-Type: application/json
- Body (JSON format) : Contains
name
(function name) ,
call
(call context) , and
args
(the function arguments) **Important Note**: Retell doesn't send raw POST body data - it sends structured JSON that includes the function name, call context, and your defined arguments [(3) ]() . Your backend needs to extract the relevant data from this structure and make separate API calls if needed .
​ 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] Retell is NOT sending the payload as the raw POST body](https://discord.com/channels/1186424376300679209/1397379673436196927) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy So if I set the name of the city to paris in the parameters section it will send that information?
a
Thanks for the follow-up, @minus.ace. I'll get back to you soon.
### Answer Yes, when you set the city name to "paris" in the parameters section, that information will be sent to your endpoint when the function is called [(1) ]() [(2) ]() . Here's how it works: when the AI agent calls your custom function, Retell sends a POST request to your endpoint with a JSON body that includes the
args
field containing your parameters . For example, if the agent calls the function with "paris" as the city parameter, your endpoint would receive something like:
Copy code
json
{
  "name": "get_weather",
  "call": { /* call context */ },
  "args": {
    "city": "paris"
  }
}
You can then extract the city value from
content.args.city
in your backend code, as shown in the verification examples :
Copy code
javascript
const content = req.body;
if (content.args.city === "New York") {
  return res.json("25f and sunny") ;
} else {
  return res.json("20f and cloudy") ;
}
[(1) ]() The parameters you define in the JSON schema become the structure for the
args
object that gets sent to your endpoint [(1) ]() [(2) ]() .
​ 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.
m
@AI Evy Is there a way to send application/x-www-form-urlencoded in retell custom functions?
a
Thanks for the follow-up, @minus.ace. I'll get back to you soon.
### Answer Based on the available documentation, custom functions in Retell AI send requests with
Content-Type: application/json
format [(1) ]() . The documentation shows that when a custom function is called, Retell sends a structured JSON payload to your endpoint containing the function name, call context, and parameters . The documentation doesn't specify support for
application/x-www-form-urlencoded
content type. Custom functions are designed to work with JSON-formatted request bodies, where you define parameters using JSON schema format . If you need to send form-encoded data to a third-party API, you would typically: 1. Receive the JSON payload from Retell at your custom function endpoint 2. Extract the needed data from the JSON structure 3. Transform and forward that data to your target API using the required content type from your backend I don't have specific information about configuring alternative content types for custom function requests in the available sources.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.