Channels

Open in

Use the ably channels command group to interact with Ably Pub/Sub channels. These commands enable you to publish and subscribe to messages, manage presence, monitor occupancy, and work with annotations.

Message publishing and subscribing

Use the following commands to publish and subscribe to messages on channels, retrieve message history, and perform message operations:

CommandDescription
ably channels subscribeSubscribe to messages on one or more channels.
ably channels publishPublish a message to a channel.
ably channels batch-publishPublish a message to multiple channels at once.
ably channels historyRetrieve message history for a channel.
ably channels appendAppend data to a message on a channel.
ably channels updateUpdate a message on a channel.
ably channels deleteDelete a message on a channel.

Message annotations

Use the following commands to manage annotations on channel messages. Annotations enable you to append metadata such as reactions, tags, moderation flags, and read receipts to existing messages:

CommandDescription
ably channels annotations publishPublish an annotation on a channel message.
ably channels annotations subscribeSubscribe to annotations on a channel.
ably channels annotations getGet annotations for a channel message.
ably channels annotations deleteDelete an annotation from a channel message.

Presence

Use the following commands to manage presence on channels. Presence enables clients to be aware of other members who are currently active on a channel:

CommandDescription
ably channels presence enterEnter presence member on a channel.
ably channels presence getGet current presence members on a channel.
ably channels presence subscribeSubscribe to presence member events on a channel.

Channel occupancy

Use the following commands to monitor occupancy on channels. Occupancy provides high-level metrics about the number of clients attached to a channel without requiring presence:

CommandDescription
ably channels occupancy getGet current occupancy for a channel.
ably channels occupancy subscribeSubscribe to occupancy updates on a channel.

Channels management

Use the following commands to list active channels and inspect channel details in the Ably dashboard:

CommandDescription
ably channels listList active channels.
ably channels inspectOpen the Ably dashboard to inspect a channel.

See also