<commit_before>[[cat-pending-tasks]]
=== cat pending tasks

`pending_tasks` provides the same information as the
<<cluster-pending,`/_cluster/pending_tasks`>> API in a
convenient tabular format. For example:

[source,js]
--------------------------------------------------
GET /_cat/pending_tasks?v
--------------------------------------------------
// CONSOLE

Might look like:

[source,txt]
--------------------------------------------------
insertOrder timeInQueue priority source
       1685       855ms HIGH     update-mapping [foo][t]
       1686       843ms HIGH     update-mapping [foo][t]
       1693       753ms HIGH     refresh-mapping [foo][[t]]
       1688       816ms HIGH     update-mapping [foo][t]
       1689       802ms HIGH     update-mapping [foo][t]
       1690       787ms HIGH     update-mapping [foo][t]
       1691       773ms HIGH     update-mapping [foo][t]
--------------------------------------------------
// TESTRESPONSE[s/(\n.+)+/(\\n.+)*/ non_json]<commit_msg>[DOCS] Reformats cat pending tasks API (#45287)<commit_after>[[cat-pending-tasks]]
=== cat pending tasks

Returns cluster-level changes that have not yet been executed, similar to the
<<cluster-pending, pending cluster tasks>> API.

[[cat-pending-tasks-api-request]]
==== {api-request-title}

`GET /_cat/pending_tasks`

[[cat-pending-tasks-api-query-params]]
==== {api-query-parms-title}

include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]

include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]

include::{docdir}/rest-api/common-parms.asciidoc[tag=help]

include::{docdir}/rest-api/common-parms.asciidoc[tag=local]

include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]

include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]

include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]


[[cat-pending-tasks-api-example]]
==== {api-examples-title}

[source,js]
--------------------------------------------------
GET /_cat/pending_tasks?v
--------------------------------------------------
// CONSOLE

The API returns the following response:

[source,txt]
--------------------------------------------------
insertOrder timeInQueue priority source
       1685       855ms HIGH     update-mapping [foo][t]
       1686       843ms HIGH     update-mapping [foo][t]
       1693       753ms HIGH     refresh-mapping [foo][[t]]
       1688       816ms HIGH     update-mapping [foo][t]
       1689       802ms HIGH     update-mapping [foo][t]
       1690       787ms HIGH     update-mapping [foo][t]
       1691       773ms HIGH     update-mapping [foo][t]
--------------------------------------------------
// TESTRESPONSE[s/(\n.+)+/(\\n.+)*/ non_json]
{'fraction_non_alphanumeric': 0.27350746268656717, 'fraction_numerical': 0.038432835820895524, 'mean_word_length': 1.8161764705882353, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6258888', 'n_tokens_mistral': 864, 'n_tokens_neox': 810, 'n_words': 162}