# 400 Bad Request: Missing required field 'email' in request body

- **ID:** `api/rest-api-response-missing-required-field`
- **Domain:** api
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

The API endpoint requires a specific field in the JSON request body, but it was omitted or set to null.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| REST API v2.0 | active | — | — |
| OpenAPI 3.0 | active | — | — |

## Workarounds

1. **Inspect the API documentation to confirm required fields. Add the missing field to the request body. Example: curl -X POST https://api.example.com/users -H 'Content-Type: application/json' -d '{"email": "user@example.com", "name": "John"}'** (95% success)
   ```
   Inspect the API documentation to confirm required fields. Add the missing field to the request body. Example: curl -X POST https://api.example.com/users -H 'Content-Type: application/json' -d '{"email": "user@example.com", "name": "John"}'
   ```
2. **Use a JSON schema validator (e.g., ajv) to validate the request body locally before sending.** (80% success)
   ```
   Use a JSON schema validator (e.g., ajv) to validate the request body locally before sending.
   ```

## Dead Ends

- **** — Changing the HTTP method from POST to PUT does not fix the missing field issue; the server still validates the request body. (20% fail)
- **** — Adding the field with an empty string instead of a valid value may cause a different validation error (e.g., 'email' must be a valid email). (50% fail)
