Skip to content

Knowledge

List Knowledge Bases

List knowledge bases for the organization, with source/chunk counts.

Omit limit to get every KB; total is the full count either way.

Parameters

NameInTypeRequiredDescription
limitqueryintegernoMax rows to return (1-100). Omit to return every row.
offsetqueryintegernoRows to skip — pass the previous response’s next_offset.
org_idpathstring (uuid)yes
project_idquerystringnoFilter by project id, or ‘none’ for uncategorized knowledge bases.

Responses

StatusDescriptionBody
200Successful ResponsePage_KnowledgeBaseResponse_
422Validation ErrorHTTPValidationError

Create Knowledge Base

Create a new knowledge base. Requires admin/owner role.

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
descriptionstringno
namestringyes

Responses

StatusDescriptionBody
201Successful ResponseKnowledgeBaseResponse
422Validation ErrorHTTPValidationError

Get Knowledge Base

Get a knowledge base’s detail (with source/chunk counts).

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseKnowledgeBaseResponse
422Validation ErrorHTTPValidationError

PATCH /api/orgs/{org_id}/knowledge/{kb_id}

Section titled “PATCH /api/orgs/{org_id}/knowledge/{kb_id}”

Update Knowledge Base

Rename / re-describe a knowledge base. Requires admin/owner role.

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
descriptionstringno
namestringno

Responses

StatusDescriptionBody
200Successful ResponseKnowledgeBaseResponse
422Validation ErrorHTTPValidationError

DELETE /api/orgs/{org_id}/knowledge/{kb_id}

Section titled “DELETE /api/orgs/{org_id}/knowledge/{kb_id}”

Delete Knowledge Base

Soft-delete a knowledge base. Requires admin/owner role.

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
204Successful Response
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/knowledge/{kb_id}/search

Section titled “POST /api/orgs/{org_id}/knowledge/{kb_id}/search”

Search Knowledge Base

Test-search a single knowledge base.

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
limitintegerno
querystringyes

Responses

StatusDescriptionBody
200Successful Responseagentdepot_api__routers__knowledge__SearchResponse
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/knowledge/{kb_id}/sources

Section titled “GET /api/orgs/{org_id}/knowledge/{kb_id}/sources”

List Sources

List a knowledge base’s sources, including sync status.

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseKnowledgeSourceResponse[]
422Validation ErrorHTTPValidationError

DELETE /api/orgs/{org_id}/knowledge/{kb_id}/sources/{source_id}

Section titled “DELETE /api/orgs/{org_id}/knowledge/{kb_id}/sources/{source_id}”

Delete Source

Delete a source. Chunks cascade via the DB foreign key.

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes
source_idpathstring (uuid)yes

Responses

StatusDescriptionBody
204Successful Response
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/knowledge/{kb_id}/sources/{source_id}/chunks

Section titled “GET /api/orgs/{org_id}/knowledge/{kb_id}/sources/{source_id}/chunks”

List Source Chunks

Paginated chunk preview for a source, ordered by position.

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
limitqueryintegerno
offsetqueryintegerno
org_idpathstring (uuid)yes
source_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseChunkListResponse
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/knowledge/{kb_id}/sources/{source_id}/resync

Section titled “POST /api/orgs/{org_id}/knowledge/{kb_id}/sources/{source_id}/resync”

Resync Source

Reset a source to PENDING and re-trigger ingestion.

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes
source_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseKnowledgeSourceResponse
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/knowledge/{kb_id}/sources/file

Section titled “POST /api/orgs/{org_id}/knowledge/{kb_id}/sources/file”

Create File Sources

Stage one or more previously-uploaded temp files into the knowledge base.

Mirrors chat_files.py::attach_chat_files: each file_ref points at a file already sitting in the temp S3 bucket (via a presigned upload); this endpoint downloads it, re-uploads it to permanent storage under the KB’s namespace, creates one FILE source per file (title = filename), and pushes KNOWLEDGE_SOURCE_ADDED for each.

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
file_refsagentdepot_api__routers__knowledge__FileRef[]yes

Responses

StatusDescriptionBody
201Successful ResponseKnowledgeSourceResponse[]
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/knowledge/{kb_id}/sources/text

Section titled “POST /api/orgs/{org_id}/knowledge/{kb_id}/sources/text”

Create Text Source

Add manually-entered text as a source.

The content is staged to permanent S3 as text/markdown (mirroring the file path — the ingestion workflow downloads and extracts it the same way) rather than stored inline on the row.

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
contentstringyes
titlestringyes

Responses

StatusDescriptionBody
201Successful ResponseKnowledgeSourceResponse
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/knowledge/{kb_id}/sources/url

Section titled “POST /api/orgs/{org_id}/knowledge/{kb_id}/sources/url”

Create Url Source

Add a website URL as a source (title starts as the URL; the ingestion workflow may refine it once the page is fetched).

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
urlstringyes

Responses

StatusDescriptionBody
201Successful ResponseKnowledgeSourceResponse
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/knowledge/{kb_id}/sync-configs

Section titled “GET /api/orgs/{org_id}/knowledge/{kb_id}/sync-configs”

List Sync Configs

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseSyncConfigResponse[]
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/knowledge/{kb_id}/sync-configs

Section titled “POST /api/orgs/{org_id}/knowledge/{kb_id}/sync-configs”

Create Sync Config

Connect a remote collection to the KB and trigger the initial sync.

Parameters

NameInTypeRequiredDescription
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
collection_idstringyes
collection_namestringyes
integration_idstring (uuid)yes

Responses

StatusDescriptionBody
201Successful ResponseSyncConfigResponse
422Validation ErrorHTTPValidationError

DELETE /api/orgs/{org_id}/knowledge/{kb_id}/sync-configs/{config_id}

Section titled “DELETE /api/orgs/{org_id}/knowledge/{kb_id}/sync-configs/{config_id}”

Delete Sync Config

Disconnect a collection. Its synced sources (and chunks) are deleted.

Parameters

NameInTypeRequiredDescription
config_idpathstring (uuid)yes
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
204Successful Response
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/knowledge/{kb_id}/sync-configs/{config_id}/sync

Section titled “POST /api/orgs/{org_id}/knowledge/{kb_id}/sync-configs/{config_id}/sync”

Trigger Sync

Manually trigger a sync of one connected collection.

Parameters

NameInTypeRequiredDescription
config_idpathstring (uuid)yes
kb_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseSyncConfigResponse
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/knowledge/integrations/{integration_id}/collections

Section titled “GET /api/orgs/{org_id}/knowledge/integrations/{integration_id}/collections”

List Remote Collections

List the syncable collections of a knowledge-capable connection.

Parameters

NameInTypeRequiredDescription
integration_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseRemoteCollectionResponse[]
422Validation ErrorHTTPValidationError

Search Org Knowledge

Test-search across every knowledge base in the org (no kb_id scope).

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
limitintegerno
querystringyes

Responses

StatusDescriptionBody
200Successful Responseagentdepot_api__routers__knowledge__SearchResponse
422Validation ErrorHTTPValidationError