> ## Documentation Index
> Fetch the complete documentation index at: https://langwatch.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# Discover the queryable LangWatchQL schema

> Lists the LangWatchQL analytics datasets this key may query, with each column's type, description, the permissions that unlock it, and whether this caller holds them — plus each dataset's grain, join keys, partition-pruning time column, freshness and a runnable example query.

Scoped to the credential's own project and its permissions: a column this key cannot read is listed with `available: false` rather than hidden, so a caller can see what a wider key would unlock.



## OpenAPI

````yaml GET /api/v1/query/schema
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/v1/query/schema:
    get:
      tags:
        - Query
      summary: Discover the queryable LangWatchQL schema
      description: >-
        Lists the LangWatchQL analytics datasets this key may query, with each
        column's type, description, the permissions that unlock it, and whether
        this caller holds them — plus each dataset's grain, join keys,
        partition-pruning time column, freshness and a runnable example query.


        Scoped to the credential's own project and its permissions: a column
        this key cannot read is listed with `available: false` rather than
        hidden, so a caller can see what a wider key would unlock.
      operationId: getApiV1QuerySchema
      responses:
        '200':
          description: >-
            The datasets and columns this key may query, with the permissions
            that unlock each one.
          content:
            application/json:
              schema:
                type: object
                properties:
                  database:
                    type: string
                  datasets:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        description:
                          type: string
                        grain:
                          type: string
                        joinKeys:
                          type: array
                          items:
                            type: string
                        timeColumn:
                          type: string
                        freshness:
                          type: string
                        columns:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              type:
                                type: string
                              description:
                                type: string
                              unit:
                                type:
                                  - string
                                  - 'null'
                                enum:
                                  - ms
                                  - USD
                                  - tokens
                                  - tokens/s
                                  - null
                              gates:
                                type: array
                                items:
                                  type: string
                                  enum:
                                    - input
                                    - output
                                    - costs
                              available:
                                type: boolean
                            required:
                              - name
                              - type
                              - description
                              - unit
                              - gates
                              - available
                        exampleSql:
                          type: string
                      required:
                        - name
                        - description
                        - grain
                        - joinKeys
                        - timeColumn
                        - freshness
                        - columns
                        - exampleSql
                required:
                  - database
                  - datasets
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      meta:
                        type: object
                        additionalProperties: {}
                      trace_id:
                        type: string
                      span_id:
                        type: string
                    required:
                      - type
                      - code
                      - message
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      meta:
                        type: object
                        additionalProperties: {}
                      trace_id:
                        type: string
                      span_id:
                        type: string
                    required:
                      - type
                      - code
                      - message
                required:
                  - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      meta:
                        type: object
                        additionalProperties: {}
                      trace_id:
                        type: string
                      span_id:
                        type: string
                    required:
                      - type
                      - code
                      - message
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      meta:
                        type: object
                        additionalProperties: {}
                      trace_id:
                        type: string
                      span_id:
                        type: string
                    required:
                      - type
                      - code
                      - message
                required:
                  - error
      security:
        - project_api_key: []
components:
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: >-
        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.

````