---
type: api
title: Get task information
description: Get information about tasks currently running in the cluster.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-cat-tasks
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-cat-tasks
products:
  - Elasticsearch
---

# Get task information

Availability: Experimental since 5.0

## Paths

- `GET` `/_cat/tasks`

## Description

Get information about tasks currently running in the cluster.
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the task management API.

## Required authorization

- Cluster privileges: `monitor`

## 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

- `actions` (string[]) — optional
  The task action names, which are used to limit the response.
- `detailed` (boolean · default: false) — optional
  If `true`, the response includes detailed information about shard recoveries.
- `nodes` (string[]) — optional
  Unique node identifiers, which are used to limit the response.
- `parent_task_id` (string) — optional
  The parent task identifier, which is used to limit the response.
- `h` (union oneOf) — optional
  A comma-separated list of columns names to display. It supports simple wildcards.

Supported values include:
  - `id`: The ID of the task with the node.
  - `action` (or `ac`): The task action.
  - `task_id` (or `ti`): The unique task ID.
  - `parent_task_id` (or `pti`): The parent task ID.
  - `type` (or `ty`): The task type.
  - `start_time` (or `start`): The start time in milliseconds.
  - `timestamp` (or `ts`, `hms`, `hhmmss`): The start time in HH:MM:SS.
  - `running_time_ns` (or `time`): The running time in nanoseconds.
  - `running_time` (or `time`): The running time.
  - `node_id` (or `ni`): The unique node ID.
  - `ip` (or `i`): The IP address.
  - `port` (or `po`): The bound transport port.
  - `node` (or `n`): The node name.
  - `version` (or `v`): The Elasticsearch version.
  - `x_opaque_id` (or `x`): The X-Opaque-ID header.
  Values: `id`, `action`, `ac`, `task_id`, `ti`, `parent_task_id`, `pti`, `type`, `ty`, `start_time`, `start`, `timestamp`, `ts`, `hms`, `hhmmss`, `running_time_ns`, `time`, `running_time`, `node_id`, `ni`, `ip`, `i`, `port`, `po`, `node`, `n`, `version`, `v`, `x_opaque_id`, `x`
- `s` (union oneOf) — optional
  List of columns that determine how the table should be sorted.
Sorting defaults to ascending and can be changed by setting `:asc`
or `:desc` as a suffix to the column name.
  One of: `string[]` or `string`
- `timeout` (string · default: 30s) — optional
  Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.
- `wait_for_completion` (boolean · default: false) — optional
  If `true`, the request blocks until the task has completed.

## Response

`application/json`

Type: `object[]`

An array; each item has these fields:

- `id` (string)
  The identifier of the task with the node.
- `action` (string)
  The task action.
- `task_id` (string)
  The unique task identifier.
- `parent_task_id` (string)
  The parent task identifier.
- `type` (string)
  The task type.
- `start_time` (string)
  The start time in milliseconds.
- `timestamp` (string)
  The start time in `HH:MM:SS` format.
- `running_time_ns` (string)
  The running time in nanoseconds.
- `running_time` (string)
  The running time.
- `node_id` (string)
  The unique node identifier.
- `ip` (string)
  The IP address for the node.
- `port` (string)
  The bound transport port for the node.
- `node` (string)
  The node name.
- `version` (string)
  The Elasticsearch version.
- `x_opaque_id` (string)
  The X-Opaque-ID header.
- `description` (string)
  The task action description.
## Code examples

#### Console

```console
GET _cat/tasks?v=true&format=json
```

#### JavaScript

```javascript
const response = await client.cat.tasks({
  v: "true",
  format: "json",
});
```

#### Python

```python
resp = client.cat.tasks(
    v=True,
    format="json",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_cat/tasks?v=true&format=json" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.cat().tasks(t -> t);
```

#### PHP

```php
$resp = $client->cat()->tasks([
    "v" => "true",
    "format" => "json",
]);
```

#### Ruby

```ruby
response = client.cat.tasks(
  v: "true",
  format: "json"
)
```

## Response examples

#### Cat tasks response example1

A successful response from `GET _cat/tasks?v=true&format=json`.

```json
[
  {
    "action": "cluster:monitor/tasks/lists[n]",
    "task_id": "oTUltX4IQMOUUVeiohTt8A:124",
    "parent_task_id": "oTUltX4IQMOUUVeiohTt8A:123",
    "type": "direct",
    "start_time": "1458585884904",
    "timestamp": "01:48:24",
    "running_time": "44.1micros",
    "ip": "127.0.0.1:9300",
    "node": "oTUltX4IQMOUUVeiohTt8A"
  },
  {
    "action": "cluster:monitor/tasks/lists",
    "task_id": "oTUltX4IQMOUUVeiohTt8A:123",
    "parent_task_id": "-",
    "type": "transport",
    "start_time": "1458585884904",
    "timestamp": "01:48:24",
    "running_time": "186.2micros",
    "ip": "127.0.0.1:9300",
    "node": "oTUltX4IQMOUUVeiohTt8A"
  }
]
```

