# Discord webhook 400 "Cannot send an empty message" in CI

> Fix Discord webhook HTTP 400 "Cannot send an empty message" in CI - the payload has no content, embeds, or files, usually because an interpolated variable was empty.

Source: https://latchkey.dev/learn/ci-integrations/discord-cannot-send-an-empty-message-in-ci  
Updated: 2026-06-30

Discord returns HTTP 400 with `{"code":50006,"message":"Cannot send an empty message"}` when a webhook payload contains no `content`, no `embeds`, and no files. In CI this happens when the message is built from a variable that turned out empty.

## Diagnose it: produced, uploaded, or mapped?

Third-party integrations fail at one of three points, and the symptom is the same for all of them: the report was never produced, the upload was rejected, or the service could not map the paths back to your repository.

```Terminal
ls -la <report-dir>/ && head -5 <report-file>
grep -c . <report-file> || echo "empty report"
# absolute paths in a report break server-side file mapping
grep -m3 -E "^(SF:|<file)" <report-file>
```

> Most uploaders exit zero even when the upload is rejected, so a green step is not evidence the service received anything. Check the service side before debugging the generator.

## FAQ

### What causes Discord webhook 400 "Cannot send an empty message" in CI?

There are 2 common causes: an interpolated value was empty and only unsupported fields were sent. A content built from an unset environment variable or a job output that did not populate leaves the payload with nothing to display.

### How do I fix Discord webhook 400 "Cannot send an empty message" in CI?

There are 2 fixes depending on which cause you have: guard against an empty message and send an embed with a title as a fallback. Work through them in order, since the first is the most common.

### What does Discord webhook 400 "Cannot send an empty message" in CI actually mean?

The Discord notify step gets HTTP 400 with message Cannot send an empty message.

### How do I stop Discord webhook 400 "Cannot send an empty message" in CI happening again?

Default the message text before building the payload. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
