> ## 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.

# Create dataset

> Creates a dataset and returns its resource.

`axiom.createDataset` creates a dataset and returns its resource. `kind` defaults to `axiom:events:v1`; use an OpenTelemetry kind for logs, metrics, or traces.

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

export default automation("Create dataset", () => {
  onHttpRequest({ scope: "automation" })
  axiom.createDataset({
    name: "production",
    description: "Production logs",
    retentionDays: 30,
    useRetentionPeriod: true,
  })
})
```

## Inputs

| Input                | Required | Default             | Description                                                                        |
| -------------------- | -------- | ------------------- | ---------------------------------------------------------------------------------- |
| `name`               | Yes      | —                   | Non-empty dataset name.                                                            |
| `kind`               | No       | `"axiom:events:v1"` | `"axiom:events:v1"`, `"otel:logs:v1"`, `"otel:metrics:v1"`, or `"otel:traces:v1"`. |
| `description`        | No       | —                   | Dataset description.                                                               |
| `retentionDays`      | No       | —                   | Non-negative retention period in days.                                             |
| `useRetentionPeriod` | No       | —                   | Whether Axiom applies `retentionDays`.                                             |
| `edgeDeployment`     | No       | —                   | Axiom edge deployment identifier.                                                  |

## Output

Returns the created dataset resource, including its stable `id`, name, kind, owner, timestamps, and configured retention or edge fields.

## Permission and failures

The API token needs the organization-level `datasets|create` capability. Axiom rejects duplicate or invalid names, unsupported settings, and edge deployments the token cannot use. This mutation is not retried automatically after an ambiguous provider response.
