---
title: "Gets the Task counts for the specified Job."
method: GET
path: "/jobs/{jobId}/taskcounts"
tags: ["Jobs"]
---

# Gets the Task counts for the specified Job.

`GET /jobs/{jobId}/taskcounts`

Task counts provide a count of the Tasks by active, running or completed Task
state, and a count of Tasks which succeeded or failed. Tasks in the preparing
state are counted as running. Note that the numbers returned may not always be
up to date. If you need exact task counts, use a list query.

## Path parameters

- `jobId` string, required

## Query parameters

- `api-version` string, required
- `timeOut` integer

## Headers

- `client-request-id` string
- `return-client-request-id` boolean
- `ocp-date` string, date-time-rfc7231

## Response `200`

The request has succeeded.

- BatchTaskCountsResult — The Task and TaskSlot counts for a Job.
  - `taskCounts` BatchTaskCounts, required — The Task counts for a Job.
    - `active` integer, required — The number of Tasks in the active state.
    - `running` integer, required — The number of Tasks in the running or preparing state.
    - `completed` integer, required — The number of Tasks in the completed state.
    - `succeeded` integer, required — The number of Tasks which succeeded. A Task succeeds if its result (found in the executionInfo property) is 'success'.
    - `failed` integer, required — The number of Tasks which failed. A Task fails if its result (found in the executionInfo property) is 'failure'.
  - `taskSlotCounts` BatchTaskSlotCounts, required — The TaskSlot counts for a Job.
    - `active` integer, required — The number of TaskSlots for active Tasks.
    - `running` integer, required — The number of TaskSlots for running Tasks.
    - `completed` integer, required — The number of TaskSlots for completed Tasks.
    - `succeeded` integer, required — The number of TaskSlots for succeeded Tasks.
    - `failed` integer, required — The number of TaskSlots for failed Tasks.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/batch-batch.md) · [All operations](https://skmtc.net/azure/apis/batch-batch/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/batch-batch/revisions/8427acd8fd77/schema)
