Skip to content

invalid_json

The body isn’t strict JSON: a syntax error, a duplicate member name, invalid UTF-8, or data after the value.

HTTP 400 · invalid_request_error · not retryable

The body isn’t strict JSON: a syntax error, a duplicate member name, invalid UTF-8, or data after the value. The message gives the line and column (in bytes) of the first problem. An empty body gets “The body is empty. Send a JSON object, and retry.”

Fix the JSON at the position given, then retry. Send each member once.

HTTP 400 · invalid_json
{
"error": {
"type": "invalid_request_error",
"code": "invalid_json",
"message": "The body isn't valid JSON (line 1, column 6). Fix it and retry.",
"param": null,
"request_id": "req_01j9zr3m5k8q2w7x4t6v0b1c9d",
"doc_url": "https://docs.deedglass.com/errors/invalid_json"
}
}

The message is for a person and can get more exact over time: branch on type and code, never on the message.

SDK Raised as
TypeScript (@deedglass/sdk) InvalidRequestError with code === "invalid_json"
Python (deedglass) deedglass.InvalidRequestError with .code == "invalid_json"