---
source_url: https://www.pubnub.com/docs/chat/unity-chat-sdk/learn/chat-entities/channel
title: Channel object
updated_at: 2026-06-26T11:03:55.929Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Channel object

The `Channel` object represents a single chat room where users can send and receive messages.

## Properties

The `Channel` object has the following properties:

```csharp
public class Channel : UniqueChatEntity {
    public string Id { get; protected set; }
    public string Name { get; }
    public string Description { get; }
    public Dictionary<string, object> CustomData { get; }
    public string Updated { get; }
    public string Status { get; }
    public string Type { get; }
}
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| Id | string | Optional |  | Unique identifier for the channel. Verify the channel ID with our [validator](https://www.pubnub.com/docs/general/channels/overview#channel-name-validator). |
| Name | string | Optional |  | Display name or title of the channel. |
| Description | string | Optional |  | Brief description or summary of the channel's purpose or content. |
| CustomData | Dictionary<string, | Optional |  | Custom data associated with the channel in the form of a JSON. Values must be scalar only; arrays or objects are not supported. [App Context filtering language](https://www.pubnub.com/docs/general/metadata/filtering) doesn’t support filtering by custom properties. |
| Updated | string | Optional |  | Timestamp indicating when the channel was last updated or modified. |
| Status | string | Optional |  | Current status of the channel, such as `online`, `offline`, or `archived`. |
| Type | string | Optional |  | One of the available [channel types](https://www.pubnub.com/docs/chat/unity-chat-sdk/learn/glossary): direct (1:1), group (multiple people, restricted by invitation), public (open chat for a large audience, anyone can join it) |

:::tip API limits
To learn about the maximum length of parameters used to set channel metadata, refer to [REST API docs](https://www.pubnub.com/docs/sdks/rest-api/set-channel-metadata).
:::

### Events

The `Channel` object has the following events:

```csharp
// Event triggered when a message is received on a channel.
// Call Connect(true) to enable this callback.
public event Action<Message> OnMessageReceived;
// Event triggered when a channel is updated.
// Call StreamUpdates(true) to enable this callback.
public event Action<Channel> OnUpdated;
// Event triggered when a channel is hard-deleted from App Context.
// Call StreamUpdates(true) to enable this callback.
public event Action OnDeleted;
// Event triggered when a presence state changes on a channel.
// Call StreamPresence(true) to enable this callback.
public event Action<List<string>> OnPresenceUpdate;
// Event triggered when typing is detected on a channel.
// Call StreamTyping(true) to enable this callback.
public event Action<List<string>> OnUsersTyping;
// Event triggered when a read receipt is received on a channel.
// Call StreamReadReceipts(true) to enable this callback.
public event Action<ReadReceipt> OnReadReceiptEvent;
// Event triggered when a message report is received on a channel.
// Call StreamReportEvents(true) to enable this callback.
public event Action<MessageReport> OnMessageReported;
// Event triggered when a custom event is received on a channel.
// Call StreamCustomEvents(true) to enable this callback.
public event Action<ChatEvent> OnCustomEvent;
```

#### Example

An event that is triggered when a new message is received on a channel.

```csharp
using System.Threading.Tasks;
using PubnubApi;
using PubnubChatApi;
using UnityEngine;

// Configuration
PubnubChatConfig chatConfig = new PubnubChatConfig();
        
PNConfiguration pnConfiguration = new PNConfiguration(new UserId("myUniqueUserId"))
{
    SubscribeKey = "demo",
    PublishKey = "demo",
    Secure = true
};

// Initialize Unity Chat
var chatResult = await UnityChat.CreateInstance(chatConfig, pnConfiguration);
if (!chatResult.Error)
{
    chat = chatResult.Result;
}
// Get or create a channel
var channelResult = await chat.GetChannel("my_channel");
if (!channelResult.Error)
{
    var channel = channelResult.Result;
            
    channel.OnMessageReceived += (message) =>
    {
        Debug.Log("New message received!");
    };
}
```

## Methods

You can call the following methods on the `Channel` object.

Click on each method for more details.

### Standard methods

* [Connect()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/watch)
* [CreateMessageDraft()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/drafts#create-a-draft-message)
* [Delete()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/delete)
* [DeleteFile()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/files#delete-files)
* [Disconnect()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/watch#unwatch-a-channel)
* [EmitCustomEvent()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/custom-events#create-and-send-events)
* [ForwardMessage()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/forward)
* [GetFiles()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/files#get-all-channel-files)
* [GetInvitees()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/invite#get-invited-users)
* [GetMember()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/membership#check-membership)
* [GetMemberships()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/membership#get-membership)
* [GetMessage()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/details#get-message-details)
* [GetMessageHistory()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/history)
* [GetPinnedMessage()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/pinned#get)
* [GetReadReceipts()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/read-receipts#get-current-read-receipts)
* [GetUserRestrictions()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/users/moderation#one-user-on-one-channel)
* [GetUsersRestrictions()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/users/moderation#all-users-on-one-channel)
* [HasMember()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/membership#check-membership)
* [Invite()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/invite#invite-one-user)
* [InviteMultiple()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/invite#invite-multiple-users)
* [IsUserPresent()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/users/presence#check-users-channel-presence)
* [JoinChannel()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/join)
* [LeaveChannel()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/leave)
* [PinMessage()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/pinned#pin)
* [RegisterForPush()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/push-notifications#register-selected-push-channels)
* [SendText()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/send-receive)
* [SetRestrictions()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/users/moderation#mute-or-ban-users)
* [StartTyping()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/typing-indicator#start-typing)
* [StopTyping()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/typing-indicator#stop-typing)
* [UnpinMessage()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/pinned#unpin)
* [UnRegisterFromPush()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/push-notifications#unregister-selected-push-channels)
* [Update()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/updates#update-channel-details)
* [WhoIsPresent()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/users/presence#return-all-users-present-on-channel)

### Streaming methods

These methods register or unregister real-time event subscriptions. Each streaming method activates one or more of the events listed in the [Events](#events) section above.

* [StreamCustomEvents()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/custom-events#receive-current-events)
* [StreamPresence()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/users/presence#get-presence-updates)
* [StreamReadReceipts()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/read-receipts#get-read-receipts)
* [StreamReportEvents()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/moderation#listen-to-report-events)
* [StreamTyping()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/typing-indicator#get-typing-events)
* [StreamUpdates()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/updates#get-channel-updates)
* [StreamUpdatesOn()](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/updates#get-channel-updates)

## Use case

For example, you can use the `Channel` object methods to:

* Let users [send](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/send-receive) messages.
* [Create and manage](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/create) a 1:1, group, or public channel (chat).
* [Invite](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/invite) others to join the channel.
* Check if a user is a [member](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/membership#check-membership) of the channel.
* Configure a [typing indicator](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/typing-indicator) to track when someone in the room is writing a message.