Jev API 422: Field Required (Unprocessable Entity)
Last checked · Independent guide, not affiliated with TypeSafe AI
A 422 from the Jev API means the request body failed validation because a required field is missing. The error lists each problem with a loc path, such as body, questions, q, choice, criteria, and the message 'Field required'. The fields we saw trigger it were model, questions and a Choice question's criteria.
What the error looks like
Section titled “What the error looks like”A Choice question sent without criteria returned this on September 19, 2026:
{ "detail": [ { "type": "missing", "loc": ["body", "questions", "q", "choice", "criteria"], "msg": "Field required", "input": { "type": "choice", "instructions": "Which language is this?" } } ]}Unlike the vague 400 “Invalid request.”, a 422 tells you exactly where the problem is:
locis the path through your request body. Here:body→questions→ your question IDq→ thechoicequestion type → the missingcriteria.msgsays what is wrong; so far we have only seen “Field required”.inputechoes the part of your request that failed, which helps when you build requests in code.
Missing fields we reproduced
Section titled “Missing fields we reproduced”| What was missing | loc in the error |
|---|---|
model |
["body", "model"] |
questions |
["body", "questions"] |
criteria on a Choice question |
["body", "questions", "<your id>", "choice", "criteria"] |
The model field surprises people who start from the SDKs: the SDKs default to jev-latest, so it is easy to forget that raw HTTP requests must include it.
How to fix it
Section titled “How to fix it”- Read
locfrom left to right and find that field in your request. - Add it. Minimum valid shapes:
{ "model": "jev-1.13.0", "state": "Text to judge", "questions": { "yes_no": { "type": "noul", "instructions": "Is this a complaint?" }, "pick_one": { "type": "choice", "instructions": "Which team should handle it?", "criteria": { "billing": null, "technical": null, "other": null } }, "level": { "type": "score", "instructions": "How urgent is it?", "criteria": ["Not urgent", "Soon", "Today"] } }}Choice option descriptions may be null when the option name speaks for itself. Noul criteria is optional.
What does not trigger a 422
Section titled “What does not trigger a 422”Some things you might expect to be rejected are accepted:
- A Score with one level. TypeSafe’s docs say to include at least two levels, but a one-level Score returned HTTP 200 with
score: 0in our test. The answer is meaningless, so validate this in your own code. - An unknown question type returns 400 “Invalid request.” rather than 422. See 400.
In the SDKs
Section titled “In the SDKs”The Python SDK raises TypeSafeUnprocessableEntityError and the JavaScript SDK UnprocessableEntityError. Using the typed helpers (Noul, Choice, Score in Python; noul, choice, score in JavaScript) makes these mistakes less likely, because each helper takes the fields its question type needs. 422s mostly show up when requests are assembled by hand as plain dictionaries or JSON.
Neither SDK retries a 422; fix the request instead. All error codes: Jev API errors.