Integrations / Slack
Slack
Team messaging: channels, messages and reactions.
6 actions
OAuth 2
3 read3 write
Calls slack.com
Connect
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
| Scope | Why it is requested |
|---|---|
chat:write | Post messages as the app |
channels:read | List public channels |
channels:history | Read message history in public channels |
users:read | List workspace members |
reactions:write | Add emoji reactions |
Actions
Add reactionwriteslack.add_reactionAdd an emoji reaction to a message.
Needs scope: reactions:write
| Input | Type | Description | |
|---|---|---|---|
channel | string | Required | |
timestamp | string | Required | Message timestamp |
name | string | Required | Emoji name without colons |
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
| Input | Type | Description | |
|---|---|---|---|
channel | string | Required | Channel ID |
limit | integer | Optional |
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
| Input | Type | Description | |
|---|---|---|---|
limit | integer | Optional | |
cursor | string | Optional |
await setu.execute({
userId: "user_1",
action: "slack.list_channels",
input: {},
});List usersreadslack.list_usersList members of the workspace.
Needs scope: users:read
| Input | Type | Description | |
|---|---|---|---|
limit | integer | Optional |
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
| Input | Type | Description | |
|---|---|---|---|
channel | string | Required | Channel ID or name |
text | string | Required |
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
| Input | Type | Description | |
|---|---|---|---|
channel | string | Required | |
thread_ts | string | Required | Timestamp of the parent message |
text | string | Required |
await setu.execute({
userId: "user_1",
action: "slack.reply_in_thread",
input: {
"channel": "<channel>",
"thread_ts": "<thread_ts>",
"text": "<text>"
},
});