---
title: "Terminates the specified task."
method: POST
path: "/jobs/{jobId}/tasks/{taskId}/terminate"
tags: ["Tasks"]
---

# Terminates the specified task.

`POST /jobs/{jobId}/tasks/{taskId}/terminate`

When the task has been terminated, it moves to the completed state. For multi-instance tasks, the terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in the background.

## Path parameters

- `jobId` string, required
- `taskId` string, required

## Query parameters

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

## Headers

- `client-request-id` string, uuid
- `return-client-request-id` boolean
- `ocp-date` string, date-time-rfc1123
- `If-Match` string
- `If-None-Match` string
- `If-Modified-Since` string, date-time-rfc1123
- `If-Unmodified-Since` string, date-time-rfc1123

## Response `204`

The request to the Batch service was successful.

## Other responses

- `default` — The error from the Batch service.

---

[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/dff38446805d/schema)
