https://retellai.com/?utm_source=discord&utm_medium=seo logo
how do i send a structured JSON throught the webho...
# ❓・ai-evy-support
h
@AI Evy how do i send a structured JSON throught the webhook without using function calling?
a
Thanks for tagging me @harkxn. I'll look through relevant sources and get back to you shortly.
### Answer --- Based on the available sources, there are two primary ways to send structured JSON through webhooks in Retell AI: ## Inbound Webhook Response For inbound calls, you can return structured JSON in your webhook response [(1) ]() . When Retell sends a POST request to your webhook endpoint, you respond with JSON containing fields like
dynamic_variables
,
metadata
, and
agent_override
. Example response structure [(2) ]() :
Copy code
json
{
  "call_inbound": {
    "override_agent_id": "agent_12345",
    "override_agent_version": 1,
    "dynamic_variables": {
        "customer_name": "John Doe"
    },
    "metadata": {
        "random_id": "12345"
    }
  }
}
This response must return a successful status code (2xx) [(1) ]() . ## Custom Function Webhook For custom functions, you can configure an endpoint URL where Retell will POST structured data [(3) ]() . You can set: - HTTP method (GET, POST, PATCH, PUT, DELETE) - Request headers (optional) - Query parameters (optional) - Request body parameters using JSON schema format (for POST, PATCH, PUT) Your endpoint receives the structured JSON and returns a response :
Copy code
json
{
  "result": "25f and sunny"
}
Both approaches allow you to send and receive structured JSON without requiring function calling logic in your agent configuration. --- **
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Using Patch (Call Update), not passing metadata back to call](https://discord.com/channels/1186424376300679209/1405378389443088444) [[3] 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.
h
so how do i optimkze my retell agent prompt to send that structured JSON?