Slack Error: 'invalid_name' — Cause, Fix, and Troubleshooting Guide
Fix the Slack invalid_name error: the name value (emoji or channel name) is malformed. Strip colons, verify custom emoji exist, and follow naming rules.
- #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
invalid_name means a name value you passed was rejected as malformed. It shows up most often on reactions.add (an invalid or non-existent emoji name) and on channel-creation/rename calls (a name that breaks Slack’s naming rules).
{
"ok": false,
"error": "invalid_name"
}
Symptoms
reactions.addfails for one emoji but succeeds for standard ones.- The emoji name was passed wrapped in colons, or with a skin-tone suffix, or is a custom emoji that doesn’t exist.
- Channel create/rename fails on names with capitals, spaces, or punctuation.
Common Root Causes
1. Emoji name wrapped in colons
reactions.add expects white_check_mark, not :white_check_mark:. The colons make it invalid.
2. Non-existent custom emoji
Reacting with a custom emoji name that isn’t installed in the workspace is invalid.
3. Skin-tone / alias mismatch
Aliases and skin-tone-modified names that Slack doesn’t recognise as-is are rejected.
4. Channel name violates rules
Channel names must be lowercase, no spaces/periods, and within length limits; violations return invalid_name (or name_taken if it merely collides).
How to diagnose
Reproduce the emoji case:
curl -s -X POST https://slack.com/api/reactions.add \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"channel":"C0123456789","timestamp":"1700000000.000100","name":":white_check_mark:"}'
{"ok": false, "error": "invalid_name"}
Verify a custom emoji exists before using it:
curl -s "https://slack.com/api/emoji.list" \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" | grep -o '"deploy_success"'
Fixes
- Strip the colons: pass
white_check_mark, not:white_check_mark:. - Validate custom emoji against
emoji.listbefore reacting; fall back to a standard emoji if missing. - Follow channel naming rules: lowercase, no spaces or periods, hyphens/underscores allowed, within the length limit.
- Normalise names in code (lowercase, trim, remove colons) before calling the API.
What to watch out for
invalid_name(malformed/unknown name) differs fromname_taken(a valid name that already exists) — the fixes are different.- Emoji aliases can vary between workspaces for custom emoji; don’t assume a custom name exists everywhere.
- Building channel names from user input? Sanitise aggressively, or you’ll bounce between
invalid_nameandname_taken.
Related
- Slack Error: ‘name_taken’
- Slack Error: ‘message_not_found’
- Reaction-driven Slack automations for ops
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.