Slack API · error code

Slack error expired_trigger_id: trigger_id has expired

ConfigurationHTTP 200Modals, Home tab & views

Last verified against Slack API reference - chat.postMessage errors

What Slack returns
The trigger_id is expired.

What error expired_trigger_id means

The trigger was real, but you used it too late. views.open says simply "The trigger_id is expired." The modals guide is precise about the window: "A trigger_id will expire 3 seconds after it's sent to your app, so you'll want to use it quickly."

Three seconds is easy to blow through. A slash command handler that first queries a database, calls an LLM or an external API, then builds the modal will often miss it. Cold starts on serverless functions add more delay, and so does a queue between your HTTP endpoint and the worker that opens the modal. Your view JSON and token are fine; the order of operations is the problem.

The standard pattern is to open the modal first, immediately, with a light "Loading..." view, then do the slow work and replace the content with views.update, which needs the view_id rather than a trigger. The separate 3-second acknowledgment rule for interactions is covered in the webhook debugging guide.

What it looks like

POST /api/views.open
{"trigger_id": "132456.7890123.abcdef", "view": {...}}

{"ok": false, "error": "expired_trigger_id"}

Why it happens

  • Slow work (database, LLM, third-party API) ran before views.open was called.
  • Serverless cold starts delayed the handler past the window.
  • The interaction was queued and processed by a worker later.
  • Retry logic re-sent views.open after the first attempt failed.

How to fix Slack error expired_trigger_id

  1. 1Call views.open as the first action in the handler, before any slow I/O.
  2. 2Open a minimal loading view, then fill it with views.update using the returned view.id.
  3. 3Do not queue modal opening; open from the process that received the request.
  4. 4Measure time from request arrival to the views.open call and alert when it nears 3 seconds.
  5. 5Reduce cold starts (provisioned concurrency or a warm instance) for interaction endpoints.

How to stop it recurring

Adopt open-then-update as the default for every modal: the first API call uses the trigger, and everything slow happens after it through views.update. Keep interaction endpoints on warm infrastructure. Record the elapsed time before each views.open call so slow paths are found before users report them.

Official reference: Slack API reference - chat.postMessage errors. See all Slack error codes or the Slack limits and quotas.

Related codes

Error expired_trigger_id - quick answers

What does Slack error expired_trigger_id mean?

The trigger was real, but you used it too late. views.open says simply "The trigger_id is expired." The modals guide is precise about the window: "A trigger_id will expire 3 seconds after it's sent to your app, so you'll want to use it quickly." Three seconds is easy to blow through. A slash command handler that first queries a database, calls an LLM or an external API, then builds the modal will often miss it.

How do I fix Slack error expired_trigger_id?

1. Call views.open as the first action in the handler, before any slow I/O. 2. Open a minimal loading view, then fill it with views.update using the returned view.id. 3. Do not queue modal opening; open from the process that received the request. 4. Measure time from request arrival to the views.open call and alert when it nears 3 seconds. 5. Reduce cold starts (provisioned concurrency or a warm instance) for interaction endpoints.

Stop debugging Slack by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.