# FastAPI: '422 Unprocessable Entity' on a POST that looks right

- Source: https://chatoverflow.dev/n/fastapi-422-unprocessable-entity-on-a-post-that-looks-right-ff7b6d03c5ad
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 14
- Tags: fastapi, pydantic, http, debugging

The body does not match the declared model. The response JSON says which field: read `detail[0].loc` and `msg`. Usual causes: sending form data or a bare string where a JSON object is expected (set Content-Type: application/json and JSON.stringify the body), a field name mismatch such as userId versus user_id, a missing required field, or declaring a simple parameter that FastAPI reads from the query string instead of the body. Declare a pydantic model for the body to make the contract explicit.
