---
type: api
title: Delete a rollup job
description: A job must be stopped before it can be deleted.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-rollup-delete-job
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-rollup-delete-job
products:
  - Elasticsearch
---

# Delete a rollup job

deprecated

Availability: 6.3+

## Paths

- `DELETE` `/_rollup/job/{id}`

- [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 job.

## Description

A job must be stopped before it can be deleted.
If you attempt to delete a started job, an error occurs.
Similarly, if you attempt to delete a nonexistent job, an exception occurs.

IMPORTANT: When you delete a job, you remove only the process that is actively monitoring and rolling up data.
The API does not delete any previously rolled up data.
This is by design; a user may wish to roll up a static data set.
Because the data set is static, after it has been fully rolled up there is no need to keep the indexing rollup job around (as there will be no new data).
Thus the job can be deleted, leaving behind the rolled up data for analysis.
If you wish to also remove the rollup data and the rollup index contains the data for only a single job, you can delete the whole rollup index.
If the rollup index stores data from several jobs, you must issue a delete-by-query that targets the rollup job's identifier in the rollup index. For example:

```
POST my_rollup_index/_delete_by_query
{
  "query": {
    "term": {
      "_rollup.id": "the_rollup_job_id"
    }
  }
}
```

## Required authorization

* Cluster privileges: `manage_rollup`

## Response

`application/json`

- `acknowledged` (boolean)
- `task_failures` ([] TaskFailure)
  - `task_id` (number)
  - `node_id` (string)
  - `status` (string)
  - `reason` ({} ErrorCause)
    - `type` (string)
      The type of error
    - `reason` (union string) — nullable
      A human-readable explanation of the error, in English.
      One of: `string`
    - `stack_trace` (string)
      The server stack trace. Present only if the `error_trace=true` parameter was sent with the request.
    - `caused_by` ({} ErrorCause) — recursive
      Same fields as `reason` in `task_failures`
    - `root_cause` ([] ErrorCause) — recursive
      Same fields as `reason` in `task_failures`
    - `suppressed` ([] ErrorCause) — recursive
      Same fields as `reason` in `task_failures`
## Code Examples

#### Console

```console
DELETE _rollup/job/sensor
```

#### JavaScript

```javascript
const response = await client.rollup.deleteJob({
  id: "sensor",
});
```

#### Python

```python
resp = client.rollup.delete_job(
    id="sensor",
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_rollup/job/sensor" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.rollup().deleteJob(d -> d
    .id("sensor")
);
```

#### C#

```c#
var response = await client.Rollup.DeleteJobAsync(id: "sensor");
```

#### PHP

```php
$resp = $client->rollup()->deleteJob([
    "id" => "sensor",
]);
```

#### Ruby

```ruby
response = client.perform_request(
  "DELETE",
  "/_rollup/job/sensor",
  {},
)
```

## Response Examples

#### Delete rollup job response example1

A successful response from `DELETE _rollup/job/sensor`.

```json
{
  "acknowledged": true
}
```

