import requests
url = "https://app.langwatch.ai/api/v1/query/reference"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://app.langwatch.ai/api/v1/query/reference', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.langwatch.ai/api/v1/query/reference \
--header 'X-Auth-Token: <api-key>'{
"version": "<string>",
"lwql": {
"enabled": true,
"schema": {
"database": "<string>",
"views": [
{
"name": "<string>",
"description": "<string>",
"grain": "<string>",
"joinKeys": [
"<string>"
],
"timeColumn": "<string>",
"freshness": "<string>",
"columns": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>",
"unit": "ms",
"gates": [
"input"
],
"available": true
}
],
"exampleSql": "<string>"
}
],
"functions": [
"<string>"
],
"appFunctions": [
{
"name": "<string>",
"signature": "<string>",
"description": "<string>",
"kind": "extraction",
"returns": "<string>",
"encoding": "text",
"keyKind": "trace",
"cap": 123,
"gates": [
"input"
],
"available": true,
"exampleSql": "<string>"
}
]
},
"limits": {
"maxStatementLength": 123,
"maxRowsReturned": 123,
"maxResultBytes": 123,
"maxExecutionTimeSeconds": 123,
"pagination": "<string>"
},
"endpoints": [
{
"method": "GET",
"path": "<string>",
"description": "<string>"
}
]
},
"traceFilter": {
"syntax": "<string>",
"fields": [
{
"name": "<string>",
"label": "<string>",
"valueType": "categorical",
"group": "<string>",
"facetable": true,
"knownValues": [
"<string>"
]
}
],
"dynamicPrefixes": [
{
"prefix": "<string>",
"label": "<string>",
"description": "<string>",
"aliases": [
"<string>"
]
}
],
"endpoints": [
{
"method": "GET",
"path": "<string>",
"description": "<string>"
}
]
},
"examples": [
{
"id": "<string>",
"title": "<string>",
"intent": "triage",
"language": "lwql",
"tags": [
"<string>"
],
"text": "<string>",
"parameters": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
],
"requires": {
"gates": [
"input"
],
"functions": [
"<string>"
]
},
"available": true,
"notes": "<string>"
}
],
"decisionTable": [
{
"when": "<string>",
"use": "<string>",
"why": "<string>"
}
]
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}Discover both query languages
Describes both query languages in one payload: LangWatchQL (SQL over the analytics views) with its schema, limits and endpoints, and the trace filter (a Lucene-flavored string over the trace list) with its syntax, its fields and their static value vocabularies, and the open-ended attribute namespaces.
It also carries worked examples in both languages and a table saying which language answers which kind of question. Every example is checked against the real validator and the real translator before it ships, so a published example parses and compiles; whether THIS key can run one is its own available flag.
Pure: it reads the catalogs and this key’s own permissions, never the project’s traces, so it answers from memory rather than from the database.
It answers Cache-Control: private, no-store, because the document is shaped by the calling credential: available, the embedded schema and the gated columns all differ between keys, and a cache keyed on the URL or the project would replay one key’s document to another. Ask for it again rather than storing it.
The values a field actually holds change under you and are a separate call — GET /api/traces/facets.
An example this key cannot run is listed with available: false and keeps its requires.gates, so a caller can see which permission it needs.
Any credential for the project may read it. The trace filter half is the traces family’s vocabulary, so a key scoped to traces:view alone is answered rather than refused; for that key the LangWatchQL half arrives with lwql.enabled: false and an empty schema. GET /api/v1/query/schema is stricter and refuses that key outright, which is why this document withholds the catalog rather than repeating it.
import requests
url = "https://app.langwatch.ai/api/v1/query/reference"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://app.langwatch.ai/api/v1/query/reference', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.langwatch.ai/api/v1/query/reference \
--header 'X-Auth-Token: <api-key>'{
"version": "<string>",
"lwql": {
"enabled": true,
"schema": {
"database": "<string>",
"views": [
{
"name": "<string>",
"description": "<string>",
"grain": "<string>",
"joinKeys": [
"<string>"
],
"timeColumn": "<string>",
"freshness": "<string>",
"columns": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>",
"unit": "ms",
"gates": [
"input"
],
"available": true
}
],
"exampleSql": "<string>"
}
],
"functions": [
"<string>"
],
"appFunctions": [
{
"name": "<string>",
"signature": "<string>",
"description": "<string>",
"kind": "extraction",
"returns": "<string>",
"encoding": "text",
"keyKind": "trace",
"cap": 123,
"gates": [
"input"
],
"available": true,
"exampleSql": "<string>"
}
]
},
"limits": {
"maxStatementLength": 123,
"maxRowsReturned": 123,
"maxResultBytes": 123,
"maxExecutionTimeSeconds": 123,
"pagination": "<string>"
},
"endpoints": [
{
"method": "GET",
"path": "<string>",
"description": "<string>"
}
]
},
"traceFilter": {
"syntax": "<string>",
"fields": [
{
"name": "<string>",
"label": "<string>",
"valueType": "categorical",
"group": "<string>",
"facetable": true,
"knownValues": [
"<string>"
]
}
],
"dynamicPrefixes": [
{
"prefix": "<string>",
"label": "<string>",
"description": "<string>",
"aliases": [
"<string>"
]
}
],
"endpoints": [
{
"method": "GET",
"path": "<string>",
"description": "<string>"
}
]
},
"examples": [
{
"id": "<string>",
"title": "<string>",
"intent": "triage",
"language": "lwql",
"tags": [
"<string>"
],
"text": "<string>",
"parameters": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
],
"requires": {
"gates": [
"input"
],
"functions": [
"<string>"
]
},
"available": true,
"notes": "<string>"
}
],
"decisionTable": [
{
"when": "<string>",
"use": "<string>",
"why": "<string>"
}
]
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}Authorizations
Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.
Response
The LangWatchQL schema and limits, the trace filter's syntax and fields, worked examples in both languages, and which language answers which kind of question.
Was this page helpful?