Knowledge API
API surface for SOIT knowledge bases, documents, connector sources and sync runs, document restrictions, and retrieval evidence.
The knowledge API manages knowledge bases, documents, ingestion state, connector sources, document restrictions, and retrieval resources used by agents and workflows.
Prefix
/api/v1/knowledgeEndpoint families
| Method | Path | Purpose |
|---|---|---|
| POST / GET | / | Create knowledge bases; list with pagination |
| GET | /workbench, /workbench/items | Workbench summary views |
| GET / PUT / DELETE | /{knowledge_id} | Inspect, update, or delete a base |
| POST / GET | /{knowledge_id}/documents | Upload/register documents; list them |
| GET | /{knowledge_id}/documents/{document_id} (+ /chunks, /content, /download) | Document detail, chunks, raw content |
| GET / POST | /{knowledge_id}/documents/{doc_key}/versions (+ /{version}/rollback) | Document version history and rollback |
| GET / PUT | /{knowledge_id}/document-restrictions | List restricted documents; restrict a document or lift its restriction (v1.6.0) |
| POST / GET / PATCH / DELETE | /{knowledge_id}/indexes | Manage vector indexes; /{index_id}/rebuild rebuilds |
| GET / POST | /{knowledge_id}/ingest-tasks (+ /{task_id}/retry, /cancel) | Ingestion task status and control |
| POST | /{knowledge_id}/documents/{document_id}/retry-ingest | Re-ingest a failed document |
| POST | /{knowledge_id}/query | Governed retrieval query |
| GET | /{knowledge_id}/runs (+ /costs/summary, /costs/by-mode) | Runs and cost attribution for this base |
| GET | /{knowledge_id}/usages | Where this base is bound (agents, workflows) |
| GET | /connectors | Connector kinds and their settings (v1.5.0) |
| GET / POST | /{knowledge_id}/sources | List or create sources (v1.5.0) |
Sources and sync runs
New in v1.5.0. Sources keep a knowledge base in step with an S3-compatible bucket (s3) or a website (web). See Knowledge connectors for the connectors' settings, change detection, scheduling, and limits.
| Method | Path | Access | Purpose |
|---|---|---|---|
| GET | /connectors | Workspace read | The connector kinds this deployment offers, with the fields each takes |
| GET | /{knowledge_id}/sources | Read | List a knowledge base's sources |
| POST | /{knowledge_id}/sources | Update | Create a source (201) |
| POST | /{knowledge_id}/sources/test | Update | Test a connection before it is saved |
| GET | /{knowledge_id}/sources/{source_id} | Read | Get a source |
| PATCH | /{knowledge_id}/sources/{source_id} | Update | Change a source; only the fields sent change |
| DELETE | /{knowledge_id}/sources/{source_id} | Update | Delete a source (204); documents it synced stay |
| POST | /{knowledge_id}/sources/{source_id}/test | Update | Test a saved source and list a sample of what it would sync |
| POST | /{knowledge_id}/sources/{source_id}/sync | Update | Queue a sync (202); 409 while one is queued or running |
| GET | /{knowledge_id}/sources/{source_id}/runs | Read | Sync history, newest first (limit up to 100, offset) |
| GET | /{knowledge_id}/sources/{source_id}/runs/{run_id} | Read | One run with its per-item outcomes (every outcome except unchanged, the first 200) |
| POST | /{knowledge_id}/sources/{source_id}/runs/{run_id}/cancel | Update | Cancel a queued run, or ask a running one to stop between items |
Read and Update are access to the knowledge base, with its visibility applied: a private knowledge base's sources are as hidden as the base itself.
A source is created with:
| Field | Meaning |
|---|---|
name | Unique on the knowledge base |
connector_kind | s3 or web |
config | The connector's settings |
secret_id | The secret holding the connector's credentials (S3 only); never credentials themselves |
schedule_cron, schedule_timezone | A five-field cron expression and a time zone (default UTC); omit the cron to sync on demand only |
enabled | Default true; a disabled source is neither scheduled nor synced on demand |
delete_removed | Default false; when true, documents whose items disappear are deleted |
limits | Optional max_items, max_item_bytes, max_total_bytes, within the deployment's ceilings |
A source response carries the effective limits, next_sync_at, last_sync_at, last_status, last_error, last_counts, and the active_run_id of a queued or running sync, never credentials. A sync run carries its trigger (manual or schedule), status, added_count, updated_count, unchanged_count, removed_count, failed_count, skipped_count, truncated, and error_code / error_message.
Document restrictions
New in v1.6.0. A restricted document is readable only by the workspace's Owners and Admins, the knowledge base's creator, and holders of a knowledge_document read grant. Everyone else does not see it in the document listing, gets 404 for it and its content, download, chunks, and versions, and never gets it from retrieval. See Restricted documents.
| Method | Path | Who may call | Purpose |
|---|---|---|---|
| GET | /{knowledge_id}/document-restrictions | Readers of the base | The base's restricted documents the caller may read |
| PUT | /{knowledge_id}/document-restrictions | Workspace Owners and Admins, the base's creator | Restrict a document or lift its restriction; answers the base's restrictions after the change |
A restriction names a document by its doc_key, so it holds for every version. PUT takes:
PUT /api/v1/knowledge/knw_01JBX3K9Q4Z8M2V6T7R5N0PA1C/document-restrictions
Content-Type: application/json
{"doc_key": "payroll", "restricted": true}and answers the base's restrictions the caller may read:
[
{
"knowledge_id": "knw_01JBX3K9Q4Z8M2V6T7R5N0PA1C",
"doc_key": "payroll",
"created_by": "u_01JBWZ7H2D5F8K3M6P9R1T4V7X",
"created_at": "2026-10-02T09:14:03Z",
"grant_resource_id": "knw_01JBX3K9Q4Z8M2V6T7R5N0PA1C:payroll"
}
]{"doc_key": "...", "restricted": false}lifts the restriction. Sending the state a document already has changes nothing.- A
doc_keywith no document in the base answers404. A caller who may update the base but is not a workspace Owner or Admin or its creator gets403. - Each change is audited as
knowledge.document.restrictedorknowledge.document.unrestricted. GETleaves out restrictions on documents the caller may not read, so a reader is not told which documents are kept from them.
Granting read on a restricted document
To open a restricted document to one member or service principal, a workspace Owner or Admin creates a resource grant whose resource_id is the restriction's grant_resource_id ("{knowledge_id}:{doc_key}"):
POST /api/v1/resource-grants
Content-Type: application/json
{
"resource_type": "knowledge_document",
"resource_id": "knw_01JBX3K9Q4Z8M2V6T7R5N0PA1C:payroll",
"user_id": "u_01JBX0M4C7E9G2J5L8N1Q3S6U8",
"actions": ["read"]
}The grant is created or, when one exists for the same resource and member, its actions replaced. GET /api/v1/resource-grants?resource_type=knowledge_document&resource_id=... lists the grants on a document, and DELETE /api/v1/resource-grants/knowledge_document/{resource_id}/{user_id} revokes one. From v1.5.2 creating or revoking a grant takes a workspace Owner or Admin; anyone else gets 403. See the Identity API.
Related prefixes
/api/v1/agents,/api/v1/responses— where retrieval results and citations surface/api/v1/runs— retrieval steps in the runtime ledger/api/v1/resource-grants—knowledge_documentread grants on restricted documents
Notes
- Documents are versioned by
doc_key; ingestion is asynchronous and status-tracked with retry/cancel control. source_kindis one ofupload,crawler,api,manual, orconnector(documents a source synced, from v1.5.0).- From v1.5.2 a document's
file_idmust name a file under the same knowledge base's storage; any other is refused with400. - Retrieval queries appear as
retrievalrun steps with vector metrics and produce citation evidence. From v1.6.0 the step'srestricted_documents_excludedmetric counts the restricted documents retrieval left out, and the keyword fallback answers from the latest version of each document only. - From v1.6.0, copies of retrieved content kept in runs, responses, threads, and tasks are read back by the reader's current access. See Copies kept in runs, responses, and threads.