---
type: api
title: Start a data frame analytics job
description: A data frame analytics job can be started and stopped multiple times
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-ml-start-data-frame-analytics
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-ml-start-data-frame-analytics
products:
  - Elasticsearch
---

# Start a data frame analytics job

Availability: 7.3+

## Paths

- `POST` `/_ml/data_frame/analytics/{id}/_start`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#bearerauth)

#### Path Parameters

- `id` (string Id)
  Identifier for the data frame analytics job. This identifier can contain
lowercase alphanumeric characters (a-z and 0-9), hyphens, and
underscores. It must start and end with alphanumeric characters.

## Description

A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
If the destination index does not exist, it is created automatically the
first time you start the data frame analytics job. The
`index.number_of_shards` and `index.number_of_replicas` settings for the
destination index are copied from the source index. If there are multiple
source indices, the destination index copies the highest setting values. The
mappings for the destination index are also copied from the source indices.
If there are any mapping conflicts, the job fails to start.
If the destination index exists, it is used as is. You can therefore set up
the destination index in advance with custom settings and mappings.

## Required authorization

* Index privileges: `create_index`,`index`,`manage`,`read`,`view_index_metadata`
* Cluster privileges: `manage_ml`

## Query String Parameters

- `timeout` (string Duration · default: 20s)
  Controls the amount of time to wait until the data frame analytics job
starts.

## Request Body

`application/json`

- `id` (string Id) — optional
  If provided, must be the same identifier as in the path.
- `timeout` (string Duration · default: 20s) — optional
  Controls the amount of time to wait until the data frame analytics job
starts.

## Response

`application/json`

- `acknowledged` (boolean)
- `node` (string)
  The ID of the node that the job was started on. If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
The node ID of the node the job has been assigned to, or
an empty string if it hasn't been assigned to a node. In
serverless if the job has been assigned to run then the
node ID will be "serverless".
## Code Examples

#### Console

```console
POST _ml/data_frame/analytics/loganalytics/_start
```

#### JavaScript

```javascript
const response = await client.ml.startDataFrameAnalytics({
  id: "loganalytics",
});
```

#### Python

```python
resp = client.ml.start_data_frame_analytics(
    id="loganalytics",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics/_start" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.ml().startDataFrameAnalytics(s -> s
    .id("loganalytics")
);
```

#### C#

```c#
var response = await client.MachineLearning.StartDataFrameAnalyticsAsync(id: "loganalytics");
```

#### PHP

```php
$resp = $client->ml()->startDataFrameAnalytics([
    "id" => "loganalytics",
]);
```

#### Ruby

```ruby
response = client.ml.start_data_frame_analytics(
  id: "loganalytics"
)
```

