---
title: "Public Cancel Batch"
method: POST
path: "/v1/batches/{batch_id}/cancel"
tags: ["public-api"]
---

# Public Cancel Batch

`POST /v1/batches/{batch_id}/cancel`

## Request

- Base URL: `https://api.trainloop.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.trainloop.ai/v1/batches/{batch_id}/cancel`
- Auth: none declared

Stop a batch. In-flight items finish; nothing new starts. Outputs
already delivered stay delivered.

## Path parameters

- `batch_id` string, uuid, required

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- BatchResponse
  - `id` string, uuid, required
  - `pipeline` string, required
  - `status` 'queued' | 'dispatched' | 'running' | 'completed' | 'completed_with_errors' | 'failed' | 'cancelled', required
  - `connection_id` string, uuid, required
  - `input_path` string, required
  - `output_path` string, required
  - `options` object, required
  - `item_total` integer, required
  - `item_done` integer, required
  - `item_skipped` integer, required
  - `item_failed` integer, required
  - `error` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `started_at` string, date-time, nullable, required
  - `finished_at` string, date-time, nullable, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-09** `dec6fd242e40`: 2 info
  - api operation id `cancel_batch_v1_batches__batch_id__cancel_post` removed and replaced with `public_cancel_batch_v1_batches__batch_id__cancel_post`
  - api tag `batches` removed
- **2026-09-09** `26478f75ef09`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/trainloop/apis/trainloop-api/changes/v1/batches/:batch_id/cancel/post.md)

---

[API](https://skmtc.dev/trainloop/apis/trainloop-api.md) - [All operations](https://skmtc.dev/trainloop/apis/trainloop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trainloop/apis/trainloop-api/revisions/f11e38cf6836?raw)
