Discord error 0: General error
Last verified against Discord Developer Docs - Opcodes and status codes
General error (such as a malformed request body, amongst other things)What error 0 means
Code 0 is Discord's catch-all. The request reached the API, Discord rejected it, and none of the more specific codes applied. In practice you see it most when the HTTP request itself is malformed rather than when a field value is wrong: an empty body on an endpoint that requires one, a body that is not valid JSON at all, a missing Content-Type header, or a route that exists but was called with a method it does not accept.
It is not a permissions problem and not a rate limit; those have their own codes. It also is not a server-side fault on Discord's end, which would come back as a 5xx with no JSON code. Treat 0 as "your request was shaped wrong before Discord could even evaluate it".
What it looks like
{
"message": "400: Bad Request",
"code": 0
}Why it happens
- Request body is empty, truncated, or not JSON (for example a stringified object double-encoded)
- Missing or wrong Content-Type header (text/plain instead of application/json)
- Multipart upload where the payload_json part is absent or not named payload_json
- Hand-built HTTP call with a typo in the path, such as /channel/ instead of /channels/
- Proxy or gateway in front of your bot rewriting or dropping the body
How to fix Discord error 0
- 1Log the exact URL, method, headers and raw body you sent, not the object your code thinks it sent
- 2Confirm Content-Type: application/json for JSON bodies, or multipart/form-data with a payload_json part for uploads
- 3Reproduce the request with curl against the same endpoint; if curl works, the bug is in your HTTP layer
- 4Compare the path against the endpoint in the docs character by character, including the API version prefix (/api/v10)
- 5If a reverse proxy sits in front of outbound traffic, bypass it once to rule it out
How to stop it recurring
Use a maintained library (discord.js, discord.py, JDA, Serenity) for REST calls instead of hand-rolled fetch code; they set headers and encode bodies correctly. If you must call the API directly, centralize request building in one function and add a test that serializes a sample payload and asserts it parses as JSON.
If the request that fails is a webhook execution rather than a bot call, the same malformed-body causes apply; the webhook debugging guide has a transport-level checklist. Field-level rejections with a parseable body return 50035 instead, which is the better error to get.
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
Error 0 - quick answers
What does Discord error 0 mean?
Code 0 is Discord's catch-all. The request reached the API, Discord rejected it, and none of the more specific codes applied.
How do I fix Discord error 0?
1. Log the exact URL, method, headers and raw body you sent, not the object your code thinks it sent 2. Confirm Content-Type: application/json for JSON bodies, or multipart/form-data with a payload_json part for uploads 3. Reproduce the request with curl against the same endpoint; if curl works, the bug is in your HTTP layer 4. Compare the path against the endpoint in the docs character by character, including the API version prefix (/api/v10) 5. If a reverse proxy sits in…
Should I retry after error 0?
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.