Slack Error: 'invalid_trigger_id' — Cause, Fix, and Troubleshooting Guide
Fix the Slack invalid_trigger_id error: the trigger_id sent to views.open is malformed or never valid. Use the exact trigger_id from the payload.
- #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_trigger_id is returned by views.open / views.push when the trigger_id you supplied is malformed or was never a real trigger. Unlike expired_trigger_id (a valid trigger that timed out) and exchanged_trigger_id (already used), invalid_trigger_id means the value itself is wrong.
{
"ok": false,
"error": "invalid_trigger_id"
}
Symptoms
- Modals never open; the very first
views.openfails. - The
trigger_idwas hard-coded, hand-edited, or logged/copied incompletely. - Switching to the raw payload value fixes it immediately.
Common Root Causes
1. Corrupted or truncated trigger_id
A trigger_id clipped during logging, string manipulation, or JSON re-encoding is no longer valid.
2. Fabricated or reused-out-of-context value
Constructing a trigger_id by hand, or pulling one from the wrong field, produces an invalid value.
3. Pulled from the wrong part of the payload
trigger_id lives at the top level of the interaction payload; reading a nested or unrelated field yields garbage.
How to diagnose
A real trigger_id looks like NNNNN.NNNNN.hexhash. Reproduce with a bad one:
curl -s -X POST https://slack.com/api/views.open \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"trigger_id":"not-a-real-trigger","view":{"type":"modal","title":{"type":"plain_text","text":"X"},"blocks":[]}}'
{"ok": false, "error": "invalid_trigger_id"}
Log the exact trigger_id you received from Slack and compare character-for-character with what you send.
Fixes
- Use the
trigger_idverbatim from the interaction payload (slash command, block action, shortcut) — don’t transform it. - Don’t hard-code or synthesise a
trigger_id; it’s a short-lived token minted by Slack per interaction. - Preserve it end-to-end: avoid re-encoding steps that might truncate it, and pass it straight to
views.open.
What to watch out for
- Three sibling errors, three causes:
invalid_trigger_id(malformed),expired_trigger_id(older than ~3s),exchanged_trigger_id(already used to open a view). The fixes differ. - You only get a
trigger_idfrom a user interaction — you cannot open a modal proactively without one. - Open the view within about 3 seconds of receiving the interaction; a slow handler turns a valid trigger into an expired one.
Related
- Slack Error: ‘expired_trigger_id’
- Slack Error: ‘invalid_payload’
- Slack modals and interactive components for ops tooling
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.