medium

422 Unprocessable Entity

The request was well-formed but the server cannot process it due to semantic errors (e.g., validation failures).

Common Causes

  1. 1Required field missing
  2. 2Field value fails validation
  3. 3Business logic constraint violated
  4. 4Data format correct but values invalid

How to Fix

Return detailed validation errors

return NextResponse.json({
  error: 'Validation failed',
  details: [
    { field: 'email', message: 'Invalid email format' },
    { field: 'age', message: 'Must be a positive number' },
  ],
}, { status: 422 });

Return specific field-level errors so clients can fix their requests.

How ObserveOne Helps

ObserveOne monitors validation error rates and identifies common user input issues.

Start Monitoring Free

Related Errors