# Ingest raw Splunk HEC events

```http
POST https://hec.{axiom-domain}/services/collector/raw
```

Ingests a raw payload into an events or logs dataset. Each line of a plain-text body becomes one event. Event metadata comes from the `host`, `source`, and `sourcetype` query parameters instead of an envelope.

<Warning>
  Use this endpoint to ingest raw payloads through the Splunk HTTP Event Collector (HEC) compatible API. For a walkthrough, see [Send data with the Splunk HEC API](/send-data/splunk-hec).

  The base domain for this endpoint is `hec.` prefixed to the base domain of your edge deployment. For example, if your edge deployment’s base domain is `us-east-1.aws.edge.axiom.co`, the HEC endpoint is `https://hec.us-east-1.aws.edge.axiom.co`.

  <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 with ingest permission. HEC clients typically send the token in the Splunk scheme: `Authorization: Splunk <token>`. The Bearer scheme (`Authorization: Bearer <token>`) and HTTP Basic (`x:<token>`) are also accepted. For more information, see [Tokens](/reference/tokens).

## Parameters

- `index` (query; string): The dataset (Splunk index) to ingest into.
- `sourcetype` (query; string): The sourcetype to attach to every event in the request.
- `source` (query; string): The source to attach to every event in the request.
- `host` (query; string): The host to attach to every event in the request.

## Request body

Content type: `text/plain` (required)

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

Type: string (binary)

## Responses

### 200: The events were accepted.

Content type: `application/json`

The Splunk HEC status envelope.

- `text` (string; required): A human-readable status message.
- `code` (integer; required): The Splunk status code. `0` indicates success, `17` indicates a healthy collector, and `5`, `6`, and `7` indicate no data, invalid data format, and incorrect index respectively.

### 400: The request can't be processed. `code` is `5` (no data), `6` (invalid data format, or the dataset is in another edge deployment or isn't an events or logs dataset), or `7` (no dataset could be resolved).

Content type: `application/json`

The Splunk HEC status envelope.

- `text` (string; required): A human-readable status message.
- `code` (integer; required): The Splunk status code. `0` indicates success, `17` indicates a healthy collector, and `5`, `6`, and `7` indicate no data, invalid data format, and incorrect index respectively.

### 401: The token is missing (`code` `2`) or invalid (`code` `3`).

Content type: `application/json`

The Splunk HEC status envelope.

- `text` (string; required): A human-readable status message.
- `code` (integer; required): The Splunk status code. `0` indicates success, `17` indicates a healthy collector, and `5`, `6`, and `7` indicate no data, invalid data format, and incorrect index respectively.

### 403: The token can't ingest into the dataset, the dataset is shared, or the organization is suspended. `code` is `4`.

Content type: `application/json`

The Splunk HEC status envelope.

- `text` (string; required): A human-readable status message.
- `code` (integer; required): The Splunk status code. `0` indicates success, `17` indicates a healthy collector, and `5`, `6`, and `7` indicate no data, invalid data format, and incorrect index respectively.

### 404: Dataset not found. `code` is `7`.

Content type: `application/json`

The Splunk HEC status envelope.

- `text` (string; required): A human-readable status message.
- `code` (integer; required): The Splunk status code. `0` indicates success, `17` indicates a healthy collector, and `5`, `6`, and `7` indicate no data, invalid data format, and incorrect index respectively.