https://retellai.com/?utm_source=discord&utm_medium=seo logo
For custom functions, how do we POST a body
# ❓・ai-evy-support
j
@AI Evy For custom functions, how do we POST a body? I only see options for header and Query params
a
Thanks for tagging me @Jeremy. I'll look through relevant sources and get back to you shortly.
### Answer To POST a body with custom functions, you need to define parameters using JSON schema format or JSON form. [(1) ]() The body parameters are only available for POST, PATCH, and PUT requests. Here's how to set it up: 1. Make sure you've selected POST (or PATCH/PUT) as your HTTP method 2. Look for the "Define parameters" section — this is where you configure the request body Example parameter schema for the body:
Copy code
json
{
  "type": "object",
  "required": [
    "order_id"
  ],
  "properties": {
    "name": {
      "type": "object",
      "description": "",
      "properties": {
        "first_name": {
          "type": "string",
          "description": "User first name"
        },
        "last_name": {
          "type": "string",
          "const": "{{last_name}}"
        }
      }
    },
    "order_id": {
      "type": "number",
      "const": 1234
    }
  }
}
Key notes: - Use
"const"
for fixed values that should be applied directly - Use
"description"
for values the LLM should resolve dynamically - You can also use dynamic variables like
{{last_name}}
in const values If you're not seeing the parameters section, double-check that your HTTP method is set to POST, PATCH, or PUT — the parameter definition is only available for these methods.
​ 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.