Discord error 50109: Request body contains invalid JSON
Last verified against Discord Developer Docs - Opcodes and status codes
The request body contains invalid JSON.What error 50109 means
Discord tried to parse your request body as JSON and failed. This happens before any field validation, so you will not get the helpful errors object that 50035 provides. The body is syntactically broken: trailing commas, single quotes, unescaped control characters or newlines inside strings, a JavaScript object literal that was string-concatenated instead of serialized, or a double-encoded string (a JSON string containing JSON).
It also appears when the body is fine but the Content-Type is application/json and the body is actually form-encoded, or when a multipart request's payload_json part contains malformed JSON. Bots using raw HTTP clients and templating systems to produce request bodies are the main source; library users almost never see this.
What it looks like
{
"message": "The request body contains invalid JSON.",
"code": 50109
}Why it happens
- Body built by string concatenation or a template rather than JSON.stringify / json.dumps
- Unescaped quotes, newlines or control characters inside content strings
- Double-encoded JSON (sending "{\"content\": ...}" as a string)
- Trailing comma or comment in a hand-written payload
- payload_json multipart part that is not valid JSON
How to fix Discord error 50109
- 1Serialize with your language's JSON encoder and never hand-assemble bodies
- 2Log the raw body and run it through a JSON validator
- 3If sending multipart, confirm payload_json is a JSON string and files are separate parts
- 4Ensure you are not stringifying an already-stringified body (common in fetch wrappers)
How to stop it recurring
Construct payloads as native objects and serialize at the last moment in one shared HTTP helper. Add a test that round-trips a sample payload through JSON.parse. Treat any string-typed "body" variable in request code as a smell.
When integrating third-party templating or webhook-forwarding systems, validate their output as JSON before relaying it to Discord so their bugs do not surface as yours.
Invalid JSON almost always means a human built a string; serializers do not make syntax errors. If the payload comes from a webhook-forwarding or templating system rather than your own code, validate its output before relaying, as covered in the webhook debugging guide.
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
Error 50109 - quick answers
What does Discord error 50109 mean?
Discord tried to parse your request body as JSON and failed. This happens before any field validation, so you will not get the helpful errors object that 50035 provides.
How do I fix Discord error 50109?
1. Serialize with your language's JSON encoder and never hand-assemble bodies 2. Log the raw body and run it through a JSON validator 3. If sending multipart, confirm payload_json is a JSON string and files are separate parts 4. Ensure you are not stringifying an already-stringified body (common in fetch wrappers)
Should I retry after error 50109?
No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.
Stop debugging Discord by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.