# Ingest data to edge deployment

```http
POST https://{axiom-domain}/v1/ingest/{dataset-id}
```

Ingests JSON, NDJSON, or CSV events into an events or logs dataset in this edge deployment. Events that fail are counted in `failed` and listed in `failures`. Events whose timestamp is more than 24 hours in the future or before the Unix epoch (1970-01-01T00:00:00Z) are rejected and not stored. Returns `400` when every event in the request is rejected and `430` when the organization has reached its ingest limit.

<Warning>
  Use this endpoint to ingest data into a specific edge deployment. For more information, see [Ingest data](/restapi/ingest) and [Edge deployments](/reference/edge-deployments).

  The base domain for this endpoint is the base domain of the edge deployment where you want to ingest data.

  <BaseDomains />

  This endpoint only supports API tokens. Personal access tokens (PATs) aren't supported. For more information, see [Tokens](/reference/tokens).
</Warning>

## Authentication

Authenticate using an API token or personal access token (PAT). Include the token as a Bearer token: `Authorization: Bearer <token>`. For more information, see [Tokens](/reference/tokens).

## Parameters

- `dataset-id` (path; string; required)
- `timestamp-field` (query; string): The name of the field to use as the timestamp. If not specified, the timestamp will be the time the event was received by Axiom.
- `timestamp-format` (query; string): The date-time format of the timestamp field. The reference time is `Mon Jan 2 15:04:05 -0700 MST 2006`, as specified in https://pkg.go.dev/time/?tab=doc#Parse
- `csv-delimiter` (query; string): The delimiter to use when parsing CSV data. If not specified, the default delimiter is `,`.
- `X-Axiom-CSV-Fields` (header; array of string): A list of optional comma separated fields to use for CSV ingestion. If not specified, the first line of the CSV will be used as the field names.
- `X-Axiom-Event-Labels` (header; string): An optional JSON encoded object with additional labels to add to all events in the request

## Request body

Content type: `application/json` (required)

Type: string (binary)
Content type: `application/nd-json` (required)

Type: string (binary)
Content type: `text/csv` (required)

Type: string (binary)
Content type: `application/x-ndjson` (required)

Type: string (binary)

## Responses

### 200: Ingest result, including any per-event failures.

Content type: `application/json`

- `blocksCreated` (integer (uint32); required)
- `failed` (integer (uint64); required)
- `failures` (array of `IngestFailure`)
- `ingested` (integer (uint64); required)
- `processedBytes` (integer (uint64); required)
- `walLength` (integer (uint32); required)

### 400: The dataset name is invalid or reserved, the dataset is in another edge deployment or isn't an events or logs dataset, or every event in the request was rejected.

Content type: `application/json`

- `code` (integer): HTTP status code of the error
- `message` (string): A formatted user-facing error message

### 403: The token can't ingest into this dataset, the dataset is shared from another organization, or the organization is suspended.

Content type: `application/json`

- `code` (integer): HTTP status code of the error
- `message` (string): A formatted user-facing error message

### 404: Dataset not found.

Content type: `application/json`

- `code` (integer): HTTP status code of the error
- `message` (string): A formatted user-facing error message

### 430: The organization has reached its ingest limit.

Content type: `application/json`

- `code` (integer): HTTP status code of the error
- `message` (string): A formatted user-facing error message

## Schemas

### IngestFailure

Object.

- `error` (string; required)
- `timestamp` (string (date-time); required)