https://retellai.com/?utm_source=discord&utm_medium=seo logo
Is it possible to send a POST request with a desti...
# ❓・ai-evy-support
b
@AI Evy Is it possible to send a POST request with a destination number (to_number) in a flow conversion function?
a
Thanks for tagging me @boroca.guy_67514. I'll look through relevant sources and get back to you shortly.
### Answer Yes, you can send a POST request with a destination number in a conversation flow custom function [(1) ]() [(2) ]() . When configuring a custom function in conversation flow, you can: 1. Select POST as the HTTP method [(1) ]() 2. Define parameters using JSON schema format that can include the destination number [(1) ]() [(2) ]() 3. Use dynamic variables in your request body, headers, or query parameters [(1) ]() The request body for POST requests is sent in JSON format [(2) ]() . When Retell sends the request to your endpoint, it includes the
call
object in the body, which contains call details including phone numbers . For example, you can access call information like this in your custom function:
Copy code
json
{
  "name": "your_function_name",
  "call": {
    "from_number": "+12137771234",
    "to_number": "+12137771235"
  },
  "args": {
    "your_parameters": "values"
  }
}
You can then extract the
to_number
from the call object in your backend when processing the POST request . **
​ 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.
b
@AI Evy Is it possible to send a POST request with a destination number (to_number) in a flow conversion function? Consider a case where I don't know the destination number, perhaps a variable.
a
Thanks for the follow-up, @boroca.guy_67514. I'll get back to you soon.
​ 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) ​
### Answer Yes, you can send a POST request with a dynamic destination number in a conversation flow custom function [(1) ]() [(2) ]() . Custom functions support dynamic variables in several places [(1) ]() : - Request headers - Query parameters - Request body parameters (for POST, PATCH, and PUT requests) When you define parameters for your custom function using JSON schema format, you can include a parameter for the destination number [(1) ]() [(2) ]() . The parameter values can be static or include dynamic variables [(1) ]() . For example, you could define a parameter schema like this :
Copy code
json
{
  "type": "object",
  "properties": {
    "city": {
      "type": "string",
      "description": "The city of the weather"
    }
  },
  "required": [
    "city"
  ]
}
You can adapt this structure to include a
destination_number
or
to_number
parameter that accepts dynamic values collected during the conversation. When Retell sends the POST request to your endpoint, it includes [(2) ]() : - The function name - The call object (which contains call details) - The args (your defined parameters as a JSON object) The request body is sent in JSON format , and you can extract the dynamic destination number from the
args
in your backend when processing the request. **
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.