---
title: "Cancel a batch"
method: POST
path: "/email/batches/{id}/cancel"
tags: ["Emails"]
---

# Cancel a batch

`POST /email/batches/{id}/cancel`

## Request

- Base URL: `https://www.unitpost.com/api/v1`
- URL: `https://www.unitpost.com/api/v1/email/batches/{id}/cancel`
- Auth: HTTP bearer

Cancel every still-cancelable message in a batch in one call. Messages that have already been sent are left untouched — only queued or scheduled ones are stopped. Check what remains cancelable first with [Retrieve a batch](#get-email-batches-id). Requires the `emails:send` capability.

## Response `200`

The updated batch.

- Batch
  - `object` 'batch', required
  - `id` string, required
  - `count` integer, required
  - `scheduled_at` string, nullable, required
  - `created_at` string, required
  - `status_counts` object, required: Live child counts keyed by status (e.g. { delivered: 98, failed: 2 }).
  - `cancelable` integer, required

## Other responses

- `401`: Missing or invalid API key.
- `403`: Insufficient scope.
- `404`: Batch not found.
- `409`: Nothing left to cancel in this batch.

---

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