https://retellai.com/?utm_source=discord&utm_medium=seo logo
Is there an event or API endpoint that notifies ou...
# 💬・general
n
@AI Evy Is there an event or API endpoint that notifies our server that a call is currently ongoing, as a form of a heartbeat or a continuous status update?
a
Thanks for tagging me @nithish_99915. I'll look through relevant sources and get back to you shortly.
### Answer Yes, there are several ways to get ongoing call status updates in Retell AI: ## LLM WebSocket Heartbeat When using the LLM WebSocket connection, you can enable ping-pong events for continuous status monitoring [(1) ]() . Set
auto_reconnect
to true in the config event, and Retell will send ping_pong events to your server every 2 seconds to keep the connection alive .
Copy code
json
{
 "response_type": "config",
 "config": {
 "auto_reconnect": true,
 "call_details": true
 }
}
The ping_pong event structure includes a timestamp for calculating round-trip time :
Copy code
json
{
 "interaction_type": "ping_pong",
 "timestamp": 1703302407333
}
## Real-time Call Updates The LLM WebSocket also provides
update_only
events that send real-time updates about the call, including live transcript and turn-taking information . These events are sent whenever transcript updates occur - either when the user speaks or the agent speaks . ## Call Status Polling You can also poll the call status using the Get Call API [(2) ]() . The call status will show: - `registered`: Call id issued, starting to make a call - `ongoing`: Call connected and ongoing - `ended`: The underlying websocket has ended for the call - `error`: Call encountered error The LLM WebSocket with ping-pong events is the most reliable method for continuous heartbeat monitoring of ongoing calls.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Get Call](https://docs.retellai.com/api-references/get-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy The recording_url returned from the Get call API, https://api.retellai.com/v2/get-call/{call_id} is public? is it permanent or temporary? in our platform we need to show the call recording, so can we directly use this URL?
a
Thanks for the follow-up, @nithish_99915. I'll get back to you soon.
### Answer The recording_url returned from the Get Call API has different access characteristics depending on your configuration [(1) ]() . ## URL Access Control The recording_url accessibility depends on the
opt_in_signed_url
setting . When this option is enabled, the generated URLs include security signatures that restrict access and automatically expire after 24 hours . ## URL Structure The recording_url follows this format :
Copy code
"<https://retellai.s3.us-west-2.amazonaws.com/Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6/recording.wav%22>
## For Your Platform Integration If you need to display call recordings directly in your platform, you should consider: 1. **With signed URLs enabled**: The URLs expire after 24 hours, so you'd need to refresh them periodically by making new API calls to get updated URLs 2. **Without signed URLs**: The URLs would be more persistent, but this reduces security The recording_url is available after the call ends . You can retrieve it using the Get Call API endpoint at
/v2/get-call/{call_id}
. For production use in your platform, you may want to download and store the recordings on your own infrastructure rather than relying on direct links, especially if you need long-term access or if you're using signed URLs.
​ To learn more, see the sources I considered: [[1] Get Call](https://docs.retellai.com/api-references/get-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy so how do i know the optin_signed_url setting is it agent specific, while creating agent or what?
@AI Evy After creating a KB, adding website source means it allows maxium of 500URLS around entire KB or per one website source, let's say i want to add many different website sources but they are under 500 links, is that possible?
a
Thanks for the follow-up, @nithish_99915. I'll get back to you soon.
### Answer The 500 URL limit is per knowledge base, not per website source [(1) ]() . This means you can add multiple different website sources to a single knowledge base as long as the total URLs across all sources doesn't exceed 500 . For example, you could add: - Website A with 200 URLs - Website B with 150 URLs - Website C with 100 URLs - Website D with 50 URLs This would total 500 URLs across multiple website sources within one knowledge base . If you need to exceed the 500 URL limit, you can create multiple knowledge bases to overcome this limitation . An agent can have more than one knowledge base linked to it , so you could create: - Knowledge Base 1: Website A (200 URLs) + Website B (150 URLs) + Website C (150 URLs) - Knowledge Base 2: Website D (300 URLs) + Website E (200 URLs) Then link both knowledge bases to your agent for comprehensive coverage .
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy When creating a knowledge base, adding a source url webpage link would crawl and display all set of sublinks for that URL and allows us to selected URL's, this is how it happens manually creating KB. I want to know if i could pass a webpage URL to create KB API, or add KB Sources API and retell would crawl all sublinks and add that to the KNowledge base. Or should i have to provide all the sublinks as well in the API?
a
Thanks for the follow-up, @nithish_99915. I'll get back to you soon.
### Answer Based on the API documentation, when you provide a URL to either the Create Knowledge Base API or Add Knowledge Base Sources API, Retell AI will automatically crawl and scrape the content from that URL [(1) ]() [(2) ]() . You don't need to manually provide all the sublinks. When creating a knowledge base via API, you can use the
knowledge_base_urls
parameter [(1) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
async function main() {
 const knowledgeBaseResponse = await client.knowledgeBase.create({
 knowledge_base_name: "Sample KB",
 knowledge_base_urls: [
 "<https://www.retellai.com%22,>
 "<https://docs.retellai.com%22,>
 ],
 }) ;
 console.log(knowledgeBaseResponse.knowledge_base_id) ;
}
main() ;
Similarly, when adding sources to an existing knowledge base, you can use the
knowledge_base_urls
parameter [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
async function main() {
 const knowledgeBaseResponse = await client.knowledgeBase.addSources({
 knowledge_base_urls: [
 "<https://www.retellai.com%22,>
 "<https://docs.retellai.com%22,>
 ],
 }) ;
 console.log(knowledgeBaseResponse.knowledge_base_id) ;
}
main() ;
​ To learn more, see the sources I considered: [[1] Create Knowledge Base](https://docs.retellai.com/api-references/create-knowledge-base) [[2] Add Knowledge Base Sources](https://docs.retellai.com/api-references/add-knowledge-base-sources) ​
The documentation specifies that the URLs provided must be valid URLs [(1) ]() [(2) ]() . Retell AI will handle the crawling and scraping process automatically, similar to how it works in the dashboard interface. You don't need to manually identify and provide all sublinks - just provide the main URL and Retell AI will discover and process the content.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy I tried adding a url "https://serenedental.com/" in the create KB API inside the knowledge_base_urls array it created a KB but with only one link, i don't see any sublinks
a
Thanks for the follow-up, @nithish_99915. I'll get back to you soon.
### Answer Based on the available sources, I can see that you can retrieve details about your knowledge base to check what sources were actually processed [(1) ]() . You can use the Get Knowledge Base API to verify what sources were added :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const knowledgeBaseResponse = await client.knowledgeBase.retrieve('kb_1234567890') ;
console.log(knowledgeBaseResponse.knowledge_base_id) ;
The response will show you the
knowledge_base_sources
array which contains all the sources that were processed . The status field will indicate whether the knowledge base is still "in_progress", "complete", or has encountered an "error" . However, the available sources don't provide specific details about how URL crawling works or what determines which sublinks get included when you provide a main URL. The sources also don't explain crawling depth, exclusion rules, or why only one link might be processed from a domain. I don't have enough information in the available sources to explain why your specific URL only resulted in one link being processed. For this specific crawling behavior issue, I'd recommend: Check out these potentially useful sources: [Get Knowledge Base]() , [List Knowledge Bases]() Visit [Contact Sales]() or [) for more detailed support on crawling behavior. Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Get Knowledge Base](https://docs.retellai.com/api-references/get-knowledge-base) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy The kb API response has kb_sources array as none, but i want to create KB with a url that crawls all sublinks as well and add that to the KB
a
Thanks for the follow-up, @nithish_99915. I'll get back to you soon.
### Answer Based on the available sources, I can see that when you create a knowledge base with URLs, the system should automatically crawl and process the content [(1) ]() . However, the sources don't provide specific details about auto-crawling configuration or why sublinks might not be included. The documentation does mention auto-crawling functionality [(2) ]() . You can enable auto-crawling for specific URL paths, and the system will automatically crawl all pages under each path every 24 hours . There's also an exclusion list feature where you can specify URLs to exclude from crawling . The limits specify that you can have at most 200 exclusion URLs for each auto-crawling path, and at most 500 exclusion URLs per knowledge base . However, the available sources don't explain: - How to enable auto-crawling when creating a knowledge base via API - The specific parameters needed for auto-crawling configuration - Why your URL might only result in one source being processed Since the
knowledge_base_sources
array is showing as empty in your response, this suggests the knowledge base might still be processing (status: "in_progress") or there could be an issue with the crawling process [(3) ]() . I don't have enough information in the available sources to provide the specific API parameters for enabling auto-crawling during knowledge base creation. Check out these potentially useful sources: [Knowledge Base]() , [Create Knowledge Base]() Visit [Contact Sales]() or [) for specific guidance on configuring
auto-crawling via API. Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Create Knowledge Base](https://docs.retellai.com/api-references/create-knowledge-base) [[2] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[3] Get Knowledge Base](https://docs.retellai.com/api-references/get-knowledge-base) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy To add a KB source for a KB, there's a POST call that accepts KB ID in the path param, but in the SDK method i don't see anything that accepts KB Id, i want to add a KB source for a given KB ID using SDK methods? how could i do that?
a
Thanks for the follow-up, @nithish_99915. I'll get back to you soon.
### Answer Based on the SDK documentation, you can add sources to an existing knowledge base using the
addSources
method [(1) ]() . The method does accept a knowledge base ID as the first parameter . Here's how to use it:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;

// Add sources to existing knowledge base
const knowledgeBaseResponse = await client.knowledgeBase.addSources(
  'kb_1234567890', // knowledge base ID as first parameter
  {
    knowledge_base_urls: [
      "<https://www.example.com%22,>
      "<https://www.retellai.com%22>
    ]
  }
) ;
[(2) ]() The SDK method signature is
client.knowledgeBase.addSources(knowledgeBaseId, { ...params })
which returns a
KnowledgeBaseResponse
[(1) ]() . The first parameter is the knowledge base ID, and the second parameter contains the sources you want to add [(2) ]() . You can add different types of sources including: -
knowledge_base_texts
- text content with titles -
knowledge_base_files
- files (limit 25 files, 50MB each) -
knowledge_base_urls
- URLs to be scraped and added
​ To learn more, see the sources I considered: [[1] RetellAI/retell-typescript-sdk/api.md](https://github.com/RetellAI/retell-typescript-sdk/blob/main/api.md) [[2] Add Knowledge Base Sources](https://docs.retellai.com/api-references/add-knowledge-base-sources) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy I did this in my code by making a call to create knowledge base and passed kb name alone, kb_response = retell_client.knowledge_base.create(knowledge_base_name="Sample KB") but this returns me an error saying internal server error? may i know why?
a
Thanks for the follow-up, @nithish_99915. I'll get back to you soon.
### Answer Based on the documentation and similar issues reported, when creating a knowledge base you need to provide at least one source along with the knowledge base name [(1) ]() . The Create Knowledge Base API requires the
knowledge_base_name
parameter, but you also need to include at least one of the following source types : -
knowledge_base_texts
- text content with titles -
knowledge_base_files
- files to upload -
knowledge_base_urls
- URLs to be scraped Here's the correct way to create a knowledge base with just a name and some content :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;

const knowledgeBaseResponse = await client.knowledgeBase.create({
  knowledge_base_name: "Sample KB",
  knowledge_base_texts: [
    {
      title: "Sample Text",
      text: "Your text content here"
    }
  ]
}) ;
The internal server error you're experiencing is likely because you're only providing the
knowledge_base_name
without any actual content sources [(2) ]() . Other users have reported similar 500 internal server errors when the request body is incomplete or missing required source data . To fix this, you need to add at least one source type to your knowledge base creation call [(1) ]() .
​ To learn more, see the sources I considered: [[1] Create Knowledge Base](https://docs.retellai.com/api-references/create-knowledge-base) [[2] internal server error on create knowledge base by API](https://discord.com/channels/1186424376300679209/1391417148215136376) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy i use dthis sdk method call and it is a valid convo flow id, but still it is saying 404 not found error client.conversation_flow.delete( "conversation_flow_386741e0affe", )
a
Thanks for the follow-up, @nithish_99915. I'll get back to you soon.
### Answer The Delete Conversation Flow method should work with a valid conversation flow ID [(1) ]() . Here's the correct SDK usage according to the documentation:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
await client.conversationFlow.delete('conversation_flow_id') ;
A 404 error typically indicates that the conversation flow ID doesn't exist or isn't accessible with your current API key . To troubleshoot: 1. Verify the conversation flow exists - Use the Get Conversation Flow API to confirm the ID is valid [(2) ]() :
Copy code
javascript
const conversationFlowResponse = await client.conversationFlow.retrieve('conversation_flow_386741e0affe') ;
console.log(conversationFlowResponse.conversation_flow_id) ;
2. Check API key permissions - Ensure your API key has access to this conversation flow [(1) ]() 3. Verify the ID format - The conversation flow ID should be the complete identifier as returned from creation or listing operations If the Get Conversation Flow call also returns 404, then the conversation flow ID either doesn't exist or isn't accessible with your current credentials [(2) ]() .
​ To learn more, see the sources I considered: [[1] Delete Conversation Flow](https://docs.retellai.com/api-references/delete-conversation-flow) [[2] Get Conversation Flow](https://docs.retellai.com/api-references/get-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy For this API, https://api.retellai.com/list-voices the list of voices gives me a list and in the response it gives a preview audio URL, Can we get a preview audio URL that speaks a customised task that we provide and that speaks preview audi with this customised text.
a
Thanks for the follow-up, @nithish_99915. I'll get back to you soon.
### Answer ### Answer Based on the available sources, the List Voices API provides preview audio URLs, but these are pre-generated preview samples for each voice [(1) ]() . The preview_audio_url field contains a static URL like `" [(1) ]() [(2) ]() . The sources don't indicate that you can generate custom preview audio URLs with your own text through the List Voices or Get Voice APIs . These endpoints return fixed preview URLs that demonstrate each voice's characteristics . However, I don't have enough information in the available sources about generating custom preview audio with specific text content. Check out these potentially useful sources: [List Voices]() , [Get Voice]() Visit [Contact Sales]() or [) for more details about custom text-to-speech preview generation. Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] List Voices](https://docs.retellai.com/api-references/list-voices) [[2] Get Voice](https://docs.retellai.com/api-references/get-voice) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.