---
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/4371/api/doc/elasticsearch/v9/operation/operation-cat-tasks
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-cat-tasks
products:
  - Elasticsearch
---

# Get task information

Availability: 5.0+

## Paths

- `GET` `/_cat/tasks`

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

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

## Query String Parameters

- `actions` ([] string)
  The task action names, which are used to limit the response.
- `detailed` (boolean · default: false)
  If `true`, the response includes detailed information about shard recoveries.
- `nodes` ([] string)
  Unique node identifiers, which are used to limit the response.
- `parent_task_id` (string)
  The parent task identifier, which is used to limit the response.
- `h` (union CatTasksColumns)
  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 Names)
  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: `Name` or `Name[]`
- `timeout` (string Duration · default: 30s)
  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)
  If `true`, the request blocks until the task has completed.

## Response

`application/json`

Type: `[] TasksRecord`

- `id` (string Id)
  The identifier of the task with the node.
- `action` (string)
  The task action.
- `task_id` (string Id)
  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"
  }
]
```

