Knowledge Service APIs
The Knowledge Service APIs allow you to manage knowledge service configurations and topics within your OpenDialog workspace. These endpoints enable programmatic control over the NLU and AI components that power your conversational applications.
Overview
Knowledge Services use Retrieval Augmented Generation (RAG) to enhance your conversational AI with domain-specific knowledge. By configuring knowledge services, you can:
Define topics and topic sources for your knowledge base
Configure embedding and retrieval parameters
Integrate with language models for intelligent question answering
Vectorise content for semantic search
For more details on knowledge services and RAG, see the Language Services documentation.
Important Naming Rules
Knowledge service names cannot contain spaces
Topic names cannot contain spaces
Names must match the pattern: alphanumeric characters, underscores, and hyphens only (
/^[\w\-]+$/)
Knowledge Service Configuration
List Knowledge Services
Retrieve a list of all knowledge service configurations in your workspace.
Endpoint: GET /public/api/knowledge-service
Headers:
Response:
Get Knowledge Service Count
Get the total count of knowledge service configurations.
Endpoint: GET /public/api/knowledge-service-count
Headers:
Response:
Create Knowledge Service
Create a new knowledge service configuration. Knowledge services use a language model for embeddings and manage chunked text sources.
Endpoint: POST /public/api/knowledge-service
Headers:
Request Body:
Request Body Parameters:
name(string, required) - Name of the knowledge service (must match pattern/^[\w\-]+$/)scenario_id(string, optional) - ID of the associated scenario (empty string if not applicable)component_id(string, required) - Must be"language_processor.core.knowledge_service"active(boolean, required) - Whether the knowledge service is activeconfiguration(object, required) - Configuration for the knowledge service
Configuration Parameters:
description(string, optional) - Descriptive text about the knowledge servicetype(string, required) - Must be"knowledge_service"chunk_size(integer, required) - Size of text chunks for processing (default: 1000)chunk_overlap(integer, required) - Number of tokens to overlap between chunks (0-100, default: 10)top_k(integer, required) - Number of top results to return from vector search (minimum: 1, default: 3)language_model_component_id(string, required) - Component ID of the language model to use for embeddings (e.g.,"language_model.core.open_ai"or"language_model.core.azure_openai")language_model_configuration_name(string, required) - A descriptive name for the language model configurationlanguage_model_configuration(object, required) - Configuration for the language modelmanaged(boolean) - Set totruefor managed (API key provided by system) orfalsefor self-managedapi_key(string) - API key for the language model (required ifmanagedisfalse)tasks(object) - Task-specific model configurationsembedding(object) - Embedding model configurationmodel(string) - Model name for embeddings (e.g.,"text-embedding-3-small")
Validation Rules:
name- Must match pattern/^[\w\-]+$/(alphanumeric, underscores, and hyphens only; no spaces)configuration.chunk_size- Required, integer, minimum value varies based on system configurationconfiguration.chunk_overlap- Required, integer, minimum 0, maximum 100configuration.top_k- Required, integer, minimum 1
Response:
Get Knowledge Service
Retrieve a specific knowledge service configuration by ID.
Endpoint: GET /public/api/knowledge-service/{id}
Headers:
URL Parameters:
id(required) - The ID of the knowledge service configuration
Response:
Delete Knowledge Service
Remove a knowledge service configuration.
Endpoint: DELETE /public/api/knowledge-service/{id}
Headers:
URL Parameters:
id(required) - The ID of the knowledge service configuration
Response: 204 No Content
Knowledge Service Topics
List Topics
Retrieve all topics for a specific knowledge service.
Endpoint: GET /public/api/language-processor/{knowledge_service_id}/language-processor-topic
Headers:
URL Parameters:
knowledge_service_id(required) - The ID of the knowledge service
Query Parameters:
search(optional) - Search topics by nameorder_by(optional) - Field to order by (default:created_at)order_dir(optional) - Sort direction:ascordesc(default:desc)per_page(optional) - Number of results per page (default: 15)
Response:
Create Topic
Create a new topic for a knowledge service.
Endpoint: POST /public/api/language-processor/{language_processor_id}/language-processor-topic
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge service
Request Body:
Validation Rules:
name- Must match pattern/^[\w\-]+$/(alphanumeric, underscores, and hyphens only; no spaces)topic_type- Must be eithervectorisedorstatic_text
Response:
Get Topic
Retrieve a specific topic.
Endpoint: GET /public/api/language-processor/{language_processor_id}/language-processor-topic/{topic_id}
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge servicetopic_id(required) - The ID of the topic
Response:
Update Topic
Update an existing topic.
Endpoint: PUT /public/api/language-processor/{language_processor_id}/language-processor-topic/{topic_id}
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge servicetopic_id(required) - The ID of the topic
Request Body:
Validation Rules:
name- Must match pattern/^[\w\-]+$/(alphanumeric, underscores, and hyphens only; no spaces)topic_type- Must be eithervectorisedorstatic_text
Response: 204 No Content
Topic Sources
Topic sources are the actual content that gets embedded and vectorised for semantic search within a knowledge service. Sources can be text content, documents, or other data that you want to make searchable through the knowledge service.
Topics with a type of static_text only support a single text type topic source that cannot be vectorised.
List Topic Sources
Retrieve all sources for a specific topic.
Endpoint: GET /public/api/language-processor/{language_processor_id}/language-processor-topic/{topic_id}/language-processor-topic-source
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge servicetopic_id(required) - The ID of the topic
Create Topic Source
Add a new source to a topic. Topic sources contain the actual content to be vectorised and made searchable.
Endpoint: POST /public/api/language-processor/{language_processor_id}/language-processor-topic/{topic_id}/language-processor-topic-source
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge servicetopic_id(required) - The ID of the topic
Request Body:
Topic sources support three different types: text, url, and file. Below are examples for each type:
Text Type
URL Type
File Type
Response:
Get Topic Source
Retrieve a specific topic source by ID.
Endpoint: GET /public/api/language-processor/{language_processor_id}/language-processor-topic/{topic_id}/language-processor-topic-source/{topic_source_id}
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge servicetopic_id(required) - The ID of the topictopic_source_id(required) - The ID of the topic source
Response:
Configuration Parameters:
vectorisedtype(string, required) - Type of source:text,url, orfilesource(string, required) - The source content or identifier (text content, URL, or filename for file type)name(string, optional) - A descriptive name for the sourceexclusion_classes(array, optional) - List of CSS/HTML classes to exclude during processing (URL type)exclusion_ids(array, optional) - List of element IDs to exclude during processing (URL type)should_strip_tags(boolean, optional) - Whether to strip HTML/XML tags during processing (URL and file types)file(object, optional) - File metadata (required for file type)file(string) - Base64-encoded file content with data URI prefixfile_name(string) - Original filenametype(string) - MIME type of the file (e.g., "text/plain", "application/pdf")
vectorisation_status(string) - Current vectorisation status:pending,in_progress,completed,failed, orobsoletenext_vectorisation(timestamp, optional) - Scheduled time for next vectorisationvectorisation_interval(integer, optional) - Interval in seconds between auto-vectorisationsvectorisation_period(string, optional) - Time period for vectorisation schedulingis_truncated(boolean) - Whether the source content was truncatedallow_truncation(boolean) - Whether truncation is allowed for this sourcelast_vectorised(timestamp, optional) - When this source was last vectorisedwill_revectorise(boolean) - Whether the source will be re-vectorised
Vectorisation Status Values:
Vectorisationpending- Source waiting to be vectorisedin_progress- Source is currently being vectorisedcompleted- Source has been successfully vectorisedfailed- Vectorisation failed for this sourceobsolete- Source content changed; vectorisation is outdated
Delete Topic Source
Remove a topic source from a topic.
Endpoint: DELETE /public/api/language-processor/{language_processor_id}/language-processor-topic/{topic_id}/language-processor-topic-source/{topic_source_id}
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge servicetopic_id(required) - The ID of the topictopic_source_id(required) - The ID of the topic source
Response: 204 No Content
Vectorise Topic
Trigger vectorisation for a topic.
Endpoint: POST /public/api/language-processor/{language_processor_id}/language-processor-topic/{topic_id}/vectorise
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge servicetopic_id(required) - The ID of the topic
Response:
Unified Topic Management
The unified topic endpoints provide simplified topic management operations for knowledge services. These endpoints allow you to create, retrieve, and update topics along with their sources in a single operation.
Create Unified Topic
Create a new topic with associated sources in a single request.
Endpoint: POST /public/api/language-processor/{language_processor_id}/language-processor-topics
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge service
Request Body:
Request Body Parameters:
name(string, required) - Name of the topic (must match pattern/^[\w\-]+$/)description(string, required) - Description of the topictopic_type- Must be eithervectorisedorstatic_textsources(array, required) - Array of topic sources to create with this topic (minimum 1 source required)type(string, required) - Type of source:text,url, orfileconfiguration(object, required) - Configuration for the sourcesource(string, required) - The source content, URL, or filenamename(string, optional) - A descriptive name for the sourceexclusion_classes(array, optional) - List of CSS/HTML classes to exclude (for URL type)exclusion_ids(array, optional) - List of element IDs to exclude (for URL type)should_strip_tags(boolean, optional) - Whether to strip HTML/XML tags (for URL and file types)
Response: 204 No Content
Get Unified Topic
Retrieve a specific topic with all its associated sources.
Endpoint: GET /public/api/language-processor/{language_processor_id}/language-processor-topics/{topic_id}
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge servicetopic_id(required) - The ID of the topic
Response:
Update Unified Topic
Update a topic and manage its sources (update, remove, or add sources) in a single request.
Endpoint: PATCH /public/api/language-processor/{language_processor_id}/language-processor-topics/{topic_id}
Headers:
URL Parameters:
language_processor_id(required) - The ID of the knowledge servicetopic_id(required) - The ID of the topic
Request Body:
Request Body Parameters:
name(string, optional) - Updated name of the topicdescription(string, optional) - Updated description of the topicsources(array, optional) - Array of source operationsid(integer) - ID of the source (required forupdateandremoveoperations, omit foradd)operation(string, required) - Operation to perform:add,update, orremovetype(string) - Type of source:text,url, orfile(required foraddandupdateoperations)configuration(object) - Configuration for the source (required foraddandupdateoperations)source(string, required) - The source content, URL, or filenamename(string, optional) - A descriptive name for the sourceexclusion_classes(array, optional) - List of CSS/HTML classes to exclude (for URL type)exclusion_ids(array, optional) - List of element IDs to exclude (for URL type)should_strip_tags(boolean, optional) - Whether to strip HTML/XML tags (for URL and file types)
Response: 204 No Content
Example: Adding a URL source to an existing topic
Example: Updating an existing source and adding a new file source
Error Responses
All endpoints may return the following error responses:
401 Unauthorized
403 Forbidden
404 Not Found
422 Unprocessable Entity
Last updated