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

# Mute Management

> Mute and unmute chat channel members with the current SDK APIs.

Use member mute when a user should keep channel access but lose the ability to send messages for a period of time. Mute duration units differ by platform, so pass the value in the unit expected by the SDK you are using.

## Platform Surface

| Operation      | TypeScript                                                                  | iOS                                                             | Android                                               | Flutter                                               |
| -------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| Mute members   | `ChannelRepository.Moderation.muteMembers(channelId, userIds, mutePeriod?)` | `AmityChannelModeration(channelId:).muteMembers(_:mutePeriod:)` | `moderation(channelId).muteMembers(timeout, userIds)` | `moderation(channelId).muteMembers(userIds, millis:)` |
| Unmute members | `ChannelRepository.Moderation.unmuteMembers(channelId, userIds)`            | `AmityChannelModeration(channelId:).unmuteMembers(_:)`          | `moderation(channelId).unmuteMembers(userIds)`        | `moderation(channelId).unmuteMembers(userIds)`        |
| Duration unit  | Seconds; omit for indefinite mute                                           | Seconds                                                         | `org.joda.time.Duration`                              | Milliseconds; defaults to 600000                      |
| Result         | `Promise<boolean>`                                                          | `Void`                                                          | `Completable`                                         | `Future`                                              |

## Parameters

| Parameter                           | Required  | Description                                                                                                        |
| ----------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------ |
| `channelId`                         | Yes       | Channel ID where the mute or unmute should be applied.                                                             |
| `userIds`                           | Yes       | One or more user IDs to mute or unmute. Empty lists are rejected.                                                  |
| `mutePeriod` / `timeout` / `millis` | Mute only | Duration of the mute. TypeScript and iOS take seconds, Android takes a `Duration`, and Flutter takes milliseconds. |
| Moderation permission               | Yes       | The current user must have permission to moderate the target channel.                                              |

## Mute Members

Mute members when you want a temporary or indefinite send-message restriction without removing channel access. TypeScript's omitted `mutePeriod` means an indefinite mute until unmuted.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { ChannelRepository } from '@amityco/ts-sdk';

  const tenMinutesInSeconds = 10 * 60;

  const didMute = await ChannelRepository.Moderation.muteMembers(
    channelId,
    [userId],
    tenMinutesInSeconds,
  );

  if (didMute) {
    showSuccessMessage(channelId);
  }
  ```

  ```swift iOS theme={null}
  let moderation = AmityChannelModeration(channelId: channelId)
  let tenMinutesInSeconds = 10 * 60

  try await moderation.muteMembers([userId], mutePeriod: tenMinutesInSeconds)

  showSuccessMessage(channelId)
  ```

  ```kotlin Android theme={null}
  val tenMinutes = org.joda.time.Duration.standardMinutes(10)

  val disposable = channelRepository
      .moderation(channelId = channelId)
      .muteMembers(timeout = tenMinutes, userIds = listOf(targetUserId))
      .subscribe(
          { showSuccessMessage(channelId) },
          { error -> handleGeneralError(error) },
      )
  ```

  ```dart Flutter theme={null}
  const tenMinutesInMillis = 10 * 60 * 1000;

  await AmityChatClient.newChannelRepository()
      .moderation(channelId)
      .muteMembers([targetUserId], millis: tenMinutesInMillis);
  ```
</CodeGroup>

## Unmute Members

Unmute restores the users' ability to send messages in the channel.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { ChannelRepository } from '@amityco/ts-sdk';

  const didUnmute = await ChannelRepository.Moderation.unmuteMembers(channelId, [
    userId,
  ]);

  if (didUnmute) {
    showSuccessMessage(channelId);
  }
  ```

  ```swift iOS theme={null}
  let moderation = AmityChannelModeration(channelId: channelId)

  try await moderation.unmuteMembers([userId])

  showSuccessMessage(channelId)
  ```

  ```kotlin Android theme={null}
  val disposable = channelRepository
      .moderation(channelId = channelId)
      .unmuteMembers(userIds = listOf(targetUserId))
      .subscribe(
          { showSuccessMessage(channelId) },
          { error -> handleGeneralError(error) },
      )
  ```

  ```dart Flutter theme={null}
  await AmityChatClient.newChannelRepository()
      .moderation(channelId)
      .unmuteMembers([targetUserId]);
  ```
</CodeGroup>

## Duration Notes

<CardGroup cols={2}>
  <Card title="TypeScript" icon="code">
    Pass seconds. Omit `mutePeriod` to mute indefinitely until a later `unmuteMembers` call.
  </Card>

  <Card title="iOS" icon="mobile">
    Pass seconds through `mutePeriod`. The SDK converts the value before sending the request.
  </Card>

  <Card title="Android" icon="mobile-screen">
    Pass an `org.joda.time.Duration`, such as `Duration.standardMinutes(10)`.
  </Card>

  <Card title="Flutter" icon="feather">
    Pass milliseconds through `millis`. If omitted, the current public SDK default is 600000 milliseconds.
  </Card>
</CardGroup>

## Related Topics

<CardGroup cols={3}>
  <Card title="Ban Management" href="./ban-management" icon="user-slash">
    Remove channel access until a user is unbanned.
  </Card>

  <Card title="Query Members" href="/social-plus-sdk/chat/conversation-management/members/query-members" icon="users">
    Filter members by muted or banned membership states.
  </Card>

  <Card title="Message Creation" href="/social-plus-sdk/chat/messaging-features/message-creation/send-a-message" icon="paper-plane">
    Send messages after membership and moderation checks pass.
  </Card>
</CardGroup>
