# Manage Slack User Group Members

Add or remove users from Slack user groups like @engineering or @design

Manages Slack user group membership by adding or removing users. User groups (like @engineering or @design) are handles that mention a set of members.

## Authentication

This tool authenticates through the Slack Tools connector. Follow the [Slack Tools Setup](https://www.tryrisotto.com/docs/integrations/tools/slack/setup) guide to configure it.

The connector's user token provides the `usergroups:read`, `usergroups:write`, and `users:read.email` scopes required by this tool.

## Configuration Options

When configuring this tool in a runbook, you can set:

- **Operation** - Action to perform: ADD or REMOVE
- **User Email** - Email of the user to add or remove
- **User Group Handle** - The user group handle (e.g., `engineering`)
- **User Token** *(Optional override)* - Per-tool user token. Takes precedence over the Slack Tools connector. See [per-tool token override](https://www.tryrisotto.com/docs/integrations/tools/slack/setup#per-tool-token-override).

## Features

### Idempotent Operations

Operations are safe to run multiple times:

- Adding a user who is already a member returns success
- Removing a user who is not a member returns success

### Email-Based Lookup

Users are identified by email address and automatically resolved to Slack user IDs.

## Troubleshooting

### User not found

**Cause**: The email address doesn't match any user in the Slack workspace

**Solution**:

- Verify the email matches the user's Slack profile email
- Check that the user has an active Slack account in the workspace

### User group not found

**Cause**: The handle doesn't match any user group in the workspace

**Solution**:

- Verify the user group handle (without the `@` prefix)
- Confirm the user group exists and is enabled in Slack

### Missing usergroups:write scope

**Cause**: The token doesn't have permission to modify user groups

**Solution**:

- Reconfigure the [Slack Tools connector](https://www.tryrisotto.com/docs/integrations/tools/slack/setup) to ensure the user token includes `usergroups:write`
- If using a per-tool token override, add the `usergroups:write` scope to that token

## Related

- [Create Slack User Group](https://www.tryrisotto.com/docs/integrations/tools/slack/create_usergroup) - create the group before you add members
- [Slack Tools Setup](https://www.tryrisotto.com/docs/integrations/tools/slack/setup)

Source: https://www.tryrisotto.com/docs/integrations/tools/slack/manage_usergroup_members
