Slack Source Beta
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.

- In Subscribe to bot events section, add the events you want to track and click Save Changes.

For more information on steps 4-9, see Subscribing to event types.
Event transformation
RudderStack supports ingesting all the Slack events related to user’s activities. It converts:
- Slack’s
team_joinanduser_changeevents asidentifyevents, and - Rest of the Slack events as
trackevents.
Theurl_verificationevent 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.userevent.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):
{
"event": {
"type": "team_join",
"user": {
"id": "W012CDE"',
"name": "johnd",
"real_name": "John Doe",
},
"type": "event_callback",
"event_id": "<event_id>",
"event_time": "1709441309",
"token": "<token>",
"team_id": "T0GFJL5J7",
"context_team_id": "T0GFJL5J7",
"context_enterprise_id": "null",
"api_app_id": "<api_app_id>",
"authorizations": [{
"enterprise_id": "null",
"team_id": "T0GFJL5J7",
"user_id": "U04G7H550",
"is_bot": true,
"is_enterprise_install": false,
}, ],
"is_ext_shared_channel": false,
"event_context": "eJldCI65436EUEpMSFhgfhg76joiQzAxRTRQTEIxMzUifQ"
}The corresponding RudderStack-transformed (identify) event payload is shown below:
{
"context": {
"library": {
"name": "unknown",
"version": "unknown",
},
"integration": {
"name": "SLACK",
},
"externalId": [{
"type": "slackUserId",
"id": "W012CDE",
}, ],
},
"integrations": {
"SLACK": false,
},
"type": "identify",
"event": "Team Join",
"anonymousId": "2bc5ae2825a712d3d154cbdacb86ac16c278",
"originalTimestamp": "2024-03-03T04:48:29.000Z",
"sentAt": "2024-03-03T04:48:29.000Z",
"properties": {
"type": "team_join",
"user": {
"id": "W012CDE",
"name": "johnd",
"real_name": "John Doe",
},
},
}Track 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": "<event_id>",
"event_time": "1709441309",
"token": "<token>",
"team_id": "T0GFJL5J7",
"context_team_id": "T01gqtPIL5J7",
"context_enterprise_id": "null",
"api_app_id": "<api_app_id>",
"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",
},
}