Skip to content

Jev API 422: Field Required (Unprocessable Entity)

Last checked · Independent guide, not affiliated with TypeSafe AI

ANSWER

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.

A Choice question sent without criteria returned this on September 19, 2026:

HTTP 422
{
"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:

  • loc is the path through your request body. Here: bodyquestions → your question ID q → the choice question type → the missing criteria.
  • msg says what is wrong; so far we have only seen “Field required”.
  • input echoes the part of your request that failed, which helps when you build requests in code.
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.

  1. Read loc from left to right and find that field in your request.
  2. 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.

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: 0 in 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.

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.

Sources

  1. API reference: 422 Unprocessable Entity (TypeSafe docs)
  2. Primitives: define a question (TypeSafe docs)
  3. Python SDK exceptions (TypeSafe docs)