# Slack

Post the weekly practice digest to a Slack channel.

| | |
|---|---|
| Status | **Native** |
| Direction | Chambr → Slack (posts only) |
| Set up by | A Chambr manager who can add apps to the Slack channel |
| Time | About 2 minutes |
| Data freshness | Weekly, Mondays at around 14:00 UTC, covering the week that just ended |
| Plan | Team |

## What you need

- A Chambr manager account on a Team plan.
- Either permission to add the Chambr app to a channel (**Add to Slack**), or
  a Slack app of your own with **Incoming Webhooks** turned on (paste a
  webhook).

## What gets sent

| Chambr | Slack | Notes |
|---|---|---|
| Reps who practiced, roleplays | The digest message | Monday to Sunday, UTC |
| Overdue assignments | A count and a **View assignments** button | |
| Leaderboard, top five | First name, last initial, average score, roleplays | Only when turned on for the channel |

Nothing is read from Slack. Chambr can't edit or delete a message once it is
posted.

## Permissions

**Add to Slack** asks for one scope, `incoming-webhook`: post to the one channel
you pick on Slack's consent screen. Chambr keeps that channel's webhook URL,
encrypted, and the channel name. It doesn't keep a Slack token, and it can't
read messages or post anywhere else.

A pasted webhook gives Chambr the same thing: the right to post to that one
channel.

## Set it up

### Option 1: Add to Slack

1. In Chambr, open **Integrations** and find **Slack** under Collaboration.
2. Select **Connect** (or **Add to Slack** in Weekly digest channels).
3. On Slack's screen, pick the channel and select **Allow**.
4. You're back on Integrations, and the channel is listed under **Weekly
   digest channels**, named after the Slack channel.

> [!NOTE]
> Add to Slack is enabled per account. If you don't see it, use Option 2 or
> ask your Chambr contact.

### Option 2: Paste a webhook

1. In Slack, create an app for your workspace, turn on **Incoming Webhooks**,
   and select **Add New Webhook to Workspace**. Pick the channel and copy the
   URL. It starts with `https://hooks.slack.com/services/`.
2. In Chambr, on **Integrations**, select **Add a channel** in Weekly digest
   channels.
3. Name the channel, paste the URL and choose whether it covers a team or the whole organization.

**Connect** on the Slack card takes the same URL, but adds a channel that
covers your team without the leaderboard; change either in the list
afterwards.

Chambr only accepts `https://hooks.slack.com/services/...` URLs, and never shows
the URL again.

### Choose what it shows

In **Weekly digest channels**, choose whether the channel covers a team or the whole organization, and turn on
**Leaderboard** if the channel may see names and scores. It's off by default,
and unavailable while your account's leaderboard is off. A channel added with
Add to Slack starts out covering your team.

## Verify it works

1. In **Weekly digest channels**, select **Send test** on the channel.
2. A "Test message from Chambr" appears in the channel within a few seconds.
3. The first digest arrives the next Monday at around 14:00 UTC.

Send test works once a minute per channel.

## Limitations

- One channel per connection. Add another channel for each place you want the
  digest.
- Up to 10 channels per Chambr account.
- Weekly only. There are no real-time alerts or direct messages to reps.
- Private channels: the Chambr app or your webhook app must be allowed to post
  there.

## Troubleshooting

| Symptom | Cause | Fix |
|---|---|---|
| "Use a Slack incoming webhook URL" | The URL isn't a `hooks.slack.com/services/` webhook | Copy the webhook URL from the app's Incoming Webhooks page |
| The channel shows Needs attention, "The webhook was removed or turned off" | The app was removed from the channel, or the webhook was revoked | Remove the channel in Chambr and add it again |
| No digest on Monday | The account was suspended or moved off the Team plan | Check the plan, then send a test |
| A channel disappeared from the list | The team it covered was deleted in Chambr | Add the channel again for another team, or for the whole account |
| No names in the digest | The leaderboard is off for the channel, or for your account | Turn on Leaderboard for the channel; if the switch is unavailable, the account's leaderboard is off |

## Disconnect

On **Integrations**, select **Remove** next to a channel in Weekly digest
channels, or **Disconnect** on the Slack card to remove every Slack channel.
Chambr deletes the stored webhook; messages already posted stay in Slack.
Removing it in Chambr doesn't uninstall anything in Slack.

To revoke the webhook in Slack too: for Add to Slack, open **Apps** in Slack,
find **Chambr** and remove it (or remove its webhook under
**Configuration**); for a pasted webhook, remove it from your app's
**Incoming Webhooks** page.
