Slack

Send messages, manage channels, and react to messages in Slack.

CommunicationOAuth26 actionsAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (26)
  4. send_channel_message
  5. send_direct_message
  6. slack-add-reaction-to-message
  7. slack-create-channel
  8. custom_api_call
  9. delete-message
  10. find-user-by-id
  11. get-file
  12. get-message
  13. getChannelHistory
  14. invite-user-to-channel
  15. listUsers
  16. markdownToSlackFormat
  17. request_action_direct_message
  18. request_action_message
  19. request_approval_direct_message
  20. request_approval_message
  21. retrieveThreadMessages
  22. searchMessages
  23. set-channel-topic
  24. slack-find-user-by-email
  25. slack-find-user-by-handle
  26. slack-set-user-status
  27. slack-update-profile
  28. updateMessage
  29. uploadFile
  30. Details

Connect

Auth type: OAuth (oauth2). The connection holds the provider's OAuth tokens. They are sealed on the server and only opened when an action runs.

Scopes requested: chat:writechannels:readchannels:manageusers:readreactions:write

  • From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
  • Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
  • Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.

Call it from a workflow

step.ctx.integrations.invoke("slack", action, input) resolves with the provider's answer and rejects when Slack isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. send_channel_message runs in the platform itself; the other actions run through the integration runner, which the server's operator turns on.

Workflow
// workflows/notify.ts: call Slack when a booking is confirmed
import { on } from "@appbricx/workflows";

export const tellSlack = on.transition("booking", "status", "confirmed", async (_event, step) => {
  // Recorded once: a retry doesn't send it twice. Rejects when Slack isn't connected.
  const output = await step.run("Slack", () =>
    step.ctx.integrations.invoke("slack", "send_channel_message", {
      "channel": "<channel>",
      "sendAsBot": true
    }),
  );
  step.ctx.log("Slack answered", output);
});
Try it from your agent
{
  "name": "integrations",
  "arguments": {
    "project_id": "<project-id>",
    "action": "call",
    "piece": "slack",
    "piece_action": "send_channel_message",
    "input": {
      "channel": "<channel>",
      "sendAsBot": true
    },
    "env": "dev"
  }
}
From another backend (connector proxy)
curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/slack/send_channel_message" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "content-type: application/json" \
  -d '{"props":{"channel":"<channel>","sendAsBot":true}}'

Actions

send_channel_messagebuilt in

Send Message To A Channel. Send message to a channel

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
textoptionallong textThe text of your message. When using Block Kit blocks, this is used as a fallback for notifications.
sendAsBotrequiredbooleanSend as a bot?
threadTsoptionaltextProvide the ts (timestamp) or link value of the **parent** message to make this message a reply. Do not use the ts value of the reply itself; use its parent instead. For example `1710304378.475129`.A…
usernameoptionaltextThe username of the bot
profilePictureoptionaltextThe profile picture of the bot
iconEmojioptionaltextThe icon emoji of the bot
fileoptionalfileAttachment
replyBroadcastoptionalbooleanWhen replying to a thread, also make the message visible to everyone in the channel (only applicable when Thread Timestamp is provided)
mentionOriginFlowoptionalbooleanIf checked, adds a mention at the end of the Slack message to indicate which flow sent the notification, with a link to said flow.
unfurlLinksoptionalbooleanEnable link unfurling for this message
blocksoptionalJSONSee https://api.slack.com/block-kit for specs

send_direct_message

Send Message To A User. Send message to a user

InputTypeDescription
userIdrequiredid (picked from your account)User
textrequiredlong textMessage
usernameoptionaltextThe username of the bot
profilePictureoptionaltextThe profile picture of the bot
iconEmojioptionaltextThe icon emoji of the bot
mentionOriginFlowoptionalbooleanIf checked, adds a mention at the end of the Slack message to indicate which flow sent the notification, with a link to said flow.
blocksoptionalJSONSee https://api.slack.com/block-kit for specs
unfurlLinksoptionalbooleanEnable link unfurling for this message

slack-add-reaction-to-message

Add Reaction to Message. Add an emoji reaction to a message.

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
tsrequiredtextPlease provide the timestamp of the message you wish to react, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message and…
reactionrequiredtexte.g.`thumbsup`
reactAsUserrequiredbooleanIf enabled, the reaction will be added as the authenticated user instead of the bot.

slack-create-channel

Create Channel. Creates a new channel.

Also accepted as create_channel.

InputTypeDescription
channelNamerequiredtextChannel Name
isPrivateoptionalbooleanIs Private?

custom_api_call

Custom API Call. Make a custom API call to a specific endpoint

InputTypeDescription
urlrequiredobject (depends on other props)url
methodrequiredone of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD"Method
headersrequiredobjectAuthorization headers are injected automatically from your connection.
queryParamsrequiredobjectQuery Parameters
body_typeoptionalone of "none" | "json" | "form_data" | "raw"Body Type
bodyoptionalobject (depends on other props)Body
response_is_binaryoptionalbooleanEnable for files like PDFs, images, etc.
failsafeoptionalbooleanNo Error on Failure
timeoutoptionalnumberTimeout (in seconds)
followRedirectsoptionalbooleanFollow redirects
useUserTokenrequiredbooleanUse user token instead of bot token

delete-message

Delete Message. Deletes a specific message from a channel using the message's timestamp.

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
tsrequiredtextPlease provide the timestamp of the message you wish to retrieve, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message …

find-user-by-id

Find User by ID. Finds a user by their ID.

InputTypeDescription
idrequiredtextID

get-file

Get File. Return information about a given file ID.

