https://retellai.com/?utm_source=discord&utm_medium=seo logo
my function check calender is giving me this error...
# ❓・ai-evy-support
n
@AI Evy my function check calender is giving me this error {"availability_for_selected_time":"No available slots at specified time range, and no available slots on time range that's nearby."}
a
Thanks for tagging me @newdawnagencies_09124. I'll look through relevant sources and get back to you shortly.
### Answer The error you're seeing indicates that your calendar integration isn't finding available slots for the requested time range. Based on community discussions, this is commonly caused by timezone mismatches or the LLM checking times that are in the past [(1) ]() . Key troubleshooting steps: Use the
{{current_time}}
dynamic variable before triggering calendar functions
. Include this in your prompt before both
check_calendar_availability
and
book_appointment
functions so the AI knows the current date and time . Verify timezone consistency - ensure the timezone in your Retell function call matches the timezone configured in Cal.com . Add timezone context to your prompt - explicitly mention that
current_time
tells the AI the current date and time so it can convert timezones accordingly . Also consider asking the user for their timezone before checking availability . Check for AM/PM formatting issues - there was a bug where availability times were incorrectly showing all times as AM instead of properly distinguishing AM/PM slots [(2) ]() . This has been fixed, but ensure you're on the latest version. If you continue experiencing issues after implementing these fixes, you may want to check the detailed call logs to see if the system is sending time ranges that are in the past, which would explain the "no available slots" error [(1) ]() .
​ To learn more, see the sources I considered: [[1] Urgent: Cal.com Booked on different day - Potential Service Disruption with multiple issue.](https://discord.com/channels/1186424376300679209/1423174290458808381) [[2] When using check_calendar_availability function, I am getting all the times in AM (same timezone)](https://discord.com/channels/1186424376300679209/1291338582388248637) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy give me the best setting configurations to make my voice agent max conversational flow agent sound the most human
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer To make your Conversation Flow agent sound most human, configure these settings in the global settings: Voice Settings: - Select a voice from the dropdown menu and listen to samples to find one that matches your use case [(1) ]() - Adjust voice temperature to make the voice more variant (higher = more natural variation) - Adjust voice speed to match natural speaking pace - Consider adding custom voices from ElevenLabs community or clone voices for a more personalized sound Speech Settings: - Add a background sound that plays throughout the call to mimic environments like a call center, making conversations more humanlike and engaging - Adjust responsiveness - set it lower if you want the agent to respond slower, which can be useful when talking to folks like elderly people (reducing by 0.1 adds 0.5 seconds of wait time) - Configure interruption sensitivity - set it lower if you want the agent to be more resilient to background speech or user interruptions - Set up backchanneling to configure how often and what words the agent uses to acknowledge users - Enable speech normalization to convert entities like dates, currency, and numbers into plain words, which helps prevent pronunciation issues Prompt Engineering: - Use conversational language with contractions in your prompts [(2) ]() - Keep responses concise - under 2 sentences unless explaining complex topics - Show empathy and acknowledge what the caller says - Ask one question at a time to avoid overwhelming the caller - Return dates in spoken form (say "January fifteenth" not "1/15") **
​ To learn more, see the sources I considered: [[1] Step 1: Configure global settings](https://docs.retellai.com/build/conversation-flow/global-setting) [[2] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) ​
n
@AI Evy in my first node it says hey is this (name). how do i have the bot pull data from the csv while making outbound calls so the name is inported into the first node
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer Based on the available sources, I cannot find specific documentation about how to dynamically pull data from a CSV file into Conversation Flow nodes during batch outbound calls. However, the sources do mention that when uploading a CSV for batch calls, you can add additional columns with custom data for each recipient [(1) ]() . For dynamic variables, if you add a column header like
first_name
in your CSV, you can reference it as
{{first_name}}
. For individual outbound calls via API, you can use
retell_llm_dynamic_variables
to inject dynamic data into your prompts [(2) ]() . For example:
Copy code
javascript
const registerCallResponse = await retell.call.createPhoneCall({
  from_number: '+14157774444',
  to_number: '+12137774445',
  retell_llm_dynamic_variables: {
    name: 'John Doe',
    blood_group: 'B+'
  }
}) ;
The sources indicate that dynamic variables can be used to personalize interactions using CRM or scheduling data in real time [(3) ]() , but the specific mechanism for using CSV column data as dynamic variables in Conversation Flow nodes during batch calls isn't explicitly documented in the available sources. I'd recommend checking out these potentially useful sources: - [Create Batch calls]() - [Outbound Calls (Make Calls) ]() Would you like me to provide a general answer based on common patterns for similar systems?
​ To learn more, see the sources I considered: [[1] Create Batch calls](https://docs.retellai.com/deploy/make-batch-call) [[2] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) [[3] Outbound Calling](https://www.retellai.com/glossary/outbound-calling) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy what are the steps to do this However, the sources do mention that when uploading a CSV for batch calls, you can add additional columns with custom data for each recipient (1) . For dynamic variables, if you add a column header like first_name in your CSV, you can reference it as {{first_name}} .
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer Here are the steps to use dynamic variables from CSV columns in batch calls: 1. Prepare Your CSV File Create a CSV with a header row that includes a "phone number" column plus any custom columns for dynamic variables [(1) ]() . For example, if you want to use
{{first_name}}
, add a column header named
first_name
. You can download the CSV template by clicking "Download the template" in the batch call interface . 2. Create the Batch Call Navigate to the Batch Call tab in your Retell AI workspace and click "Create Batch Call" . 3. Configure Call Details - Provide a unique name for the batch call - Select the "From Number" from the dropdown menu - Ensure the number is bound to agents to enable batch calls 4. Upload Your CSV Drag and drop your CSV file (up to 50 MB) into the Upload Recipients section . The system will read your custom column headers as dynamic variables. 5. Use Dynamic Variables in Your Agent In your agent's prompts, begin message, or tool configurations, reference the CSV columns using the
{{variable_name}}
syntax [(2) ]() . For example, if your CSV has a
first_name
column, use
{{first_name}}
in your first node message like: "Hey, is this
{{first_name}}
?" Dynamic variables work in prompts, begin messages, tool configurations, and call handling settings . 6. Send or Schedule Choose "Send Now" to start calls immediately or "Schedule" for a future time [(1) ]() .
​ To learn more, see the sources I considered: [[1] Create Batch calls](https://docs.retellai.com/deploy/make-batch-call) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
im getting this error when trying to run batch calls The number provided: +7034864870 is not a valid number. Please provide a valid number in e.164 format. @AI Evy
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer --- ### Answer The error indicates that the number
+7034864870
is not being recognized as valid E.164 format. However, this number appears to be correctly formatted for a US number (country code +1 is implied for 703 area code) . The issue: The number is missing the country code. The correct E.164 format should be
+17034864870
(not
+7034864870
) [(1) ]() . E.164 format requirements: - Must start with a
+
sign - Include the country code (e.g.,
1
for US) - Include the area code and local number - No spaces, dashes, or parentheses To fix your batch call CSV: Update your CSV file so the phone number column contains
+17034864870
instead of
+7034864870
[(2) ]() . If you're using custom telephony with non-standard numbers: If you need to dial internal or pseudo numbers that don't follow E.164 format, you can add a column to your CSV called
ignore e164 validation
with the value
true
[(2) ]() [(3) ]() . This only applies when using custom telephony and does not work with Retell Telephony [(2) ]() [(1) ]() . Example CSV format:
Copy code
phone number,first_name,ignore e164 validation
+17034864870,John,false
Make sure all phone numbers in your CSV include the proper country code prefix.
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] Create batch calls](https://docs.retellai.com/deploy/create-batch-call) [[3] Create Batch Call](https://docs.retellai.com/api-references/create-batch-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy can i give me single prompt agent a transfer number to transfer calls to
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer Yes, you can configure your Single Prompt agent with a transfer number to transfer calls to human agents or other phone numbers [(1) ]() . Steps to add call transfer: 1. Add Transfer Call Tool - Click "+ Add" in the tools section and select "Transfer Call" from the dropdown menu . 2. Setup Transfer Target - Set the transfer number to either : - A number in e.164 format (e.g.,
+17034864870
) - A SIP URI in the format
sip:username@domain
(e.g.,
sip:user@retellai.com
) - A dynamic variable that gets substituted at runtime 3. Update Your Prompt - Add instructions to your agent's prompt about when to transfer, such as: "If the user is angry or frustrated, use the transfer_call tool to transfer the conversation to a human agent." 4. Choose Transfer Type : - **Cold transfer**: The call is transferred directly to the destination number - **Warm transfer**: The AI agent can detect if the other side is human, leave private messages, do a three-way introduction, etc. 5. *Configure Caller ID (Optional) * - Choose whether the transfer destination sees the Retell agent's number or the user's number . Note: This feature only works during phone calls, not web calls, and is available for Retell numbers and imported numbers .
​ To learn more, see the sources I considered: [[1] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
what chat gpt is best for writing agent prompts and knowledge bases current information @AI Evy
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer Based on the available sources, I don't have specific documentation about which ChatGPT model is best for writing agent prompts and knowledge bases. However, I can share what Retell AI supports for running agents (not for writing prompts) : For Retell LLM agents, the available models are: [(1) ]() [(2) ]() -
gpt-5
-
gpt-5-mini
-
gpt-5-nano
-
gpt-4o
-
gpt-4o-mini
-
gpt-4.1
-
gpt-4.1-mini
-
gpt-4.1-nano
-
claude-3.7-sonnet
-
claude-3.5-haiku
-
gemini-2.0-flash
-
gemini-2.0-flash-lite
-
gemini-2.5-flash
-
gemini-2.5-flash-lite
The default model is
gpt-4.1
if not specified . For prompt engineering best practices, the Prompt Engineering Guide recommends: [(3) ]() - Breaking prompts into focused sections - Using markdown language for better LLM understanding - Being concise and conversational - Using explicit tool calling instructions For knowledge bases, you can add content from: [(4) ]() - Website URLs - Documents (.pdf, .docx, .txt, etc.) - Custom text snippets The knowledge base will automatically chunk, embed, and retrieve relevant information during calls . If you're asking which ChatGPT to use as a helper tool for writing your prompts (outside of Retell) , that's not covered in the Retell AI documentation. Would you like me to provide a general answer based on common practices? **
​ To learn more, see the sources I considered: [[1] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[2] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[3] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) [[4] Knowledge Base](https://docs.retellai.com/build/knowledge-base) ​
n
@AI Evy how do i avoid my bot from double booking single prompt agennt cal,.com
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer --- To avoid double booking with your Single Prompt agent using Cal.com, follow these key steps: 1. Always Check Availability Before Booking Configure your agent to call the "Check Availability" function before attempting to book [(1) ]() [(2) ]() . This retrieves open time slots based on pre-scheduled intervals [(2) ]() . 2. Add Proper Logic to Your Prompt Include instructions in your agent prompt such as [(1) ]() : "Call the 'Check Availability' function and provide available slots to the customer. When the customer selects a time, trigger the 'Book Appointment' function to confirm the booking." 3. Ensure Timezone Consistency Make sure the timezone in your Retell function call matches the timezone configured in Cal.com . Configure the correct time zone settings on both the Cal.com platform and the Retell AI dashboard . 4. Use the
{{current_time}}
Dynamic Variable
Include
{{current_time}}
in your prompt before both
check_calendar_availability
and
book_appointment
functions so the AI knows the current date and time. This helps prevent the AI from checking times that are in the past. 5. Sequential Function Calling Structure your agent to follow this sequence: - Check availability first - Present available slots to the user - Only after user confirms a specific slot, call book appointment 6. Consider Multi-Prompt for Complex Scenarios If you need to handle rescheduling and cancellations in addition to booking, a Multi-Prompt agent may make more sense to keep the scope right and prevent conflicts [(3) ]() . By implementing
these safeguards, your agent will verify slot availability in real-time before confirming any bookings, significantly reducing the risk of double bookings. **
​ To learn more, see the sources I considered: [[1] AI Appointment Scheduling with Voice AI Booking Assistant](https://www.retellai.com/features/book-appointments) [[2] AI Scheduling Assistant with Cal.com | Retell AI](https://www.retellai.com/blog/cal-coms-preset-tools) [[3] Discord message from @e.cheng on 2025-07-09](https://discord.com/channels/1186424376300679209/1186462578310910112/1392360771752820736) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
how can i give the bot access to cancel apointments
@AI Evy how can i give the bot access to cancel apointments
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer [(1) ]() --- ### Answer To give your bot access to cancel appointments with Cal.com, you'll need to set up a custom function since this isn't currently supported with the native Retell Cal.com integration . Steps to implement appointment cancellation: 1. Create a Custom Function You'll need to use the Cal.com API to cancel bookings . The approach depends on your backend: - If using Python/FastAPI, follow tutorials on custom functions - If going no-code (Make.com, n8n, etc.) , you can set up webhooks to call the Cal.com API 2. Use the Cal.com Reschedule/Cancel API The Cal.com API endpoint you'll need is the reschedule or cancel booking endpoint . This requires the booking ID as a parameter. 3. Configure Your Function in Retell Add the custom function to your agent and configure it to: - Accept the booking ID (or email to look up the booking) - Call the Cal.com API to cancel the booking - Include a cancellation reason parameter 4. Update Your Agent Prompt Add instructions to your prompt about when to call the cancellation function, such as: "If the user wants to cancel their appointment, call the cancel_appointment function with their booking details." Common Issues to Watch For: Based on community feedback, users have encountered issues where cancellation works for booking and rescheduling but not for cancelling [(2) ]() . Make sure to: - Use the booking UID as the request parameter in the URL - Verify the email matches exactly if looking up by email - Use Cal.com API v2 for best compatibility Would you like guidance on setting this up with a specific backend or no-code platform? --- **
​ To learn more, see the sources I considered: [[1] Reschedule and Cancel Appointments](https://discord.com/channels/1186424376300679209/1327183426297663528) [[2] Discord message from @wifiwill on 2025-03-10](https://discord.com/channels/1186424376300679209/1186462578310910112/1348695522164215929) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
is there any way for the bot to cancel based on patients name and confirming appointment time
@AI Evy is there any way for the bot to cancel based on patients name and confirming appointment time
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer --- ### Answer Yes, you can configure your bot to cancel appointments based on patient name and appointment time by creating a custom function that retrieves bookings by email and then cancels the matching appointment [(1) ]() . Recommended approach: 1. Create a Custom Function to Get Bookings Set up a custom function that calls the Cal.com API to retrieve all bookings for a specific email address [(2) ](

▾

) . The Cal.com API has a "get all bookings" endpoint that you can filter by email . 2. Extract Booking Details Configure your custom function to extract booking information from the API response and save them as dynamic variables [(1) ]() . For example, you can extract the booking ID, appointment time, and patient name from the response . Example response handling:
Copy code
json
{
  "properties": {
    "booking": {
      "id": "abc123",
      "startTime": "2025-11-10T14:00:00Z",
      "attendees": [{"name": "John Doe"}]
    }
  }
}
3. Create a Cancellation Custom Function Build a second custom function that accepts the booking ID as a parameter and calls the Cal.com reschedule/cancel API endpoint . Define parameters using JSON schema format :
Copy code
json
{
  "type": "object",
  "properties": {
    "booking_id": {
      "type": "string",
      "description": "The unique ID of the booking to cancel"
    },
    "cancellation_reason": {
      "type": "string",
      "description": "Reason for cancellation"
    }
  },
  "required": ["booking_id"]
}
4. Update Your Agent Prompt Add logic to your prompt to guide the conversation flow [(3) ]() : - Ask for the patient's name and email - Call the "get bookings" function - Present the appointment details for confirmation - If the patient confirms, call the "cancel appointment" function with the booking ID 5. Configure Request Details For your custom function, you'll need to [(1) ]() : - Select the HTTP method (POST, DELETE, etc.) - Add the Cal.com API endpoint URL - Set request headers with your Cal.com API key - Define query parameters if needed The custom function request will include the function name, call context, and arguments in JSON format . Key considerations: - Always verify the appointment time and patient name before canceling to prevent mistakes - Use the
{{current_time}}
dynamic variable to ensure accurate time comparisons - The booking ID (UID) must be used as the request parameter when calling the cancellation endpoint - Ensure timezone consistency between Retell and Cal.com configurations This approach allows your bot to intelligently look up appointments by name/email, confirm the details with the patient, and then execute the cancellation using the retrieved booking ID. --- **
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] MASTER THE FUTURE OF VOICE AI - Never Miss Another Appointment](

https://www.youtube.com/watch?v=Fpw3Yrg3JoY▾

) [[3] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy can it write an invoice
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer --- Based on the available sources, I cannot find specific documentation about Retell AI agents directly writing invoices. However, Retell AI agents can integrate with external systems through custom functions or *MCP (Model Context Protocol) * tools [(1) ]() . This means you could potentially: 1. Create a custom function that connects to your invoicing system (QuickBooks, Stripe, FreshBooks, etc.) 2. Configure the function to accept invoice parameters like patient name, service details, amount, and date 3. Have the agent call this function during or after the appointment to generate the invoice The agent would need to collect the necessary information during the conversation and then trigger your custom invoicing function with those details. For setting up custom functions with external APIs, you would: - Define the function parameters using JSON schema format - Set up the API endpoint URL for your invoicing system - Configure request headers and authentication - Extract response data as dynamic variables if needed Would you like guidance on setting up a custom function to integrate with a specific invoicing platform? --- **
​ To learn more, see the sources I considered: [[1] MCP](https://docs.retellai.com/build/single-multi-prompt/mcp) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy yes
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the feedback, glad I was helpful.
n
@AI Evy can you re answer the last question i never got the answer can you help me do this. choose the best invoice system for this. my client is a dental office. and i need to give their ai single prompt agent acces to write and send invoices. y
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer
message has been deleted
n
@AI Evy whats taking so long to answer
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy do this for me Based on the available sources, I cannot find specific documentation about Retell AI agents directly writing invoices. However, Retell AI agents can integrate with external systems through custom functions or MCP (Model Context Protocol) tools (1) . This means you could potentially: Create a custom function that connects to your invoicing system (QuickBooks, Stripe, FreshBooks, etc.) Configure the function to accept invoice parameters like patient name, service details, amount, and date Have the agent call this function during or after the appointment to generate the invoice The agent would need to collect the necessary information during the conversation and then trigger your custom invoicing function with those details. For setting up custom functions with external APIs, you would: Define the function parameters using JSON schema format Set up the API endpoint URL for your invoicing system Configure request headers and authentication Extract response data as dynamic variables if needed Would you like guidance on setting up a custom function to integrate with a specific invoicing platform? ---
a
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
### Answer I don't have specific Retell AI documentation about invoice generation, but I can guide you through setting up a custom function to integrate your Single Prompt agent with an invoicing system for your dental office client [(1) ]() [(2) ]() [(3) ]() . ## Setting Up Invoice Generation with Custom Functions Step 1: Choose Your Invoicing Platform For a dental office, I'd recommend: - QuickBooks Online (most common for dental practices) - Stripe Invoicing (if you need payment processing) - FreshBooks (user-friendly for small practices) Step 2: Create the Custom Function In your Retell agent dashboard [(1) ]() [(2) ]() : 1. Navigate to the "Functions" section 2. Click "+ Add" and select "Custom Function" 3. Configure the function details: - **Name**:
create_invoice
- **Description**:
Create and send an invoice for dental services
Step 3: Configure the HTTP Request Set up your custom function : - **HTTP Method**: POST - **Endpoint URL**: Your invoicing platform's API endpoint (e.g., ` - **Headers**: Add authentication (API key or OAuth token) Step 4: Define Parameters Use JSON schema format to define what information the agent needs to collect [(1) ]() [(2) ]() [(4) ]() :
Copy code
json
{
  "type": "object",
  "properties": {
    "patient_name": {
      "type": "string",
      "description": "Full name of the patient"
    },
    "patient_email": {
      "type": "string",
      "description": "Patient's email address"
    },
    "service_description": {
      "type": "string",
      "description": "Description of dental services provided"
    },
    "amount": {
      "type": "number",
      "description": "Total invoice amount in dollars"
    },
    "appointment_date": {
      "type": "string",
      "description": "Date of the appointment"
    }
  },
  "required": ["patient_name", "patient_email", "service_description", "amount"]
}
n
@AI Evy do this for me Based on the available sources, I cannot find specific documentation about Retell AI agents directly writing invoices. However, Retell AI agents can integrate with external systems through custom functions or MCP (Model Context Protocol) tools (1) . This means you could potentially: Create a custom function that connects to your invoicing system (QuickBooks, Stripe, FreshBooks, etc.) Configure the function to accept invoice parameters like patient name, service details, amount, and date Have the agent call this function during or after the appointment to generate the invoice The agent would need to collect the necessary information during the conversation and then trigger your custom invoicing function with those details. For setting up custom functions with external APIs, you would: Define the function parameters using JSON schema format Set up the API endpoint URL for your invoicing system Configure request headers and authentication Extract response data as dynamic variables if needed Would you like guidance on setting up a custom function to integrate with a specific invoicing platform? ---
a
[(1) ]() [(2) ]() Step 5: Update Your Agent Prompt Add instructions to your Single Prompt agent [(2) ]() [(3) ]() : "After confirming the appointment details and services provided, collect the patient's billing information and call the create_invoice function to generate and send the invoice. Confirm with the patient that the invoice has been sent to their email." Step 6: Configure Response Variables Extract data from the API response to confirm invoice creation [(1) ]() [(2) ]() : - Save the invoice ID as
{{invoice_id}}
- Save the invoice URL as
{{invoice_url}}
The agent can then say something like: "I've created invoice #{{invoice_id}} and sent it to your email. You can also view it at {{invoice_url}}." ## Request & Response Handling When the function is called, Retell sends a POST request to your endpoint with [(2) ]() : -
X-Retell-Signature
header for verification - JSON body containing the function name, call details, and arguments Your invoicing API should return a 200-299 status code with the invoice details . ## Next Steps 1. Set up your invoicing platform's API credentials 2. Test the custom function in the Retell dashboard 3. Update your agent's prompt with invoice generation logic 4. Run test calls to verify the flow works end-to-end Would you like help with a specific invoicing platform's API integration?
​ 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] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) [[4] custom function Error with VALID JSON Schema](https://discord.com/channels/1186424376300679209/1310169696582111274) ​
Thanks for the follow-up, @newdawnagencies_09124. I'll get back to you soon.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer I understand you need step-by-step guidance on setting up invoice generation for your dental office's Single Prompt agent. Let me walk you through the complete process using Custom Functions to integrate with an invoicing system [(1) ]() [(2) ]() . ## Step-by-Step Setup Guide ### Step 1: Create the Custom Function in Retell Navigate to your agent's dashboard and add a new custom function : 1. Click "+ Add" in the tools section 2. Select "Custom Function" from the dropdown menu 3. Configure the function details: - **Name**:
create_dental_invoice
- **Description**:
Create and send an invoice for dental services provided
### Step 2: Select HTTP Method and Add Endpoint Choose POST as the HTTP method . Add your invoicing system's API endpoint URL. For example: - QuickBooks: ` - Stripe: ` - FreshBooks: ` This must be a valid URL . ### Step 3: Set Request Headers Define custom headers to include with the request Retell sends to your endpoint . Header values can be static or include dynamic variables . Example headers: - `Authorization`:
Bearer YOUR_API_KEY
- `Content-Type`:
application/json
### Step 4: Define Parameters Using JSON Schema Define the parameters for the custom function using JSON schema format :
Copy code
json
{
  "type": "object",
  "properties": {
    "patient_name": {
      "type": "string",
      "description": "Full name of the patient"
    },
    "patient_email": {
      "type": "string",
      "description": "Patient's email address for invoice delivery"
    },
    "service_description": {
      "type": "string",
      "description": "Description of dental services provided"
    },
    "amount": {
      "type": "number",
      "description": "Total invoice amount in dollars"
    },
    "appointment_date": {
      "type": "string",
      "description": "Date of the dental appointment"
    }
  },
  "required": [
    "patient_name",
    "patient_email",
    "service_description",
    "amount"
  ]
}
### Step 5: Set Response Variables Extract values from the API response and save them as dynamic variables for use later in the conversation [(3) ]() [(1) ]() [(2) ]() . For example, you can extract the invoice ID and URL from the response and reference them later using
{{invoice_id}}
and
{{invoice_url}}
. Example response body:
Copy code
json
{
  "properties": {
    "invoice": {
      "id": "INV-12345",
      "url": "<https://invoice.example.com/view/INV-12345%22>
    }
  }
}
## How Retell Sends the Request When the custom function is called, Retell sends a request to your endpoint with the following spec : **Request headers**: - `X-Retell-Signature`: encrypted request body using your secret key, used to verify the request is from Retell -
Content-Type: application/json
Request body (in JSON format) : - `name`: the name of the custom function - `call`: the call object for you to get more context about the call - `args`: the arguments for the custom function, as a JSON object The request will timeout in your specified timeout period, or 2 minutes if not specified . When request fails, it will be retried up to 2 times . **Response**: Response should have a status code between 200-299 to indicate success . The function result is capped at 15000 characters . ## Recommended Invoicing Platform for Dental Offices For a dental office, I'd recommend QuickBooks Online as it's the most common accounting software for dental practices and integrates well with practice management systems. ## Next Steps 1. Set up your QuickBooks (or chosen platform) API credentials 2. Test the custom function in the Retell dashboard 3. Update your agent's prompt with the invoice generation logic shown above 4. Run test calls to verify the complete flow works end-to-end The agent will now be able to collect patient information during the call, trigger the invoice creation through your accounting system, and confirm with the patient that the invoice has been sent .
​ 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] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
[(1) ]() [(2) ]() You can save
properties.invoice.id
as a variable like
invoice_id
, and
properties.invoice.url
as
invoice_url
. ### Step 6: Configure Speech Behavior Set up how the agent should handle speech during and after function execution : - **Speak during execution**: Enable this so the agent tells the patient "I'm creating your invoice now" - **Speak after execution**: Enable this so the agent can confirm "I've sent invoice #{{invoice_id}} to your email" ### Step 7: Update Your Agent Prompt Include in the prompt explicitly when to invoke the custom function :
Copy code
When the patient confirms they want to receive an invoice, collect their email address and the service details. Then call the create_dental_invoice function to generate and send the invoice. After the invoice is created, confirm with the patient that the invoice has been sent to their email address.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.