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

# Member Management

> Add and remove chat channel members with the current SDK APIs.

Use member management when your app needs to add users to a channel or remove users from a channel. Channel type, membership rules, and moderator permissions can still determine whether a request is accepted by the server.

## Platform Surface

| Operation | TypeScript | iOS | Android | Flutter |
| - | - | - | - | - |
| Add members | `ChannelRepository.Membership.addMembers(channelId, userIds)` | `AmityChannelMembership(channelId:).addMembers(_:)` | `membership(channelId).addMembers(userIds)` | `addMembers(channelId, userIds)` |
| Remove members | `ChannelRepository.Membership.removeMembers(channelId, userIds)` | `AmityChannelMembership(channelId:).removeMembers(_:)` | `membership(channelId).removeMembers(userIds)` | `removeMembers(channelId, userIds)` |
| Result | `Promise<boolean>` | `Void` | `Completable` | `Future` |

## Parameters

| Parameter | Required | Description |
| - | - | - |
| `channelId` | Yes | Channel ID whose membership should change. |
| `userIds` | Yes | One or more user IDs to add or remove. Empty lists are rejected. |
| Membership permission | Yes | The current user must be allowed to manage members for the target channel. |

## Add Members

Add members when an existing channel should include additional users. For conversation channels, prefer the conversation creation APIs when creating the conversation membership for the first time.

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

const didAdd = await ChannelRepository.Membership.addMembers(channelId, [
  userId,
]);

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

```swift iOS theme={null}
let membership = AmityChannelMembership(channelId: channelId)

try await membership.addMembers([userId])

showSuccessMessage(channelId)
```

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

```dart Flutter theme={null}
await AmityChatClient.newChannelRepository()
    .addMembers(channelId, [targetUserId]);
```

## Remove Members

Remove members when users should no longer participate in the channel. If the user is currently viewing the channel, update the route or composer state after removal succeeds.

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

const didRemove = await ChannelRepository.Membership.removeMembers(channelId, [
  userId,
]);

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

```swift iOS theme={null}
let membership = AmityChannelMembership(channelId: channelId)

try await membership.removeMembers([userId])

showSuccessMessage(channelId)
```

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

```dart Flutter theme={null}
await AmityChatClient.newChannelRepository()
    .removeMembers(channelId, [targetUserId]);
```

## Implementation Notes

> [card] Bulk Input
>
> All platforms accept a list of user IDs, so use one call for a small batch instead of looping one user at a time.

> [card] Channel Rules
>
> Some channel types or roles can reject member changes. Treat failures as server authority, not as local state to override.

> [card] Current User
>
> Use join and leave APIs when the current user is entering or exiting a channel themselves.

> [card] Member State
>
> Query members after add or remove operations when your UI needs confirmed membership, role, or banned-state data.

## Related Topics

> [card] [Join and Leave](/social-plus-sdk/chat/conversation-management/members/join-leave-channel.md)
>
> Let the current user join or leave a channel.

> [card] [Query Members](/social-plus-sdk/chat/conversation-management/members/query-members.md)
>
> Retrieve and filter channel membership.

> [card] [Role Management](/social-plus-sdk/chat/conversation-management/channels/governance/role-management.md)
>
> Assign channel roles to members.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.