# How do I submit a Claude Message Batch and match each result to my input?

Exam: CCDV-F — Claude Certified Developer - Foundations
Knowledge domain: Applications and Integration
Updated: 2026-11-25T08:29:59.378044+00:00
HTML: https://learningpathx.com/faq/CCDV-F/ccdvf-submit-reconcile-claude-message-batches.html

## Also asked as

- How do custom\_id and result types work in Claude Message Batches?
- How do I poll a Claude batch and process out-of-order results without losing requests?

For deferred independent work on the first-party Claude API, submit each Messages payload as its own batch entry with a unique `custom_id`. Save the returned batch ID and entries together. Poll the batch’s status endpoint until `processing_status` is `ended`, then read the results file by `custom_id`. Results can appear in any order, and an ended batch can contain failures and successes.

1. Validate each payload, including supported parameters and a positive `max_tokens`. Check the batch payload and item limits, workspace, and queue capacity. For first-party batches the documented ceiling is 100,000 requests or 256 MB, whichever comes first.
2. Persist a mapping from each `custom_id` to its input and keep the batch ID in the correct workspace. Poll with bounded pacing and review finalized counts at `ended`, when item outcomes become available. The batch can expire after 24 hours with unfinished entries.
3. Read one JSON object per line, and retain the file only as allowed by the application's data policy. For `succeeded`, validate the returned Message as you would a standard response. Record `errored`, `canceled`, and `expired` separately. Associated errors determine whether an item needs correction or qualifies for retry.
4. Compare result IDs to all expected IDs and validate before publishing or writing downstream. Keep consumers idempotent, for example by recording which application work key has already been accepted. Fetch results within the 29-day window measured from batch creation.

A batch can contain a request with multi-turn history. It processes entries independently, so use separate orchestration when one entry needs another entry's answer. Streaming a JSONL result file after processing is different from receiving live Messages SSE deltas during generation.

**Official references**

* [Claude Message Batches guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
* [Claude Message Batches API reference](https://platform.claude.com/docs/en/api/messages/batches)
* [Retrieve Message Batch results](https://platform.claude.com/docs/en/api/messages/batches/results)
* [Claude API rate limits](https://platform.claude.com/docs/en/api/rate-limits)

Source: [Choosing Claude API Workload Modes for Vision, Thinking, and Batch Processing](https://learningpathx.com/news/choosing-claude-api-workload-modes-for-vision-thinking-and-batch-processing.html)
