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>"
  ]
}
'

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 used inside Lance vector search functions (lance_vector_search, lance_hybrid_search) are automatically embedded into vectors.

Response

200 - application/json

Query results as JSON