Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Using Enterprise Knowledge APIs


This page outlines how to authenticate and use the Enterprise Knowledge APIs.


Authentication

authentication page anchor

Twilio supports HTTP Basic authentication. To authenticate, include the Basic Authentication header where the username:password pair is one of the following:

UsernamePasswordBest practice
API KeyAPI Key SecretThis is the recommended way to authenticate with the Twilio APIs. When a key is compromised or no longer used, revoke it to prevent unauthorized access.
Account SIDAuthTokenLimit your use to local testing.

See our Twilio API requests doc to learn more about using Twilio APIs.


Add knowledge bases and sources

add-knowledge-bases-and-sources page anchor

A knowledge base organizes knowledge sources into containers that can be semantically indexed and searched to provide contextual information for AI and retrieval use cases. For example, FAQs, warranty policy, or product information necessary for your business needs.

Each Twilio account can have multiple knowledge bases and each base can contain multiple sources such as documents, websites, or text content that can be used for context and information retrieval.

Knowledge sources represent unstructured or semi-structured data (web pages and raw text) that are processed into searchable chunks for information retrieval and AI workflows.

Create a new knowledge source from various data sources such as web content, files, or raw text. Knowledge resources are processed and indexed to enable semantic search and retrieval.

Best practices

best-practices page anchor

Keep the following best practices in mind when working with knowledge bases and sources:

  • Access and optimize content: Regularly evaluate your existing knowledge sources for accuracy, relevance, and coverage. Identify any gaps or outdated information that could hinder an AI or human agent's performance.
  • Simplify and structure content: Ensure that your content is clear and concise. Use headings, bullet points, and metadata to make information straightforward to navigate for both agents and end users.
  • Prioritize high-impact content: Focus on updating and maintaining content that is frequently accessed or critical to customer interactions. Consider using analytics to determine which knowledge entries are most valuable.
POST "https://knowledge.twilio.com/v2/ControlPlane/KnowledgeBases"

Request body schema for knowledge bases

NameTypeDescription
displayName
(Required)
stringProvides a unique and addressable name to be assigned to this knowledge base. This name is assigned by the developer and can be used in addition to the ID. It is intended to be human-readable and unique within the account.

See the full knowledge bases API reference to learn more.

POST "https://knowledge.twilio.com/v2/KnowledgeBases/{kbId}/Knowledge"

Path parameters

NameTypeDescription
kbID
(Required)
stringA unique knowledge base ID using Twilio Type ID (TTID) format.

Request body schema for knowledge sources

NameTypeDescription
name
(Required)
string <= 30 charactersThe name of the knowledge source.
descriptionstring <=1024 charactersA detailed description of the knowledge source and when to use it. This helps provide context about the content and its intended purpose.
source
(Required)
stringDetails specific to the knowledge source type. Each knowledge source type has its own set of configuration parameters and source specific properties.
source.typestringMemory Store ID for Profile resolution.
source.content.text Required if source = textstring <=1024 charactersThe raw text content to be processed.
source.url.web Required if source = webstring <url>The URL to crawl for web content.
source.url.web.crawlDepthinteger [1-10]The maximum depth to crawl from the source URL.
source.url.web.crawlPeriodstringDefault: "NEVER" Enum: "WEEKLY" "BIWEEKLY" "MONTHLY" "NEVER"
Frequency of re-crawling the website for updated content.

See the full knowledge sources API reference to learn more.