---
title: "Batch cancel rentals"
method: POST
path: "/admin/rentals/batch-cancel"
tags: ["Admin"]
---

# Batch cancel rentals

`POST /admin/rentals/batch-cancel`

## Request

- Base URL: `https://api.equipmentshare.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.equipmentshare.com/admin/rentals/batch-cancel`
- Auth: HTTP bearer

Cancel multiple rentals in one request. Accepts a flat list of rentals
        (which may span several orders); the backend groups them by order.

        TRANSACTION BEHAVIOR:
        - Each rental is cancelled in its own transaction, so one rental failing
          does not roll back the others (and never rolls back other orders).
        - Cancel is only valid for pre-on-rent rentals (Needs Approval, Draft,
          Pending, Scheduled). A rental past that point is reported "failed" with
          the invariant message, not aborted for the whole batch.
        - An already-cancelled rental is reported "skipped".

        RESPONSE:
        - Returns a per-rental result ([{rental_id, status, message}]) so the
          caller can retry only the rentals that failed.

        EMAIL:
        - Sends the existing per-rental cancellation email to the order's TAMs
          (skipping mobile-tool-trailer rentals), preserving current behaviour.
          Consolidating to one email per order is handled separately (sc-551452),
          which this endpoint enables by grouping cancelled rentals per order.

## Request body

- BatchCancel[]
  - `cancel_reason_note` string
  - `cancel_reason_type` string
  - `rental_id` integer, required

## Response `200`

- AdminRentalsBatchCancelResponse
  - `results` BatchCancelResult[], required: Per-rental outcome, one entry for every rental in the request.
    - `message` string, nullable: Reason a rental was failed or skipped.
    - `rental_id` integer, required
    - `status` string, required: One of "cancelled", "failed", or "skipped".

## Other responses

- `401`: Unauthorized – valid Bearer token required.
- `403`: Forbidden – insufficient permissions.
- `404`: Some or all rentals not found.
- `422`: Request body failed validation.

## Changes

- **2026-12-01** `40651e1558ac`: 1 info
  - added the media type `application/json` for the response with the status `200`
- **2026-12-01** `e598b74c6170`: 1 breaking
  - removed the media type `application/json` for the response with the status `200`
- **2026-11-30** `beba24fafb51`: 1 info
  - added the media type `application/json` for the response with the status `200`
- **2026-11-30** `c20ff16a0438`: 1 breaking
  - removed the media type `application/json` for the response with the status `200`
- **2026-11-30** `f6ee63f54e57`: 1 info
  - added the media type `application/json` for the response with the status `200`

[Operation history](https://skmtc.dev/equipmentshare/apis/es-api/changes/admin/rentals/batch-cancel/post.md)

---

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