Slack Error: 'no_text' — Cause, Fix, and Troubleshooting Guide
Fix the Slack no_text error: chat.postMessage needs a top-level text fallback even when you send blocks. Always include a summary text string.
- #slack
- #api
- #troubleshooting
- #errors
Stuck on this Slack error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
Overview
no_text means Slack received a chat.postMessage (or chat.update) call with no usable message content — no text, and no blocks/attachments that provide a fallback. Most often it appears when you send only blocks and omit the top-level text.
{
"ok": false,
"error": "no_text"
}
Symptoms
- Block Kit messages fail while plain-text messages from the same bot succeed.
- The payload has a populated
blocksarray but notextkey. - A message built by string concatenation posts fine sometimes and fails when the string ends up empty.
Common Root Causes
1. Blocks without a text fallback
blocks render in-app, but Slack requires a top-level text string as the notification/accessibility fallback. Omitting it can yield no_text.
2. Empty or whitespace-only text
Conditionally built strings that resolve to "" (a filtered-out template variable, a null coalesced to empty) leave the message with nothing to send.
3. All content stripped by validation
Sanitising user input can remove every character, leaving an empty text and no blocks.
How to diagnose
Reproduce the blocks-only case:
curl -s -X POST https://slack.com/api/chat.postMessage \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"channel":"C0123456789","blocks":[{"type":"section","text":{"type":"mrkdwn","text":"Deploy finished"}}]}'
{"ok": false, "error": "no_text"}
Add a text fallback and it succeeds:
curl -s -X POST https://slack.com/api/chat.postMessage \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"channel":"C0123456789","text":"Deploy finished","blocks":[{"type":"section","text":{"type":"mrkdwn","text":"Deploy finished"}}]}'
Fixes
- Always send a top-level
textsummary alongsideblocks. It becomes the push/notification preview and screen-reader text. - Guard against empty strings: default to a non-empty fallback (
text = summary or "(no summary)") before the API call. - Validate before sending: reject a message where both
textis empty andblocksis empty rather than letting Slack reject it.
What to watch out for
- The
textfallback should describe the message, not just repeat a header — it is what users see in notifications and on unsupported surfaces. - Attachments can also satisfy content requirements, but attachments are legacy; prefer
text+blocks. - This is an accessibility win, not just error avoidance: screen readers rely on the
textfield.
Related
Fixed it? Get 500 Slack & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Did this fix your issue?
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.