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

# Publish To Channel • AI Agent SDK

> publish_to_channel: Publish an event to all subscribers of a channel.

# publish\_to\_channel

AsyncMethod

> This is a method of the [**PushChannelProtocol**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/PushChannelProtocol.md) class in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

Publish an event to all subscribers of a channel.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def publish_to_channel(channel_name: str, event: GatewayEvent, exclude: Optional[List[str]]) -> int
```

## Parameters

**channel\_name** `str` *required*

Target channel

**event** `GatewayEvent` *required*

The event to deliver

**exclude** `Optional`

Optional client IDs to skip

### Returns

**Returns** `int`

Number of clients the event was sent to

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L1896)
>
> `praisonaiagents/gateway/protocols.py` at line 1896


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