---
type: api
title: Get the rollup job capabilities
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v8/operation/operation-rollup-get-rollup-caps
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v8/operation/operation-rollup-get-rollup-caps
products:
  - Elasticsearch
---

# Get the rollup job capabilities


deprecated

Availability: Preview since 6.3

## Paths

- `GET` `/_rollup/data/{id}`
- `GET` `/_rollup/data`

#### Path parameters

- `id` (string) — optional, leave it out to use `/_rollup/data`
  Index, indices or index-pattern to return rollup capabilities for.
`_all` may be used to fetch rollup capabilities from all jobs.

## Description

Get the capabilities of any rollup jobs that have been configured for a specific index or index pattern.

This API is useful because a rollup job is often configured to rollup only a subset of fields from the source index.
Furthermore, only certain aggregations can be configured for various fields, leading to a limited subset of functionality depending on that configuration.
This API enables you to inspect an index and determine:

1. Does this index have associated rollup data somewhere in the cluster?
2. If yes to the first question, what fields were rolled up, what aggregations can be performed, and where does the data live?

## Required authorization

- Cluster privileges: `monitor_rollup`

## 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/guide/en/elasticsearch/reference/current/token-authentication-services.html)

## Response

`application/json`

- `<string>` (object)
  - `rollup_jobs` (object[])
    There can be multiple, independent jobs configured for a single index or index pattern. Each of these jobs may have different configurations, so the API returns a list of all the various configurations available.
    - `fields` (map string to object)
    - `index_pattern` (string)
    - `job_id` (string)
    - `rollup_index` (string)
## Code examples

#### Console

```console
GET _rollup/data/sensor-*
```

#### JavaScript

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

#### Python

```python
resp = client.rollup.get_rollup_caps(
    id="sensor-*",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_rollup/data/sensor-*" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.rollup().getRollupCaps(g -> g
    .id("sensor-*")
);
```

#### C#

```c#
var response = await client.Rollup
    .GetRollupCapsAsync(d1 => d1
        .Id("sensor-*")
    );
```

#### PHP

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

#### Ruby

```ruby
response = client.perform_request(
  "GET",
  "/_rollup/data/sensor-*",
  {},
)
```

## Response examples

#### Get rollup capabilities response example1

A successful response from `GET _rollup/data/sensor-*` for a rollup job that targets the index pattern `sensor-*`. The response contains the rollup job ID, the index that holds the rolled data, and the index pattern that the job was targeting. It also shows a list of fields that contain data eligible for rollup searches. For example, you can use a `min`, `max`, or `sum` aggregation on the `temperature` field, but only a `date_histogram` on `timestamp`.

```json
{
  "sensor-*" : {
    "rollup_jobs" : [
      {
        "job_id" : "sensor",
        "rollup_index" : "sensor_rollup",
        "index_pattern" : "sensor-*",
        "fields" : {
          "node" : [
            {
              "agg" : "terms"
            }
          ],
          "temperature" : [
            {
              "agg" : "min"
            },
            {
              "agg" : "max"
            },
            {
              "agg" : "sum"
            }
          ],
          "timestamp" : [
            {
              "agg" : "date_histogram",
              "time_zone" : "UTC",
              "fixed_interval" : "1h",
              "delay": "7d"
            }
          ],
          "voltage" : [
            {
              "agg" : "avg"
            }
          ]
        }
      }
    ]
  }
}
```

