Cancel a Message Batch changedapi/beta/messages/batches/cancel
Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+34added
Lines−19removed
From line
1
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits17to this page, all time
# Cancel a Message Batch ## Path parameters ## Headers ## Returns ## Example ### Response (200) ## Cancel a Message Batch ### Path Parameters ### Header Parameters ### Returns ### Example #### Response
The whole hunk
from line 1, old and new numbered
/
from line 1
1---
2title: Cancel a Message Batch
3url: https://platform.claude.com/docs/en/api/beta/messages/batches/cancel
4---
1# Cancel a Message Batch
52
6## Cancel a Message Batch
3**POST** `/v1/messages/batches/{message_batch_id}/cancel`
74
8**post** `/v1/messages/batches/{message_batch_id}/cancel`
9
105Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
116
127The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
from line 8
138
149Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
1510
16### Path Parameters
11## Path parameters
1712
1813- `message_batch_id: string`
1914
2015 ID of the Message Batch.
2116
22### Header Parameters
17## Headers
2318
2419- `"anthropic-beta": optional array of AnthropicBeta`
2520
from line 92
9792
9893 - `"mid-conversation-tool-changes-2026-07-01"`
9994
100### Returns
95## Returns
10196
102- `BetaMessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
97- `BetaMessageBatch object`
10398
10499 - `id: string`
105100
from line 106
111106
112107 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
113108
109 format: date-time
110
114111 - `cancel_initiated_at: string or null`
115112
116113 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
117114
115 format: date-time
116
118117 - `created_at: string`
119118
120119 RFC 3339 datetime string representing the time at which the Message Batch was created.
121120
121 format: date-time
122
122123 - `ended_at: string or null`
123124
124125 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
from line 126
125126
126127 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
127128
129 format: date-time
130
128131 - `expires_at: string`
129132
130133 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
131134
135 format: date-time
136
132137 - `processing_status: "in_progress" or "canceling" or "ended"`
133138
134139 Processing status of the Message Batch.
from line 156
151156
152157 This is zero until processing of the entire Message Batch has ended.
153158
159 default: 0
160
154161 - `errored: number`
155162
156163 Number of requests in the Message Batch that encountered an error.
from line 164
157164
158165 This is zero until processing of the entire Message Batch has ended.
159166
167 default: 0
168
160169 - `expired: number`
161170
162171 Number of requests in the Message Batch that have expired.
from line 172
163172
164173 This is zero until processing of the entire Message Batch has ended.
165174
175 default: 0
176
166177 - `processing: number`
167178
168179 Number of requests in the Message Batch that are processing.
169180
181 default: 0
182
170183 - `succeeded: number`
171184
172185 Number of requests in the Message Batch that have completed successfully.
from line 186
173186
174187 This is zero until processing of the entire Message Batch has ended.
175188
189 default: 0
190
176191 - `results_url: string or null`
177192
178193 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 200
185200
186201 For Message Batches, this is always `"message_batch"`.
187202
188 - `"message_batch"`
203 default: message_batch
189204
190### Example
205## Example
191206
192```http
207```bash
193208curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/cancel \
194209 -X POST \
195210 -H 'anthropic-version: 2023-06-01' \
from line 212
197212 -H "X-Api-Key: $ANTHROPIC_API_KEY"
198213```
199214
200#### Response
215### Response (200)
201216
202217```json
203218{
No line in this hunk matches that.