Error: missing required key 'key' in params dynamodb

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Solution
Missing required key 'Key' in params means the request lacks the capitalized Key parameter required by GetItem, UpdateItem or DeleteItem. Supplying a field named key, or putting the identifier only inside Item, does not satisfy it.
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, GetCommand } from "@aws-sdk/lib-dynamodb";
const db = DynamoDBDocumentClient.from(new DynamoDBClient({}));
const { Item } = await db.send(new GetCommand({
TableName: "Orders",
Key: { pk: "CUSTOMER#123", sk: "ORDER#42" },
}));
console.log(Item);This table has a partition key and a sort key. Use the actual key names from DescribeTable and omit sk only if your table has no sort key. Make sure Key is not undefined after request construction or destructuring. A PutItem operation takes Item instead; Query uses a key condition rather than Key.
The original wording commonly appears in SDK v2 validation. The example uses SDK v3 and native values. Low-level GetItemCommand requires AttributeValue wrappers, while GetCommand does not.
See primary keys and AWS documentation.
Other Common DynamoDB Errors (with Solutions)
- dynamodb list_append returns true but does not work
- DynamoDB Duplicate Key Error
- dynamodb unknown error
- moto dynamodb not working
- a socket operation was attempted to an unreachable network dynamodb
- sls dynamodb install not working
- could not unmarshal the value dynamodb
- ValidationException: Invalid KeyConditionExpression: Attribute name is a reserved keyword;
- dynamodb item size limit error
- dynamodb-admin command not found
- dynamodb cannot read property 's' of undefined
- DynamoDB Contains not working
- AWS Lambda DynamoDB Stream Error
- dynamodb unable to parse base64 string
- DynamoDB Invalid UpdateExpression Syntax Error Token
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today