How to Respond to a Slack Action in a Thread: Slack Interactive Messages API

Vadym Ovcharenko
2 min readOct 27, 2021

I’ve been trying to wrap my head around sending a reaction message not as a separate channel message, but as a threaded reply to the original message.

Slack seems to have a quite disorganized documentation repository with at least 4 different places where API for responding to Slack interactions.

  1. Interactivity Api Doc
  2. Bolt Javascript Doc
  3. Legacy Interactive Messages Doc
  4. Slack Node SDK Documentation (Looks like an early Bolt)

Funnily, all of the above describe the same API, yet none of them have full documentation for the response_url HTTP endpoint that is being sent as a webhook for reacting to a Slack Action.

Answer from the Support

Reply from Slack Support team

Thanks to the support it was revealed, that there is, indeed, a way to send the response message as a threaded reply:

If you want to respond in the thread, you need to set the response_type to in_channel and the thread_ts value to be the ts value sent with the interaction payload.

The code for such integration should look similar to the below:

const slackReply = await request({
url: payload.response_url,
method: "POST",
json: {
thread_ts: payload.container.message_ts,
text: "Hello World!",
response_type: "in_channel",
replace_original: false

}
})

Make sure to also add replace_original: false to the updated request, as otherwise, you will get the original message replaced.

After some additional investigation, I also found the documentation for this field in some archives. It looks like Slack docs have overlooked this important parameter.

Follow my Twitter account for more dev, entrepreneurial and #BuildInPublic advice.

--

--

Vadym Ovcharenko

Create a transparent #GigEconomy. Writing on borderless business and freelance — vadymhimself.com