Skip to contentSkip to page list

Docs

Discover the queryable LangWatchQL schema

Lists the LangWatchQL analytics views this key may query, with each column's type, description, the permissions that unlock it, and whether this caller holds them — plus each view's grain, join keys, partition-pruning time column, freshness and a runnable example query. It also lists, under functions, every function name a query may call.

GET/api/v1/query/schema
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/query/schema"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,}​response = requests.get(    origin + path,    headers=headers,)print(response.json())

The views and columns this key may query, with the permissions that unlock each one.

application/json · Generated from schema

{  "database": "string",  "functions": [    "string"  ],  "views": [    {      "name": "string",      "description": "string",      "grain": "string",      "joinKeys": [        "string"      ],      "timeColumn": "string",      "freshness": "string",      "columns": [        {          "name": "string",          "type": "string",          "description": "string",          "unit": "string",          "gates": [            null          ],          "available": false        }      ],      "exampleSql": "string"    }  ],  "appFunctions": [    {      "name": "string",      "signature": "string",      "description": "string",      "returns": "string",      "encoding": "string",      "keyKind": "string",      "kind": "extraction",      "cap": 0,      "gates": [        "input"      ],      "available": false,      "exampleSql": "string"    }  ]}
api-reference/query/discover-the-queryable-langwatchql-schema

Authorization

X-Auth-Tokenstringheaderrequired

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.

Responses

200

The views and columns this key may query, with the permissions that unlock each one.

application/json

databasestringrequired
functionsstring[]required
viewsobject[]required
namestringrequired
descriptionstringrequired
grainstringrequired
joinKeysstring[]required
timeColumnstring | nullrequired
freshnessstringrequired
columnsobject[]required
exampleSqlstringrequired
appFunctionsobject[]required
namestringrequired
signaturestringrequired
descriptionstringrequired
returnsstringrequired
encodingstringrequired
keyKindstringrequired
kindstringrequired
One of"extraction""eval"
capintegerrequired
Maximum 9007199254740991
gatesstring[]required
availablebooleanrequired
exampleSqlstringrequired
400

Bad Request

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
401

Unauthorized

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
403

Forbidden

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
500

Internal Server Error

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]

Documentation