Skip to main content

API Endpoints

KnowledgeFlowDB exposes a comprehensive REST API. Base URL: https://api.knowledgedataflow.org

All authenticated endpoints accept either X-Wallet-Address or Authorization: Bearer <token> headers. See Wallet Authentication for details.

Health

MethodEndpointAuthDescription
GET/healthNoHealth check and system status
GET/api/v1/statusNoDetailed system status with protection state
GET/api/v1/docsNoSelf-documenting API reference (JSON)

Query

MethodEndpointAuthDescription
POST/api/v1/queryYesExecute a KQL query (routed to ClickHouse)
POST/api/v1/query/sqlYesExecute a SQL query (routed to ScyllaDB)
POST/api/v1/query/explainYesExplain a KQL query plan without executing
GET/api/v1/statsYesDatabase statistics (node/edge counts)

Query Request Body

{
"query": "MATCH (n:File) RETURN n.path, n.size LIMIT 10"
}

Write

MethodEndpointAuthDescription
POST/api/v1/writeYesCreate/update/delete nodes and edges
POST/api/v1/bulk/uploadYesBulk import JSON data

Write Request Body

{
"operations": [
{
"operation": "create_node",
"label": "Document",
"properties": {
"title": {"String": "My Document"},
"version": {"Integer": 1}
}
}
]
}

Supported operations: create_node, update_node, delete_node, create_edge, delete_edge.

Entities

MethodEndpointAuthDescription
GET/api/v1/entities/labelsYesList all node labels
GET/api/v1/entities/{label}YesList entities by label (supports ?limit=N)
GET/api/v1/entities/{label}/{id}YesGet a specific entity by label and ID
MethodEndpointAuthDescription
POST/api/v1/search/codeYesMulti-stream code search with RRF fusion
POST/api/v1/search/semanticYesVector similarity search
POST/api/v1/search/indexYesIndex a document for full-text search
GET/api/v1/search/indicesYesList search indices

Semantic

MethodEndpointAuthDescription
POST/api/v1/embedYesGenerate embedding for text
POST/api/v1/embed/multimodalYesGenerate multimodal embedding
GET/api/v1/ast/{file_id}YesGet AST symbols for a file

Sessions

MethodEndpointAuthDescription
GET/api/v1/sessionsYesList tracked sessions
POST/api/v1/sessionsYesCreate a new session
GET/api/v1/sessions/{id}YesGet session details

Notes & Workspaces

MethodEndpointAuthDescription
POST/api/v1/workspacesYesCreate a workspace
GET/api/v1/workspacesYesList workspaces
POST/api/v1/notesYesCreate a note
GET/api/v1/notes/{id}YesGet a note
POST/api/v1/notes/{id}/publishYesPublish a note
GET/api/v1/public/notesNoList published notes

Tasks

MethodEndpointAuthDescription
POST/api/v1/tasksYesCreate a task
GET/api/v1/tasksYesList tasks
PUT/api/v1/tasks/{id}YesUpdate a task

GitHub

MethodEndpointAuthDescription
POST/api/v1/github/importYesImport a GitHub repository
GET/api/v1/github/context/{repo}YesGet context bundle for a repository

Blockchain

MethodEndpointAuthDescription
GET/api/v1/blockchain/transactionsYesQuery blockchain transactions
GET/api/v1/blockchain/walletsYesQuery wallet data

Admin

MethodEndpointAuthDescription
GET/api/v1/tenantsYesList tenants
POST/api/v1/backupYesTrigger a backup
GET/api/v1/system/eventsYesQuery system events

Error Responses

All endpoints return errors in a consistent format:

{
"error": "Description of what went wrong",
"status": 400
}
StatusMeaning
400Bad request (invalid query, missing fields)
401Authentication required
402Payment required (x402)
404Resource not found
429Rate limited
500Internal server error