---
type: api
title: Send data to an anomaly detection job for analysis
description: IMPORTANT: For each job, data can be accepted from only a single connection at a time.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-ml-post-data
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-ml-post-data
products:
  - Elasticsearch
---

# Send data to an anomaly detection job for analysis

deprecated

Availability: Generally available since 5.4

## Paths

- `POST` `/_ml/anomaly_detectors/{job_id}/_data`

#### Path parameters

- `job_id` (string) — required
  Identifier for the anomaly detection job. The job must have a state of open to receive and process the data.

## Description

IMPORTANT: For each job, data can be accepted from only a single connection at a time.
It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list.

## Required authorization

- Cluster privileges: `manage_ml`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Query string parameters

- `reset_end` (union oneOf) — optional
  Specifies the end of the bucket resetting range.
  One of: `string` or `number`
- `reset_start` (union oneOf) — optional
  Specifies the start of the bucket resetting range.
  One of: `string` or `number`

## Request body

`application/json`

Type: `object[]`


## Response

`application/json`

- `job_id` (string)
- `processed_record_count` (number)
- `processed_field_count` (number)
- `input_bytes` (number)
- `input_field_count` (number)
- `invalid_date_count` (number)
- `missing_field_count` (number)
- `out_of_order_timestamp_count` (number)
- `empty_bucket_count` (number)
- `sparse_bucket_count` (number)
- `bucket_count` (number)
- `earliest_record_timestamp` (number)
- `latest_record_timestamp` (number)
- `last_data_time` (number)
- `latest_empty_bucket_timestamp` (number)
- `latest_sparse_bucket_timestamp` (number)
- `input_record_count` (number)
- `log_time` (number)
## Code examples

#### Console

```console
POST /_ml/anomaly_detectors/JOB_ID/_data
[
  {}
]
```

#### curl

```curl
curl -X POST "${ELASTICSEARCH_URL}/_ml/anomaly_detectors/${JOB_ID}/_data" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '[
    {}
  ]'
```

