# Slack

> Connect Slack to sanda: what to prepare, the fields the connection form asks for, and how its data lands in your warehouse.

## Connect Slack

:::steps
1. **Open the catalogue.** In the console, go to **Data · Connections** and press **New connection**.
2. **Choose Slack.** It is listed under product and operations; you can also search for it by name.
3. **Fill in the form.** Enter the fields below. Credentials go straight to sanda’s sync engine and are never stored in sanda’s database.
4. **Choose what to sync.** Pick the tables you want, and a sync mode for each. See [choose what to sync](https://docs.sanda-os.com.au/connections/choose-tables).
5. **Run the first sync.** sanda tests the connection, then lands each table you chose in your warehouse.
:::

## Configuration fields

What the connection form asks for. Required fields are marked; the rest are optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Number of concurrent threads** | integer | No | The number of worker threads to use for the sync. Default `2`. |
| **Channel messages date window size (in days)** | integer | No | The size (in days) of the date window that will be used while syncing data from the channel messages stream. A smaller window will allow for greater parallelization when syncing records, but can lead to rate limiting errors. Default `100`. |
| **Channel name filter** | array | No | A channel name list (without leading '#' char) which limit the channels from which you'd like to sync. Empty list means no filter. |
| **Authentication mechanism** | one of 2 options | No | Choose how to authenticate into Slack. |
| **Include archived channels** | boolean | No | Whether to include archived channels in the sync. When disabled (default), archived channels are excluded from the Slack API response, reducing the number of API calls for downstream streams such as channel_messages, threads, and channel_members. Enable this option if you need to sync data from archived channels. Default `false`. |
| **Include private channels** | boolean | No | Whether to read information from private channels that the bot is already in. If false, only public channels will be read. If true, the bot must be manually added to private channels. Default `false`. |
| **Join all channels** | boolean | Yes | Whether to join all channels or to sync data only from channels the bot is already in. If false, you''ll need to manually add the bot to all the channels from which you''d like to sync messages. Default `true`. |
| **Threads Lookback window (Days)** | integer | Yes | How far into the past to look for messages in threads, default is 0 days. Default `0`. |
| **Start Date** | string | Yes | UTC date and time in the format 2017-01-25T00:00:00Z. Any data before this date will not be replicated. |
| **Ignore messages with no replies in threads stream** | boolean | No | When enabled, the threads stream will skip messages that have no replies (reply_count is 0, null, or absent), reducing the number of API calls. Disabled by default to make Threads stream contain unthreaded messages in its records. Default `false`. |

### Authentication mechanism

Choose how to authenticate into Slack.

Choose one of the following. Each asks for its own fields.

**Sign in via Slack (OAuth)**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Access token** | string, secret | Yes | Slack access_token. |
| **Client ID** | string | Yes | Slack client_id. |
| **Client Secret** | string, secret | Yes | Slack client_secret. |

**Bot Token**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Bot Token** | string, secret | Yes | A Slack bot token (xoxb-). |


## Related

:::links
- [Sync modes](https://docs.sanda-os.com.au/connections/sync-modes): How sanda reads each table on every run.
- [Sync schedules](https://docs.sanda-os.com.au/connections/schedules): How often a connection runs.
- [Allowlist sanda’s address](https://docs.sanda-os.com.au/connections/allowlist): For a system behind a firewall.
- [Troubleshoot connections](https://docs.sanda-os.com.au/connections/troubleshooting): What an error means and how to fix it.
:::
