Skip to main content
POST
/
orgs
/
{org_id}
/
k2
/
{kb_id}
/
query
cURL
curl --request POST \
  --url https://api.timbal.ai/orgs/{org_id}/k2/{kb_id}/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sql": "<string>",
  "explain": true,
  "params": [
    "<unknown>"
  ]
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.timbal.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Timbal API key. Obtain your API key from the Timbal platform settings. See Authentication for more information.

Path Parameters

org_id
string
required
kb_id
string
required

Body

application/json
sql
string
required

SQL query to execute against the knowledge base. Use $1, $2, etc. for parameter placeholders.

explain
boolean

When true, runs EXPLAIN ANALYZE and includes the query plan in the response.

params
any[]

Optional parameters for the query. Parameters passed to the vector search functions (lance_vector_search, lance_hybrid_search) are automatically converted to embedding vectors before the query runs.

Response

200 - application/json

Query results as JSON