Slack API · error code

Slack error invalid_trigger_id: trigger_id is malformed

Permanent - do not retryHTTP 200Modals, Home tab & views

Last verified against Slack API reference - chat.postMessage errors

What Slack returns
The trigger_id is invalid. The expected format for the trigger_id argument is "132456.7890123.abcdef".

What error invalid_trigger_id means

The value you passed as trigger_id to views.open (or views.push) is not a trigger at all. The docs spell out the shape they expect: "132456.7890123.abcdef". A modal can only open in response to a user interaction, and the trigger_id from that interaction's payload is the proof.

This is a format problem, separate from its two siblings. expired_trigger_id means a real trigger arrived too late, and exchanged_trigger_id means a real trigger was already used. Here, the string never looked like a trigger. Common reasons: reading the wrong field (such as response_url, view.id or callback_id), passing undefined because the payload was not parsed (interaction payloads arrive as a form field named payload containing JSON), or trying to open a modal from a scheduled job or plain message event that never had a trigger.

Note that the views.open page also shows invalid_arguments with the message "invalid `trigger_id`" for some malformed requests.

What it looks like

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

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

Why it happens

  • The wrong payload field was passed (response_url, view.id, callback_id).
  • The payload form field was not JSON-parsed, so trigger_id was undefined or empty.
  • The code tried to open a modal from a cron job, plain message event or webhook, where no trigger exists.
  • The trigger string was truncated or modified in transit.

How to fix Slack error invalid_trigger_id

  1. 1Log the raw trigger_id you send and check it matches the documented pattern.
  2. 2Parse the interaction request's payload field as JSON and read trigger_id from the top level.
  3. 3Only open modals from slash commands, shortcuts and interactive components, which carry a trigger.
  4. 4Without a trigger, post a message with a button; the click supplies a fresh trigger_id.

How to stop it recurring

Pass the whole parsed interaction payload into your modal handler instead of copying fields by hand, and type the handler so trigger_id must be present. Bolt frameworks expose it as body.trigger_id for exactly this reason. Add a test that sends a sample interaction payload through the handler and asserts the trigger_id reaches views.open unchanged.

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

Related codes

Error invalid_trigger_id - quick answers

What does Slack error invalid_trigger_id mean?

The value you passed as trigger_id to views.open (or views.push ) is not a trigger at all. The docs spell out the shape they expect: "132456.7890123.abcdef". A modal can only open in response to a user interaction, and the trigger_id from that interaction's payload is the proof. This is a format problem, separate from its two siblings.

How do I fix Slack error invalid_trigger_id?

1. Log the raw trigger_id you send and check it matches the documented pattern. 2. Parse the interaction request's payload field as JSON and read trigger_id from the top level. 3. Only open modals from slash commands, shortcuts and interactive components, which carry a trigger. 4. Without a trigger, post a message with a button; the click supplies a fresh trigger_id.

Should I retry after error invalid_trigger_id?

No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.

Stop debugging Slack by hand

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