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

# Get Channels

> Retrieve a single chat channel or load known channel IDs with the current SDK APIs.

Use channel retrieval when your app already has a `channelId` and needs the current channel object for message routing, member preview, unread state, or display metadata.

Single-channel retrieval is available on all current SDKs. Batch lookup by channel IDs is exposed on TypeScript, iOS, and Android; the current public Flutter repository does not expose a batch-by-IDs method.

## Platform Surface

| Operation | TypeScript | iOS | Android | Flutter |
| - | - | - | - | - |
| Get one channel | `ChannelRepository.getChannel(channelId, callback)` | `channelRepository.getChannel(channelId)` | `channelRepository.getChannel(channelId)` | `getChannel(channelId)` |
| Result style | Live object callback | `AmityObject<AmityChannel>` | `Flowable<AmityChannel>` | `Future<AmityChannel>` |
| Get channel IDs | `getChannels({ channelIds })` | `getChannels(channelIds:)` | `getChannels(channelIds)` | Not exposed in the current public repository |

## Parameters

| Operation | Parameter | Required | Description |
| - | - | - | - |
| Get one channel | `channelId` | Yes | Channel ID to retrieve or observe. |
| Get one channel | Callback / observer | Depends | Required by TypeScript and native live-object APIs to receive loading, error, and data updates. |
| Get one channel | Unsubscriber / token / disposable | No | Handle returned by live APIs; retain it while observing and release it when done. |
| Get known channel IDs | `channelIds` | Yes | List of channel IDs to resolve into channel objects where the platform exposes batch lookup. |

## Get One Channel

Retrieve or observe one channel when your app already has its `channelId`.

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

const unsubscribe = ChannelRepository.getChannel(
  channelId,
  ({ data: channel, loading, error }) => {
    if (error) handleError(error);

    if (!loading && channel) {
      renderResults(channel);
    }
  },
);

unsubscribe();
```

```swift iOS theme={null}
let liveChannel = channelRepository.getChannel("channel-id")

token = liveChannel.observe { liveObject, error in
    if let error {
        handleError(error)
        return
    }

    guard let channel = liveObject.snapshot else { return }
    showSuccessMessage(channel.channelId)
}
```

```kotlin Android theme={null}
val disposable = channelRepository
    .getChannel(channelId = channelId)
    .subscribe(
        { channel -> showSuccessMessage(channel.getChannelId()) },
        { error -> handleGeneralError(error) },
    )
```

```dart Flutter theme={null}
final channel = await AmityChatClient.newChannelRepository()
    .getChannel(channelId);

final fetchedChannelId = channel.channelId;
```

## Get Known Channel IDs

Use batch lookup when your app has a small list of known channel IDs and wants the matching channel objects. The collection is not the same as a general channel search; use [Query Channels](/social-plus-sdk/chat/conversation-management/channels/query-channels.md) when you need filters or pagination.

> [!NOTE]
>
> The current public Flutter `AmityChannelRepository` exposes `getChannel(channelId)` and query builders, but not a batch `getChannels(channelIds)` method.

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

const unsubscribe = ChannelRepository.getChannels(
  {
    channelIds: [channelId, 'channel-2'],
  },
  ({ data: channels, loading, error }) => {
    if (error) handleError(error);

    if (!loading && channels) {
      renderResults(channels);
    }
  },
);

unsubscribe();
```

```swift iOS theme={null}
let channelIds = ["channel-1", "channel-2"]
let channels = channelRepository.getChannels(channelIds: channelIds)

token = channels.observe { collection, error in
    if let error {
        handleError(error)
        return
    }

    showSuccessMessage(collection.snapshots.count)
}
```

```kotlin Android theme={null}
val channelIds = listOf(channelId, "channel-2")

val disposable = channelRepository
    .getChannels(channelIds = channelIds)
    .subscribe(
        { channels -> showSuccessMessage(channels.size) },
        { error -> handleGeneralError(error) },
    )
```

## Related Topics

> [card] [Create Channels](/social-plus-sdk/chat/conversation-management/channels/create-channel.md)
>
> Create community, live, or conversation channels.

> [card] [Query Channels](/social-plus-sdk/chat/conversation-management/channels/query-channels.md)
>
> Build paginated channel lists from filters.

> [card] [Update Channels](/social-plus-sdk/chat/conversation-management/channels/update-channel.md)
>
> Update channel attributes after retrieval.

> [card] [Message Preview](/social-plus-sdk/chat/engagement-features/message-preview.md)
>
> Render latest-message preview data from channel objects.


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