Knowledge Bases
Manage knowledge bases, ingestion jobs, and retrieval queries via the REST API.
Knowledge base management operations
List knowledge bases
List knowledge bases with cursor-based pagination.
Query Parameters
Project override
Page size (max 500)
Opaque pagination cursor
Response Body
curl -X GET "https://loading/api/v0/knowledge-bases?project=string&limit=0&cursor=string"
{
"data": {
"knowledge_bases": [
{
"property1": null,
"property2": null
}
],
"page": {
"limit": 50,
"next_cursor": "v2:after:tool-001",
"prev_cursor": "v2:before:tool-000",
"total": 2
}
},
"error": {
"code": "string",
"details": "string",
"message": "string"
},
"message": "string",
"status": 0
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
Get knowledge base
Retrieve a knowledge base by ID.
Path Parameters
Knowledge base ID
Query Parameters
Project override
Response Body
curl -X GET "https://loading/api/v0/knowledge-bases/string?project=string"
{
"data": {
"knowledge_base": {
"property1": null,
"property2": null
}
},
"error": {
"code": "string",
"details": "string",
"message": "string"
},
"message": "string",
"status": 0
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
Create or update knowledge base
Create a knowledge base when absent or update an existing one using strong ETag concurrency.
Path Parameters
Knowledge base ID
Query Parameters
Project override
Header Parameters
Strong ETag for optimistic concurrency
Knowledge base definition
Empty Object
Response Body
curl -X PUT "https://loading/api/v0/knowledge-bases/string?project=string" \
-H "If-Match: string" \
-H "Content-Type: application/json" \
-d '{}'
{
"data": {
"knowledge_base": {
"property1": null,
"property2": null
}
},
"error": {
"code": "string",
"details": "string",
"message": "string"
},
"message": "string",
"status": 0
}
{
"data": {
"knowledge_base": {
"property1": null,
"property2": null
}
},
"error": {
"code": "string",
"details": "string",
"message": "string"
},
"message": "string",
"status": 0
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
Delete knowledge base
Delete a knowledge base and remove persisted vectors.
Path Parameters
Knowledge base ID
Query Parameters
Project override
Header Parameters
Strong ETag for optimistic concurrency
Response Body
curl -X DELETE "https://loading/api/v0/knowledge-bases/string?project=string" \
-H "If-Match: string"
"string"
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
Ingest knowledge base
Trigger ingestion for configured sources using the requested strategy.
Path Parameters
Knowledge base ID
Query Parameters
Project override
Ingestion request
Response Body
curl -X POST "https://loading/api/v0/knowledge-bases/string/ingest?project=string" \
-H "Content-Type: application/json" \
-d '{}'
{
"data": {
"binding_id": "binding-123",
"chunks": 16,
"documents": 2,
"knowledge_base_id": "support",
"persisted": 16
},
"error": {
"code": "string",
"details": "string",
"message": "string"
},
"message": "string",
"status": 0
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
Query knowledge base
Execute a dense similarity query against a knowledge base.
Path Parameters
Knowledge base ID
Query Parameters
Project override
Query request
Empty Object
Response Body
curl -X POST "https://loading/api/v0/knowledge-bases/string/query?project=string" \
-H "Content-Type: application/json" \
-d '{
"query": "How do I reset my password?"
}'
{
"data": {
"matches": [
{
"binding_id": "binding-123",
"content": "Reset your password by visiting the account settings page.",
"metadata": {
"property1": null,
"property2": null
},
"score": 0.83,
"token_estimate": 120
}
]
},
"error": {
"code": "string",
"details": "string",
"message": "string"
},
"message": "string",
"status": 0
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
{
"code": "invalid_cursor",
"detail": "Invalid cursor parameter",
"instance": "/api/v0/workflows",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}