> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Update user group members

> Replace all members of a Slack user group.

`slack.updateUserGroupMembers` replaces the group's complete membership list.

## Example

```ts automations/update-user-group-members.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { slack } from "automate.ax/slack"

export default automation("Update user group members", () => {
  onDashboardRun({ title: "Update user group members" })

  slack.updateUserGroupMembers({
    userGroupId: "S01234567",
    userIds: ["U01234567", "U07654321"],
  })
})
```

## Inputs

Requires `userGroupId` and a non-empty `userIds` array. `includeCount` asks Slack to include the resulting member count. Slack does not allow this method to remove every member; disable the group instead.

## Output

Returns the updated user group. Guests and bot users cannot be members. Requires `usergroups:write` and sufficient workspace permissions.
