Setu Recipes: reusable workflows across every app.Browse templates
Setuसेतु

Integrations / Slack

Slack

Team messaging: channels, messages and reactions.

6 actions OAuth 2 3 read3 write Calls slack.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "slack" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

ScopeWhy it is requested
chat:writePost messages as the app
channels:readList public channels
channels:historyRead message history in public channels
users:readList workspace members
reactions:writeAdd emoji reactions

Actions

Add reactionwriteslack.add_reactionAdd an emoji reaction to a message.

Needs scope: reactions:write

InputTypeDescription
channelstringRequired
timestampstringRequiredMessage timestamp
namestringRequiredEmoji name without colons
TypeScript
await setu.execute({
  userId: "user_1",
  action: "slack.add_reaction",
  input: {
    "channel": "<channel>",
    "timestamp": "<timestamp>",
    "name": "<name>"
  },
});
Get channel historyreadslack.get_channel_historyRead recent messages from a public channel.

Needs scope: channels:history

InputTypeDescription
channelstringRequiredChannel ID
limitintegerOptional
TypeScript
await setu.execute({
  userId: "user_1",
  action: "slack.get_channel_history",
  input: {
    "channel": "<channel>"
  },
});
List channelsreadslack.list_channelsList public channels in the workspace.

Needs scope: channels:read

InputTypeDescription
limitintegerOptional
cursorstringOptional
TypeScript
await setu.execute({
  userId: "user_1",
  action: "slack.list_channels",
  input: {},
});
List usersreadslack.list_usersList members of the workspace.

Needs scope: users:read

InputTypeDescription
limitintegerOptional
TypeScript
await setu.execute({
  userId: "user_1",
  action: "slack.list_users",
  input: {},
});
Post messagewriteslack.post_messagePost a message to a Slack channel.

Needs scope: chat:write

InputTypeDescription
channelstringRequiredChannel ID or name
textstringRequired
TypeScript
await setu.execute({
  userId: "user_1",
  action: "slack.post_message",
  input: {
    "channel": "<channel>",
    "text": "<text>"
  },
});
Reply in threadwriteslack.reply_in_threadReply to an existing message thread in a channel.

Needs scope: chat:write

InputTypeDescription
channelstringRequired
thread_tsstringRequiredTimestamp of the parent message
textstringRequired
TypeScript
await setu.execute({
  userId: "user_1",
  action: "slack.reply_in_thread",
  input: {
    "channel": "<channel>",
    "thread_ts": "<thread_ts>",
    "text": "<text>"
  },
});