Ingest your event data from Slack into RudderStack.
4 minute read
Slack is a popular business communication platform that lets you organize all your business-related chats by specific topics, groups, or direct messaging.
This guide will help you set up Slack as a source in RudderStack.
Get started
Go to your RudderStack dashboard and click Add Source. From the list of Event Streams sources, select Slack.
Assign a name to your source and click Continue.
Your Slack source is now configured. Go to the Settings tab of the source and note the Webhook URL:
In your Slack app, click your workspace and select Tools and Settings > Manage Apps to open the Slack app directory.
You must have an admin role in your Slack workspace to see these options.
Click Build from the top right navigation bar.
Select an existing app or create a new one by clicking Create New App.
Click Event Subscriptions from the left navigation bar.
Turn on the Enable events setting and enter the webhook URL in the Request URL field obtained in Step 3.
The url_verification event verifies the webhook URL. It has a different object structure than the rest of the events and is triggered only once during the first time webhook setup.
RudderStack maps the following Slack properties from the event payload to the RudderStack fields:
Slack Property
RudderStack Property
event.type
event
event.ts
originalTimestamp
event.user event.user.id
context.externalId
event.profile.first_name
context.traits.firstName
event.profile.last_name
context.traits.lastName
event.user.profile.real_name
context.traits.name
event.user.profile.email
context.traits.email
event.user.tz
timezone
event.user.profile.image_original
context.traits.avatar
event.user.profile.title
context.traits.title
How RudderStack creates the event payload
This section details how RudderStack receives the data from Slack source and creates the resulting payload.
Identify event
A sample input payload received from Slack webhook (team_join event):
A sample input payload received from Slack webhook (message event):
{"event":{"user":"U04G7H550","type":"message","ts":"1709441309.308399","client_msg_id":"834r664e-ec75-445d-t5c6-b873a07y9c81","text":"What is the pricing of product X","team":"T0GFJL5J7","thread_ts":"1709407304.839329","parent_user_id":"U06P6LQTPV","blocks":[{"type":"rich_text","block_id":"xGKJl","elements":[{"type":"rich_text_section","elements":{"type":"text","text":"What is the pricing of product X",},{"type":"channel","channel_id":"C03CDQTPI65",},{"type":"text","text":"to do this",},],},],},],"channel":"C03CDQTPI65","event_ts":"1709441309.308399","channel_type":"channel",},{"type":"event_callback","event_id":"EvY5JTJ0NG5","event_time":"1709441309","token":"REm2987dqtpi72Lq","team_id":"T0GFJL5J7","context_team_id":"T01gqtPIL5J7","context_enterprise_id":"null","api_app_id":"A04QTPIHRR","authorizations":[{"enterprise_id":"null","team_id":"T0GFJL5J7","user_id":"W012CDE","is_bot":true,"is_enterprise_install":false,},],"is_ext_shared_channel":false,"event_context":"4-wd6joiQfdgTRQTpIzdfifQ"},
The corresponding RudderStack-transformed (track) event payload is shown below:
{"context":{"library":{"name":"unknown","version":"unknown",},"integration":{"name":"SLACK",},"externalId":[{"type":"slackUserId","id":"U04G7H550",},],},"integrations":{"SLACK":false,},"type":"track","event":"Message","anonymousId":"7509c04f547b05afb6838aa742f4910263d6","originalTimestamp":"2024-03-03T04:48:29.308Z","sentAt":"2024-03-03T04:48:29.000Z","properties":{"user":"U04G7H550","type":"message","ts":"1709441309.308399","client_msg_id":"834r664e-ec75-445d-t5c6-b873a07y9c81","text":"What is the pricing of product X","team":"T0GFJL5J7","thread_ts":"1709407304.839329","parent_user_id":"U06P6LQTPV","blocks":[{"type":"rich_text","block_id":"xGKJl","elements":[{"type":"rich_text_section","elements":[{"type":"text","text":"What is the pricing of product X",},{"type":"channel","channel_id":"C03CDQTPI65",},{"type":"text","text":"to do this",},],},],},],"channel":"C03CDQTPI65","event_ts":"1709441309.308399","channel_type":"channel",},}
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.