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

# List available FQL functions

> Returns the list of FQL functions available for GenAI custom metrics, including function metadata, parameter definitions, and return types. The response is used by the frontend for autocomplete suggestions, signature hints, and documentation in the FQL editor.

Currently returns GenAI functions only (from the GenAI function registry plus the `attribute` construct). Extensible to ML context in the future via a query parameter.




## OpenAPI

````yaml GET /v3/fql-expressions
openapi: 3.0.3
info:
  title: Fiddler API - 2.0
  description: APIs to interact with Fiddler
  termsOfService: https://fiddler.ai/about/terms
  contact:
    email: support@fiddler.ai
  license:
    name: Proprietary
    url: '2.0'
  version: '2.0'
servers: []
security:
  - BearerAuth: []
tags:
  - name: access-key
    description: CRUD operations for API keys
  - name: span-v3
  - name: aggregation-invalidation-request-v3
    description: Endpoints related to retrieving aggregation invalidation requests
  - name: alert-rules-v3
    description: CRUD for Alert Rules, Summary, and Stats APIs
  - name: application-v3
  - name: attribute-v3
  - name: auth
    description: Authentication strategies and login flows
  - name: baseline-v3
    description: CRUD for baseline
  - name: catalog-v3
    description: >-
      Entity catalog provides paginated, searchable discovery of entity names
      (attribute keys, agent names, span types, span names) and their distinct
      values. Powered by ClickHouse materialized views — no worker or PostgreSQL
      dependency.
  - name: chart-annotation-v3
    description: Endpoints related to retrieving chart annotations
  - name: chart-v3
    description: CRUD for chart
  - name: queries-v3
    description: v3 queries API
  - name: configuration-v3
    description: CRUD for configurations
  - name: custom-metrics-v3
  - name: dimensionality-reduction-v3
  - name: environment-v3
    description: Endpoints related to environment management
  - name: evals
  - name: datasets
  - name: evaluation-v3
  - name: evaluator-v3
  - name: rule-evaluators-v3
  - name: experiment-v3
  - name: explainability-v3
  - name: llm_rca-v3
  - name: file-upload
    description: Endpoints related to file uploading.
  - name: fql-expressions-v3
    description: >
      Endpoints for listing FQL (Fiddler Query Language) functions available for
      GenAI custom metrics. Used by the frontend for autocomplete and signature
      hints in the FQL editor.
  - name: genai-alert-rules-v3
    description: CRUD API for GenAI Alert Rules
  - name: genai-custom-metrics-v3
    description: API for GenAI Custom Metrics
  - name: genai-metrics-v3
    description: >-
      Endpoints for pre-aggregated GenAI metrics. All metric data is
      pre-aggregated by an hourly ClickHouse refreshable materialized view; no
      real-time aggregation is performed at request time.
  - name: guardrails-api
    description: Endpoints related to retrieving Guardrails specific data
  - name: ingestion-v3
  - name: intercom-api
    description: Endpoints related to intercom APIs
  - name: jobs-v3
  - name: llm-gateway-v3
  - name: auth-login
  - name: auth-logout
  - name: metrics-v3
    description: Metrics endpoints
  - name: model-v3
  - name: dashboard-v3
  - name: model-deployment-v3
  - name: monitoring-summary-v3
  - name: histograms-v3
  - name: organization-roles-v3
    description: Update user org role
  - name: organization-settings-v3
    description: Update organization settings such as timezone, email configuration, etc.
  - name: pagerduty-api
    description: CRUD for Pagerduty services.
  - name: project-v3
  - name: project-roles-v3
    description: Project role assignment management
  - name: searchable-text-key-v3
    description: >-
      Manage the global searchable text keys table that controls which OTel
      attribute keys are routed to the full-text-searchable `ValueContent`
      column in the unified attributes table. Changes propagate to the backing
      ClickHouse dictionary within 1-2 minutes and affect all tenants.
  - name: segments-v3
  - name: semantic-mapping-v3
    description: >-
      Manage the global semantic name mappings table that maps raw OTel
      attribute keys to canonical semantic concepts. Changes propagate to the
      backing ClickHouse dictionary within 1-2 minutes and affect all tenants.
  - name: server-info-v3
    description: Endpoints related to retrieving server information
  - name: sessions-v3
    description: v3 session APIs
  - name: team-roles-v3
  - name: team-v3
  - name: traces-v3
    description: v3 trace api for monitoring
  - name: fetch-sessions-v3
    description: v3 fetch sessions api for monitoring
  - name: user-access-key
    description: >
      CRUD operations for user API keys. All endpoints are user-scoped — each
      user can only operate on their own API keys. No one including Org admins
      have access to other users' API keys.
  - name: users-v3
  - name: version-compatibility-v3
  - name: webhooks
