Sign in to run requests with your own sandbox key. Sign in
400 Bad Request

malformed_body — Malformed request body

Message “The request body could not be parsed. Send valid JSON matching the Content-Type header.”

What causes it

  • The request declared `Content-Type: application/json` but the body was not valid JSON (truncated, trailing comma, single quotes, unquoted keys).
  • The body was double-encoded — a JSON string containing JSON — or wrapped in a form field.

How to fix it

  1. Validate the body with a JSON linter before sending; most HTTP clients serialise a native object for you (`json=` in requests, `body: JSON.stringify(...)` in fetch).
  2. Match `Content-Type` to the encoding actually used. Form-encoded bodies must not claim `application/json`.

Operations that return it

Example response

HTTP/1.1 400 Bad Request · Content-Type: application/json

400 Bad Request
{
  "error": {
    "code": "malformed_body",
    "message": "The request body could not be parsed. Send valid JSON matching the Content-Type header.",
    "details": [],
    "request_id": "6f1c2a3e-8d4b-4c5e-9f0a-1b2c3d4e5f60",
    "doc_url": "https://cascades.crscreditapi.com/docs/api/errors/malformed_body"
  }
}