InputTypeDescription
fileIdrequiredtextYou can pass the file ID from the New Message Trigger payload.

get-message

Get Message by Timestamp. Retrieves a specific message from a channel history using the message's timestamp.

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
tsrequiredtextPlease provide the timestamp of the message you wish to retrieve, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message …

getChannelHistory

Get channel history. Retrieve all messages from a specific channel ("conversation") between specified timestamps

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
oldestoptionalnumberOnly messages after this timestamp will be included in results
latestoptionalnumberOnly messages before this timestamp will be included in results. Default is the current time
inclusiverequiredbooleanInclude messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified
includeAllMetadatarequiredbooleanReturn all metadata associated with each message

invite-user-to-channel

Invite User to Channel. Invites an existing User to an existing channel.

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
userIdrequiredid (picked from your account)User

listUsers

List users. List all users of the workspace

InputTypeDescription
includeBotsrequiredbooleanInclude bots?
includeDisabledrequiredbooleanInclude disabled users?

markdownToSlackFormat

Markdown to Slack format. Convert Markdown-formatted text to Slack's pseudo - markdown syntax

InputTypeDescription
markdownrequiredlong textMarkdown text

request_action_direct_message

Request Action from A User. Send a message to a user and wait until the user selects an action

InputTypeDescription
userIdrequiredid (picked from your account)User
textrequiredlong textMessage
actionsrequiredarrayAction Buttons
usernameoptionaltextThe username of the bot
profilePictureoptionaltextThe profile picture of the bot
mentionOriginFlowoptionalbooleanIf checked, adds a mention at the end of the Slack message to indicate which flow sent the notification, with a link to said flow.

request_action_message

Request Action in A Channel. Send a message in a channel and wait until an action is selected

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
textrequiredlong textMessage
actionsrequiredarrayAction Buttons
threadTsoptionaltextProvide the ts (timestamp) or link value of the **parent** message to make this message a reply. Do not use the ts value of the reply itself; use its parent instead. For example `1710304378.475129`.A…
usernameoptionaltextThe username of the bot
profilePictureoptionaltextThe profile picture of the bot
replyBroadcastoptionalbooleanWhen replying to a thread, also make the message visible to everyone in the channel (only applicable when Thread Timestamp is provided)
mentionOriginFlowoptionalbooleanIf checked, adds a mention at the end of the Slack message to indicate which flow sent the notification, with a link to said flow.

request_approval_direct_message

Request Approval from A User. Send approval message to a user and then wait until the message is approved or disapproved

InputTypeDescription
userIdrequiredid (picked from your account)User
textrequiredlong textMessage
usernameoptionaltextThe username of the bot
profilePictureoptionaltextThe profile picture of the bot
mentionOriginFlowoptionalbooleanIf checked, adds a mention at the end of the Slack message to indicate which flow sent the notification, with a link to said flow.

request_approval_message

Request Approval in a Channel. Send approval message to a channel and then wait until the message is approved or disapproved

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
textrequiredlong textMessage
usernameoptionaltextThe username of the bot
profilePictureoptionaltextThe profile picture of the bot
mentionOriginFlowoptionalbooleanIf checked, adds a mention at the end of the Slack message to indicate which flow sent the notification, with a link to said flow.

retrieveThreadMessages

Retrieve Thread Messages. Retrieves thread messages by channel and thread timestamp.

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
threadTsrequiredtextProvide the ts (timestamp) value of the **parent** message to retrieve replies of this message. Do not use the ts value of the reply itself; use its parent instead. For example `1710304378.475129`.Al…

searchMessages

Search messages. Searches for messages matching a query

InputTypeDescription
queryrequiredtextSearch query

set-channel-topic

Set Channel Topic. Sets the topic on a selected channel.

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
topicrequiredlong textTopic

slack-find-user-by-email

Find User by Email. Finds a user by matching against their email address.

InputTypeDescription
emailrequiredtextEmail

slack-find-user-by-handle

Find User by Handle. Finds a user by matching against their Slack handle.

InputTypeDescription
handlerequiredtextUser handle (display name), without the leading @

slack-set-user-status

Set User Status. Sets a user's custom status

InputTypeDescription
textrequiredtextText
emojioptionaltextEmoji shortname (standard or custom), e.g. :tada: or :train:
expirationoptionalnumberUnix timestamp - if not set, the status will not expire

slack-update-profile

Update Profile. Update basic profile field such as name or title.

InputTypeDescription
firstNameoptionaltextFirst Name
lastNameoptionaltextLast Name
emailoptionaltextChanging a user's email address will send an email to both the old and new addresses, and also post a slackbot message to the user informing them of the change.
userIdoptionaltextID of user to change. This argument may only be specified by admins on paid teams.You can use **Find User by Email** action to retrieve ID.

updateMessage

Update message. Update an existing message

InputTypeDescription
channelrequiredid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'
tsrequiredtextPlease provide the timestamp of the message you wish to update, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message an…
textrequiredlong textThe updated text of your message
mentionOriginFlowoptionalbooleanIf checked, adds a mention at the end of the Slack message to indicate which flow sent the notification, with a link to said flow.
blocksoptionalJSONSee https://api.slack.com/block-kit for specs

uploadFile

Upload file. Upload file without sharing it to a channel or user

InputTypeDescription
filerequiredfileAttachment
titleoptionaltextTitle
filenameoptionaltextFilename
channeloptionalid (picked from your account)You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'

Details

Id
slack
Category
Communication
Tags
messaging, chat, team, notifications
Package
@activepieces/piece-slack@0.16.4
Runs
send_channel_message in the platform; the rest through the integration runner