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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# List dataset fields

> Lists fields for an events, logs, or traces dataset.

`axiom.listDatasetFields` lists fields for an events, logs, or traces dataset. Each item includes its name and type plus visibility, description, and unit when configured.

```ts automations/axiom-list-dataset-fields.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { axiom } from "automate.ax/axiom"

export default automation("List dataset fields", () => {
  onHttpRequest({ scope: "automation" })
  axiom.listDatasetFields({ datasetName: "production" })
})
```

## Input

`datasetName` is required and accepts an events, logs, or traces dataset name or ID. Metrics datasets use the metric-discovery actions instead.

## Output

Returns an array of field definitions. Each item contains `name` and `type`, with `hidden`, `description`, and `unit` when configured. A dataset with no discovered fields returns `[]`.

## Permission and failures

The API token needs the organization-level `datasets|read` capability and access to the target dataset. Axiom returns an error for missing, inaccessible, or unsupported dataset kinds.
