When to use a custom function
Reach for a custom function whenever the agent needs live data from your systems, or has to take an action there, in the middle of a call:- Look up real-time data — order status, appointment slots, account details, shipment tracking.
- Take an action in your backend — create a support ticket, update a record, send a confirmation.
- Branch on your own logic — call an endpoint that decides what the agent should do next.
Example: order status lookup
A retail support agent needs to tell callers where their order is. You add aget_order_status custom function pointed at https://api.yourstore.com/orders. When a caller gives their order number, the agent calls the function with that number, your API returns the status and delivery date, and the agent reads it back: “Your order shipped yesterday and arrives Thursday.” No human has to look it up.
Create a custom function
The agent calls a custom function whenever your prompt and the function’s description tell it to. When it does, Retell sends a request to your URL with the function’s arguments and waits for your response before continuing.Add a custom function

Name and describe it
get_order_status), and a clear description. The agent reads the description to decide when to call the function, so be specific about what it does and when to use it.
- Name:
get_user_details - Description:
Get user details based on name and age
Choose the HTTP method
Add the endpoint URL
Set a timeout (optional)
120000 (2 minutes). If your endpoint doesn’t respond in time, the request fails and the agent receives the error message (for example, a timeout error) to act on. Retell does not retry a custom function, so keep the endpoint fast and handle any retries on your side.Set request headers (optional)
{{token}}.
Set query parameters (optional)
Define parameters
description is filled in by the LLM, while a property with a const value is applied directly.Payload: args onlyWhen Payload: args only is on, the request body is just the function’s arguments at the top level, with no wrapper. When it’s off, the body follows the request spec below (name, call, and args).Example parameter schema:
Set response variables (optional)
user.name or data.items[0].id. This works only when your endpoint returns a JSON object.For example, from this response you could extract the user’s name and reference it later as {{user_name}}:
Configure speech behavior
- Talk While Waiting (off by default) — the agent says something each time the function is called, to fill the silence while it waits, like “Let me look that up for you.” Choose Prompt to have the LLM generate the line, or Static Sentence to speak a fixed message you write. Turn it on for user-facing lookups; leave it off for background tasks like attaching a note.
- Talk After Action Completed (on by default) — the agent keeps going after the function returns, without waiting for the user, so it can read back the result or call another function. Leave it on for almost everything; turn it off only for fire-and-forget tasks like pressing a digit, where you don’t expect the agent to say anything next.
Add prompt guidance
Troubleshooting
If the function won’t save, the parameters are usually invalid. The most common mistake is leaving"type": "object" off the top level of the JSON schema. Click one of the built-in examples and adjust from there.
Request and response spec
When the function is called, Retell sends a request to your endpoint with the following spec. Request- Headers
X-Retell-Signature: an HMAC-SHA256 signature of the request body, used to verify the request came from Retell. See Verify the request is from Retell below.Content-Type: application/json(for POST, PUT, and PATCH).
- Body (JSON, for POST, PUT, and PATCH only)
name: the name of the custom function.call: the call object, for context about the call. It includes the transcript up to the moment the request is sent. See Get Call for the full object.args: the function’s arguments, as a JSON object.
name, call, or args wrapper. Parse the parameters from the top level, and run signature verification against that same body string.Example request body
Example request body
Verify the request is from Retell
To confirm a request came from Retell, verify theX-Retell-Signature header against the raw request body using your Retell API key. For GET and DELETE requests the body is empty, so pass an empty string to the verify function.
100.20.5.228.FAQ
Why isn't my agent calling the function?
Why isn't my agent calling the function?
get_order_status”). Vague descriptions are the most common reason a function never fires.What information about the call can my endpoint access?
What information about the call can my endpoint access?
call object with details like the call ID, agent ID, metadata, dynamic variables, and the transcript up to the moment the function is called. Use it for context — for example, to look up the caller by their metadata or a dynamic variable.How do I send data back to the agent?
How do I send data back to the agent?
Does Retell retry a failed custom function?
Does Retell retry a failed custom function?
What happens if the user interrupts while a custom function is running?
What happens if the user interrupts while a custom function is running?
Why does signature verification fail?
Why does signature verification fail?
JSON.stringify(req.body) can reorder keys or change whitespace, which breaks the signature. Read the raw body (for example, with express.raw) and pass that exact string to the verify function.Can I point a custom function at localhost or a private IP?
Can I point a custom function at localhost or a private IP?
Is there a size limit on the response?
Is there a size limit on the response?

