---
title: "Get analytics expression vocabulary"
method: GET
path: "/v1/query/analytics-vocabulary"
tags: ["Query Parsing"]
---

# Get analytics expression vocabulary

`GET /v1/query/analytics-vocabulary`

## Request

- Base URL: `https://docs.grepr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.grepr.ai/v1/query/analytics-vocabulary`
- Auth: one of:
  - API key in header `GREPR-API-KEY`
  - OpenID Connect (`https://grepr-prod.us.auth0.com/.well-known/openid-configuration`)

Returns parser-approved expression functions and logical log fields. With a dataset, includes that dataset's promoted logs_raw tag keys.

## Query parameters

- `datasetId` string

## Response `200`

Analytics vocabulary returned successfully.

- AnalyticsVocabularyResponse
  - `fields` AnalyticsField[], required
    - `accessorTemplate` string: Format string for a nested key accessor, when applicable.
    - `name` string, required
    - `type` string, required
  - `functions` AnalyticsFunction[], required
    - `aggregate` boolean
    - `category` string: Function family used to group completions.
    - `completions` AnalyticsCompletion[]: User-facing completion templates for this function.
      - `caretFromEnd` integer
      - `detail` string
      - `insert` string
      - `label` string
    - `examples` AnalyticsExample[]: Example calls demonstrating the function.
      - `explanation` string, required: One sentence on what this call does.
      - `expression` string, required: The call, in the analytics source language.
    - `help` string, required: Short user-facing explanation shown with completions.
    - `keywordSyntax` boolean: True when the call is written with SQL keywords rather than a comma-separated argument list, e.g. CAST(value AS type) or EXTRACT(field FROM timestamp). Show the examples rather than a signature synthesized from parameters.
    - `maxArgs` integer: Null for variadic functions.
    - `minArgs` integer: Null for variadic functions.
    - `name` string, required
    - `parameters` AnalyticsParameter[]: The function's arguments in call order, for rendering a signature. Required arguments precede optional ones.
      - `name` string, required: What the argument means, e.g. "fraction" for a percentile's rank.
      - `optional` boolean: Whether a call may omit this argument.
      - `repeating` boolean: Whether this argument may be supplied more than once.
      - `type` 'ANY' | 'VARIANT' | 'NUMBER' | 'TEXT' | 'BOOLEAN' | 'TIMESTAMP' | 'ARRAY' | 'MAP' | 'TYPE_NAME' | 'TIME_UNIT' | 'LITERAL', required: What the argument accepts.
  - `maxRowLimit` integer, required: Largest number of result rows an analytics query may ask for. A builder uses it to bound its input; the server refuses a larger request whether or not the caller did.
  - `maxScanBudgetBytes` integer: Largest scan budget, in bytes, an Athena analytics query over this dataset may request. Absent when no ceiling applies. Queries routed to a Trino query engine are not subject to it.
  - `promotedTagKeys` string[]: Promoted logs_raw tag keys for the requested dataset.
  - `reservedWords` string[]: Words the analytics SQL grammar reserves; they cannot be used as result aliases.

## Other responses

- `401`: Unauthorized

---

[API](https://skmtc.dev/grepr/apis/grepr-api.md) - [All operations](https://skmtc.dev/grepr/apis/grepr-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grepr/apis/grepr-api/revisions/2a5ce03a0bf0?raw)
