# DynamoDB ValidationException: One or more parameter values were invalid: Missing the key pk in the item / The provided key element does not match the schema

**Code:** `ValidationException: Missing the key` · **Category:** AWS · **Seen on:** AWS

The item or key doesn’t match the table’s primary key schema — wrong attribute name, wrong type, or missing sort key.

## Meaning

Every item needs the partition key (and sort key if defined) with the exact name and type (S, N, B). Using “id” when the table key is “pk”, sending a number as a string, or omitting the sort key in GetItem triggers it.

## Common causes

- Attribute name differs from the key schema
- Wrong type (string vs number)
- Sort key missing in GetItem/UpdateItem/DeleteItem
- Empty string for a key attribute

## Quick fix

1. describe-table to see KeySchema and AttributeDefinitions
2. Send both keys with matching names/types
3. Use Query for partial-key lookups

## Detailed fix by platform

### AWS CLI

1. `aws dynamodb describe-table --table-name orders --query 'Table.[KeySchema,AttributeDefinitions]'`

## How to diagnose

1. **Schema** — KeySchema names/types
2. **Request** — Key object sent

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/aws/dynamodb-missing-the-key)