externalDocs:
  url: https://docs.fiddler.ai
  description: Find out more about Fiddler
paths:
  /v3/fql-expressions:
    get:
      tags:
        - fql-expressions-v3
      summary: List available FQL functions
      description: >
        Returns the list of FQL functions available for GenAI custom metrics,
        including function metadata, parameter definitions, and return types.
        The response is used by the frontend for autocomplete suggestions,
        signature hints, and documentation in the FQL editor.


        Currently returns GenAI functions only (from the GenAI function registry
        plus the `attribute` construct). Extensible to ML context in the future
        via a query parameter.
      operationId: listFqlExpressionsV3
      responses:
        '200':
          description: List of available FQL functions retrieved successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/FqlExpressionsResponse'
              examples:
                genai_functions:
                  summary: GenAI FQL functions
                  value:
                    api_version: '3.0'
                    kind: NORMAL
                    data:
                      functions:
                        - name: count
                          category: aggregate
                          grouping: aggregation
                          description: >-
                            Returns the number of non-null rows of a column or
                            row expression
                          parameters:
                            - name: expr
                              type: any
                              is_required: true
                              kind: positional
                          return_type: number
                        - name: if
                          category: row
                          grouping: logical
                          description: Evaluates condition and returns one of two values
                          parameters:
                            - name: expr1
                              type: boolean
                              is_required: true
                              kind: positional
                            - name: expr2
                              type: any
                              is_required: true
                              kind: positional
                            - name: expr3
                              type: any
                              is_required: true
                              kind: positional
                          return_type: any
                        - name: quantile
                          category: aggregate
                          grouping: aggregation
                          description: Returns the value at a given quantile level
                          parameters:
                            - name: expr
                              type: number
                              is_required: true
                              kind: positional
                            - name: level
                              type: number
                              is_required: false
                              default: 0.5
                              kind: keyword
                          return_type: number
                        - name: attribute
                          category: row
                          grouping: attribute
                          description: >-
                            References a Gen AI span or session attribute by
                            name
                          parameters:
                            - name: scope
                              type: string
                              is_required: true
                              allowed_values:
                                - span
                              kind: keyword
                            - name: name
                              type: string
                              is_required: true
                              kind: keyword
                            - name: value
                              type: string
                              is_required: false
                              kind: keyword
                          return_type: any
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    ApiResponse:
      type: object
      description: |
        Response object for standard API responses.
      properties:
        api_version:
          type: string
          default: '3.0'
          enum:
            - '2.0'
            - '3.0'
          description: |
            API version.
        kind:
          type: string
          default: NORMAL
          enum:
            - NORMAL
          description: |
            Type of response, indicating a normal response.
    FqlExpressionsResponse:
      type: object
      description: >
        Response containing the list of available FQL functions for GenAI custom
        metrics. The top-level structure is extensible — future versions may add
        additional keys (e.g., `keywords`, `fields`) without breaking existing
        consumers.
      required:
        - functions
      properties:
        functions:
          type: array
          description: >
            Ordered list of FQL functions available for building custom metric
            expressions. Includes aggregate functions (e.g., count, sum),
            row-level functions (e.g., if, match), and the `attribute` construct
            for referencing GenAI span/session attributes.
          items:
            $ref: '#/components/schemas/FqlFunction'
    FqlFunction:
      type: object
      description: >
        Describes a single FQL function, including its name, category, parameter
        signature, and return type. Used by the frontend to render autocomplete
        suggestions and signature hints.
      required:
        - name
        - category
        - grouping
        - description
        - parameters
        - return_type
      properties:
        name:
          type: string
          description: >
            FQL function name. This is the identifier the user types in the FQL
            editor (e.g., `count`, `if`, `attribute`).
          example: count
        category:
          type: string
          enum:
            - aggregate
            - row
          description: >
            Function category. `aggregate` functions operate over multiple rows
            to produce a single value (e.g., count, sum, average). `row`
            functions operate on individual rows and return a per-row value
            (e.g., if, match, attribute).
          example: aggregate
        grouping:
          type: string
          enum:
            - aggregation
            - logical
            - math
            - string
            - attribute
          description: >
            Finer-grained grouping within a category, used by the frontend to
            stratify functions in the autocomplete menu. Aggregate-category
            functions use `aggregation`. Row-category functions are split into
            `logical`, `math`, `string` and `attribute`
          example: aggregation
        description:
          type: string
          description: >
            Human-readable explanation of what the function does. Intended for
            display as a tooltip or documentation panel in the FQL editor.
          example: Returns the number of non-null rows of a column or row expression
        parameters:
          type: array
          description: >
            Ordered list of parameters the function accepts. Positional
            parameters come first, followed by keyword parameters. This order
            matches the FQL calling convention.
          items:
            $ref: '#/components/schemas/FqlParameter'
        return_type:
          type: string
          enum:
            - number
            - string
            - boolean
            - any
          description: >
            Data type the function evaluates to. Informational — the backend
            validates type correctness when the FQL expression is submitted. The
            frontend does not need to replicate type-checking logic.
          example: number
    ErrorResponse:
      type: object
      description: |
        Response object for errors returned by the API.
      properties:
        api_version:
          type: string
          default: '3.0'
          enum:
            - '2.0'
            - '3.0'
          description: |
            API version of the response.
        kind:
          type: string
          default: ERROR
          enum:
            - ERROR
          description: |
            Type of response, usually indicating an error.
        error:
          type: object
          properties:
            code:
              type: integer
              format: int32
              description: >
                Represents the code for this error, typically an HTTP response
                code.
              default: 400
              enum:
                - 400
                - 403
                - 404
                - 500
            message:
              type: string
              description: >
                A human-readable message providing more details about the error.
                If there are multiple errors, it will be the message for the
                first error.
              example: Resource Not Found
            errors:
              type: array
              description: >
                Container for additional information regarding the error,
                especially for multiple errors.
              items:
                type: object
                properties:
                  reason:
                    type: string
                    description: >
                      Unique identifier for this error, different from the error
                      code.
                    example: ResourceNotFoundException
                  message:
                    type: string
                    description: >
                      A human-readable message providing more details about the
                      error. If there is only one error, this field will match
                      error.message.
                    example: Resource Not Found
                  help:
                    type: string
                    description: >
                      Link to support or documentation providing more
                      information on the error.
    FqlParameter:
      type: object
      description: >
        Describes a single parameter of an FQL function. Parameters are either
        positional (passed as bare expressions in order) or keyword (passed as
        name=value pairs).
      required:
        - name
        - type
        - is_required
        - kind
      properties:
        name:
          type: string
          description: >
            Parameter label. For positional parameters: `expr` (single) or
            `expr1`, `expr2`, ... (multiple). For keyword parameters: the actual
            keyword name the user types in FQL (e.g., `level`, `scope`, `name`).
          example: expr
        type:
          type: string
          enum:
            - number
            - string
            - boolean
            - any
          description: >
            Expected data type of the parameter. Uses lowercase values aligned
            with JSON Schema and TypeScript conventions. `any` means any type is
            accepted.
          example: any
        is_required:
          type: boolean
          description: >
            Whether the parameter must be provided. Optional parameters may have
            a `default` value.
          example: true
        kind:
          type: string
          enum:
            - positional
            - keyword
          description: >
            How the parameter is passed in FQL syntax. `positional`: the user
            passes a bare expression in order (e.g., `count(revenue)`).
            `keyword`: the user types `name=value` (e.g., `level=0.75`,
            `scope='span'`).
          example: positional
        default:
          description: >
            Default value if the parameter is omitted. Only present on optional
            parameters.
          example: 0.5
        allowed_values:
          type: array
          nullable: true
          description: >
            Fixed set of valid values for this parameter. Only present when the
            parameter accepts a constrained set of values (e.g., `scope` only
            accepts `["span"]`).
          items: {}
          example:
            - span
  responses:
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````