---
title: "Update Batch Session"
method: PATCH
path: "/v1/batch-sessions/{batch_id}"
tags: ["Batch Sessions"]
---

# Update Batch Session

`PATCH /v1/batch-sessions/{batch_id}`

## Request

- Base URL: `https://api.anchorbrowser.io`
- URL: `https://api.anchorbrowser.io/v1/batch-sessions/{batch_id}`
- Auth: API key in header `anchor-api-key`

Updates a batch session. Supports cancelling a running or pending batch,
which terminates all running sessions in the batch.

## Path parameters

- `batch_id` string, uuid, required

## Request body

- BatchSessionUpdateRequestSchema
  - `status` 'cancelled', required: Target status for the batch

## Response `200`

Batch updated successfully

- object
  - `data` BatchSessionUpdateResponseSchema
    - `batch_id` string, uuid: Unique identifier for the batch
    - `status` 'cancelled': New status of the batch
    - `cancelled_sessions` integer: Number of running sessions that were terminated
    - `message` string: Summary message

## Other responses

- `401`: Invalid API Key
- `404`: Batch not found
- `409`: Invalid state transition (batch already cancelled or completed)
- `500`: Internal server error

## Changes

- **2026-10-16** `b3bfdb98c79e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api/changes/v1/batch-sessions/:batch_id/patch.md)

---

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