https://retellai.com/?utm_source=discord&utm_medium=seo logo
I've been working with Retell's custom function an...
# ❓・ai-evy-support
h
@AI Evy I've been working with Retell's custom function and noticed that the current syntax enforces REST-style payloads when sending requests - especially when integrating with platforms like Keragon or Healthie. This has worked well for standard REST APIs, but I’m now looking to integrate a GraphQL-based query (specifically availableSlotsForRange from Healthie’s API) and wanted to clarify a few things: - Does Retell currently support sending GraphQL queries via custom functions? - If so, what’s the recommended syntax or structure for defining the query and variables in the payload? My goal is to dynamically query appointment slots using GraphQL within a Retell agent flow, and I’d love to know the best way to structure this.
a
Thanks for tagging me @hamza-007. I'll look through relevant sources and get back to you shortly.
​ 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) ​
### Answer Based on the available documentation, Retell AI's custom functions support standard HTTP methods including POST, which you can use for GraphQL queries [(1) ]() [(2) ]() . Retell's custom functions allow you to choose from several HTTP methods: GET, POST, PATCH, PUT, and DELETE . For GraphQL queries, you would typically use POST method . However, there's an important consideration about how Retell sends requests. When a custom function is called, Retell doesn't send raw POST body content directly to your endpoint [(3) ]() . Instead, Retell sends a structured payload that includes the tool_call_id, function name, call metadata, full transcript, timestamps, and other context information . For GraphQL integration, you would need to set up your backend server to receive Retell's structured request and then make a separate GraphQL request to your target API (like Healthie) . Your backend would: 1. Receive the structured payload from Retell with the extracted parameters [(1) ]() [(2) ]() 2. Use those parameters to construct and send a proper GraphQL query to Healthie's API 3. Return the response back to Retell You can define parameters for your custom function using JSON schema format, which works for POST, PATCH, and PUT requests . You can also set custom headers and query parameters that can include dynamic variables . The documentation doesn't provide specific examples for GraphQL query structures within custom functions. For detailed GraphQL implementation patterns, you might want to check out the additional resources or c
ontact support for more specific guidance on GraphQL integration best practices.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.