Go to Slack

Sequencing interactions with triggers

The wonderful thing about triggers is that trigger_ids are wonderful things.
They're attached to events and interactions.
They expire in three seconds.
They're fun fun fun fun fun!
But the most wonderful thing about triggers is
they can be used only once.

When certain events and interactions occur between users and your app, you'll receive a trigger_id as part of the payload.

You can't open a dialog with dialog.open or request a permissions upgrade with apps.permissions.request without a valid trigger_id.

Things to know about triggers

Triggers expire in three seconds. Use it before you lose it. You'll receive a trigger_expired error when using a method with an expired trigger_id.

Triggers may only be used once. You may perform just one operation with a trigger_id. Subsequent attempts are presented with a trigger_exchanged error.

Where to find triggers

You'll find trigger_id values in:

You'll even find an occasional trigger in Events API events associated with the Permissions API, but these aren't triggers you can use, they reference triggers you already used in a previous apps.permissions.users.request sequence.

Where to use triggers

You can use trigger_id parameters with:

Sequencing interactions

The most wonderful thing about triggers actually is what they'll help people accomplish with your app.

Keep users moving toward their goals by sequencing your permission requests in tandem with dialogs, buttons, and other interactions.

Imaginary sequences:

  • A user submits a slash command with a brief message and you use the trigger_id to open a dialog to collect more information.
  • A user tries to interact with a button on your app but you don't have permission to complete the requested action. You use the trigger_id to ask for the user's permission for reminders:write:user.