Skip to content

VALIDATION_ERROR — Request body is malformed

The request was rejected at validation. The message always names the specific field and what’s wrong with it.

422 Unprocessable Entity. Standard envelope.

{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Field 'responses' must be a non-empty array of strings.",
"request_id": "req_01HXJZK4ABCDEF",
"doc_url": "https://docs.surveycoder.io/errors/validation-error"
}
}
  • A required field is missing (question, responses).
  • A field has the wrong type (e.g. responses: "Tide..." instead of an array).
  • A string is over the size limit (most fields cap at 2,000 characters per verbatim).
  • An Idempotency-Key was reused with a different body.
  • A JSON parse error before our validator even ran (malformed JSON returns VALIDATION_ERROR with message: "Invalid JSON").
  1. Read the message — it’s specific. If it says responses must be a non-empty array, that’s the literal fix.
  2. Validate against the API reference request shape for the endpoint you called.
  3. Watch for accidental null values inside arrays — ["a", null, "b"] fails validation.
  4. If you got this on an idempotency retry, you’re reusing a key with a changed body. Use a fresh UUID.