Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

Cancel a Message Batch changedapi/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+29added
Lines−14removed
From line 1 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits6to this page, all time

# Cancel a Message Batch ## Path parameters ## Returns ## Example ### Response (200) ## Cancel a Message Batch ### Path Parameters ### Returns ### Example #### Response

The whole hunk

from line 1, old and new numbered
/
lines
from line 1
1---
2title: Cancel a Message Batch
3url: https://platform.claude.com/docs/en/api/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### Returns
17## Returns
2318 
24- `MessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
19- `MessageBatch object`
2520 
2621 - `id: string`
2722 
from line 28
3328 
3429 RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
3530 
31 format: date-time
32 
3633 - `cancel_initiated_at: string or null`
3734 
3835 RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
3936 
37 format: date-time
38 
4039 - `created_at: string`
4140 
4241 RFC 3339 datetime string representing the time at which the Message Batch was created.
4342 
43 format: date-time
44 
4445 - `ended_at: string or null`
4546 
4647 RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
from line 48
4748 
4849 Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
4950 
51 format: date-time
52 
5053 - `expires_at: string`
5154 
5255 RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
5356 
57 format: date-time
58 
5459 - `processing_status: "in_progress" or "canceling" or "ended"`
5560 
5661 Processing status of the Message Batch.
from line 78
7378 
7479 This is zero until processing of the entire Message Batch has ended.
7580 
81 default: 0
82 
7683 - `errored: number`
7784 
7885 Number of requests in the Message Batch that encountered an error.
from line 86
7986 
8087 This is zero until processing of the entire Message Batch has ended.
8188 
89 default: 0
90 
8291 - `expired: number`
8392 
8493 Number of requests in the Message Batch that have expired.
from line 94
8594 
8695 This is zero until processing of the entire Message Batch has ended.
8796 
97 default: 0
98 
8899 - `processing: number`
89100 
90101 Number of requests in the Message Batch that are processing.
91102 
103 default: 0
104 
92105 - `succeeded: number`
93106 
94107 Number of requests in the Message Batch that have completed successfully.
from line 108
95108 
96109 This is zero until processing of the entire Message Batch has ended.
97110 
111 default: 0
112 
98113 - `results_url: string or null`
99114 
100115 URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
from line 122
107122 
108123 For Message Batches, this is always `"message_batch"`.
109124 
110 - `"message_batch"`
125 default: message_batch
111126 
112### Example
127## Example
113128 
114```http
129```bash
115130curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/cancel \
116131 -X POST \
117132 -H 'anthropic-version: 2023-06-01' \
from line 133
118133 -H "X-Api-Key: $ANTHROPIC_API_KEY"
119134```
120135 
121#### Response
136### Response (200)
122137 
123138```json
124139{
Feedback