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

# Ingest events

> Ingests 1–10,000 structured JSON events into one dataset.

`axiom.ingestEvents` ingests 1–10,000 structured JSON events into one dataset. `edgeUrl` defaults to the US East 1 (AWS) edge at `https://us-east-1.aws.edge.axiom.co`; set it to the edge that stores the target dataset. The result includes `ingested`, `failed`, `processedBytes`, `blocksCreated`, `walLength`, and optional per-event `failures`.

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

export default automation("Ingest events", () => {
  onHttpRequest({ scope: "automation" })
  axiom.ingestEvents({
    datasetName: "production",
    events: [{ service: "api", level: "info", message: "Started" }],
  })
})
```

## Inputs

| Input         | Required | Default                                 | Description                                             |
| ------------- | -------- | --------------------------------------- | ------------------------------------------------------- |
| `datasetName` | Yes      | —                                       | Target dataset name or ID.                              |
| `events`      | Yes      | —                                       | Array of 1–10,000 JSON objects.                         |
| `edgeUrl`     | No       | `"https://us-east-1.aws.edge.axiom.co"` | Axiom ingest edge or an HTTPS `*.edge.axiom.co` origin. |

## Output

Returns `ingested`, `failed`, `processedBytes`, `blocksCreated`, and `walLength`. When individual events fail validation, `failures` contains their error and timestamp. Check `failed` even when the action succeeds because Axiom can accept part of a batch.

## Permission and failures

The API token needs the dataset-level `ingest|create` capability for `datasetName`. Axiom's edge data endpoint supports API tokens, not personal access tokens. Axiom rejects missing or inaccessible datasets and malformed events. Request-rate limits return `429`, while exhausted ingest limits return `430`; Automate.ax uses Axiom's reset timing when available. This mutation is not retried automatically after an ambiguous provider response.
