Too many items requested for the BatchWriteItem call
TL;DR — BatchWriteItem accepts at most 25 put/delete actions per call (and ≤16 MB total). You sent more than 25, so DynamoDB rejected the whole request. Split your items into chunks of 25 or fewer and issue one BatchWriteItem per chunk.
What it means
ValidationException: 1 validation error detected: Value '<your request>' at 'requestItems' failed to satisfy constraint: Map value must satisfy constraint: [Member must have length less than or equal to 25, Member must have length greater than or equal to 1]
# on DynamoDB Local the same call is rejected with a shorter sentence:
ValidationException: Too many items requested for the BatchWriteItem callThe service echoes your entire serialized request where <your request> sits — around 12,000 characters for a 26-item batch.
BatchWriteItem batches individual PutRequest/DeleteRequest actions across one or more tables — but a single call is hard-capped at 25 actions and 16 MB of data. Cross either limit and DynamoDB rejects the entire request before writing anything. It's an HTTP 400 ValidationException, client-side, and not retryable until you resize the batch.
Why it happens
- Writing a large collection in one call — passing an array of hundreds of items straight into
BatchWriteItemwithout chunking. - A chunk loop with the wrong bound — batching by count but using a limit above 25, or an off-by-one that lets 26 through.
- Counting tables, not actions — the 25 limit is total actions across all tables in the request, not per table.
- Oversized payload — even at ≤25 actions the whole batch is rejected if any single item exceeds 400 KB or the total request exceeds 16 MB.
How to fix it
- Chunk into groups of ≤25 actions and send one
BatchWriteItemper chunk. - Handle
UnprocessedItems—BatchWriteItemcan return items it didn't process (throttling); retry those with exponential backoff. This is normal even within a valid 25-item batch. - Keep each batch under 16 MB — with large items you may need fewer than 25 per call.
- Use a helper that buffers for you — boto3's
Table.batch_writer()chunks writes and resends unprocessed items automatically (the Java SDK's Enhanced Client / v1 DynamoDBMapper retry unprocessed items too). The low-level clients and the JavaScript document client do not split an oversized batch. - Size each chunk by bytes as well as count. Twenty-five large items can exceed 16 MB even when the action count is valid.
Measure in DynoTable
Before bulk-loading data, spot-check item sizes in DynoTable — open a sample item with ⌘K and confirm each fits under 400 KB. The item size calculator estimates batch payload size so you pick a safe chunk size before your loader runs.
Use staging (⌘S) to test a small batch write against a dev table before you run the full import. Switch profiles with ⌘P; configure them under Settings → Profiles with Test Connection. See Connect to AWS and Install.
Sources
- BatchWriteItem — Amazon DynamoDB API Reference (verified 2026-07-13)
- Amazon DynamoDB — AWS SDK for Python (Boto3) guide (verified 2026-07-13)
Related errors
- Too many items requested for the BatchGetItem call — the read-side limit (100 items).
- Provided list of item keys contains duplicates — the same key twice in one BatchWriteItem.
- ProvisionedThroughputExceededException — throttling that surfaces as UnprocessedItems.
- Code example: BatchWriteItem in Node.js · in Python (boto3) — chunked writes with UnprocessedItems retry.
- Learn: DynamoDB batch operations
References
- BatchWriteItem — Amazon DynamoDB API Reference
- BatchGetItem — Amazon DynamoDB API Reference
- Error handling with DynamoDB — Amazon DynamoDB Developer Guide
- Amazon DynamoDB — AWS SDK for Python (Boto3) guide
Last verified 2026-07-13 against the official AWS documentation linked above.