Knowledge
GET /api/orgs/{org_id}/knowledge
Section titled “GET /api/orgs/{org_id}/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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | no | Max rows to return (1-100). Omit to return every row. |
| offset | query | integer | no | Rows to skip — pass the previous response’s next_offset. |
| org_id | path | string (uuid) | yes | |
| project_id | query | string | no | Filter by project id, or ‘none’ for uncategorized knowledge bases. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | Page_KnowledgeBaseResponse_ |
| 422 | Validation Error | HTTPValidationError |
POST /api/orgs/{org_id}/knowledge
Section titled “POST /api/orgs/{org_id}/knowledge”Create Knowledge Base
Create a new knowledge base. Requires admin/owner role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| description | string | no | |
| name | string | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful Response | KnowledgeBaseResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/orgs/{org_id}/knowledge/{kb_id}
Section titled “GET /api/orgs/{org_id}/knowledge/{kb_id}”Get Knowledge Base
Get a knowledge base’s detail (with source/chunk counts).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | KnowledgeBaseResponse |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| description | string | no | |
| name | string | no |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | KnowledgeBaseResponse |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | Successful Response | |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| limit | integer | no | |
| query | string | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | agentdepot_api__routers__knowledge__SearchResponse |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | KnowledgeSourceResponse[] |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes | |
| source_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | Successful Response | |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| limit | query | integer | no | |
| offset | query | integer | no | |
| org_id | path | string (uuid) | yes | |
| source_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | ChunkListResponse |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes | |
| source_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | KnowledgeSourceResponse |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| file_refs | agentdepot_api__routers__knowledge__FileRef[] | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful Response | KnowledgeSourceResponse[] |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | yes | |
| title | string | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful Response | KnowledgeSourceResponse |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful Response | KnowledgeSourceResponse |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | SyncConfigResponse[] |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| collection_id | string | yes | |
| collection_name | string | yes | |
| integration_id | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful Response | SyncConfigResponse |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| config_id | path | string (uuid) | yes | |
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | Successful Response | |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| config_id | path | string (uuid) | yes | |
| kb_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | SyncConfigResponse |
| 422 | Validation Error | HTTPValidationError |
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| integration_id | path | string (uuid) | yes | |
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | RemoteCollectionResponse[] |
| 422 | Validation Error | HTTPValidationError |
POST /api/orgs/{org_id}/knowledge/search
Section titled “POST /api/orgs/{org_id}/knowledge/search”Search Org Knowledge
Test-search across every knowledge base in the org (no kb_id scope).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| limit | integer | no | |
| query | string | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | agentdepot_api__routers__knowledge__SearchResponse |
| 422 | Validation Error | HTTPValidationError |