---
type: api
title: Get pending task information
description: Get information about cluster-level changes that have not yet taken effect.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-cat-pending-tasks
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-cat-pending-tasks
products:
  - Elasticsearch
---

# Get pending task information

Availability:

## Paths

- `GET` `/_cat/pending_tasks`

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

## Description

Get information about cluster-level changes that have not yet taken effect.
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 pending cluster tasks API.

## Required authorization

* Cluster privileges: `monitor`

## Query String Parameters

- `h` (union Names)
  List of columns to appear in the response. Supports simple wildcards.
  One of: `Name` or `Name[]`
- `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[]`
- `local` (boolean · default: false)
  If `true`, the request computes the list of selected nodes from the
local cluster state. If `false` the list of selected nodes are computed
from the cluster state of the master node. In both cases the coordinating
node will send requests for further information to each selected node.
- `master_timeout` (string Duration · default: 30s)
  Period to wait for a connection to the master node.

## Response

`application/json`

Type: `[] PendingTasksRecord`

- `insertOrder` (string)
  The task insertion order.
- `timeInQueue` (string)
  Indicates how long the task has been in queue.
- `priority` (string)
  The task priority.
- `source` (string)
  The task source.
## Code Examples

#### Console

```console
GET /_cat/pending_tasks?v=true&h=insertOrder,timeInQueue,priority,source&format=json
```

#### JavaScript

```javascript
const response = await client.cat.pendingTasks({
  v: "true",
  h: "insertOrder,timeInQueue,priority,source",
  format: "json",
});
```

#### Python

```python
resp = client.cat.pending_tasks(
    v=True,
    h="insertOrder,timeInQueue,priority,source",
    format="json",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_cat/pending_tasks?v=true&h=insertOrder,timeInQueue,priority,source&format=json" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.cat().pendingTasks();
```

#### PHP

```php
$resp = $client->cat()->pendingTasks([
    "v" => "true",
    "h" => "insertOrder,timeInQueue,priority,source",
    "format" => "json",
]);
```

#### Ruby

```ruby
response = client.cat.pending_tasks(
  v: "true",
  h: "insertOrder,timeInQueue,priority,source",
  format: "json"
)
```

## Response Examples

#### Cat pending tasks response example1

A successful response from `GET /_cat/pending_tasks?v=true&h=insertOrder,timeInQueue,priority,source&format=json`.

```json
[
  { "insertOrder": "1685", "timeInQueue": "855ms", "priority": "HIGH", "source": "update-mapping [foo][t]"},
    { "insertOrder": "1686", "timeInQueue": "843ms", "priority": "HIGH", "source": "update-mapping [foo][t]"},
    { "insertOrder": "1693", "timeInQueue": "753ms", "priority": "HIGH", "source": "refresh-mapping [foo][[t]]"},
    { "insertOrder": "1688", "timeInQueue": "816ms", "priority": "HIGH", "source": "update-mapping [foo][t]"},
    { "insertOrder": "1689", "timeInQueue": "802ms", "priority": "HIGH", "source": "update-mapping [foo][t]"},
    { "insertOrder": "1690", "timeInQueue": "787ms", "priority": "HIGH", "source": "update-mapping [foo][t]"},
    { "insertOrder": "1691", "timeInQueue": "773ms", "priority": "HIGH", "source": "update-mapping [foo][t]"}
]
```

