Rooms

Open in

Use the ably rooms command group to interact with Ably Chat rooms. These commands enable you to manage rooms, send and subscribe to messages, monitor occupancy, manage presence, send reactions, and work with typing indicators.

Room management

Use the following command to list active Chat rooms. Rooms are logical containers that organize users and messages, each backed by a Pub/Sub channel:

CommandDescription
ably rooms listList active chat rooms.

Manage messages

Use the following commands to send, receive, update, and delete messages in chat rooms. Messages are persisted for 30 days by default, enabling history retrieval and message operations:

CommandDescription
ably rooms messages sendSend a message to a chat room.
ably rooms messages subscribeSubscribe to messages in one or more chat rooms.
ably rooms messages historyGet historical messages from a chat room.
ably rooms messages updateUpdate a message in a chat room.
ably rooms messages deleteDelete a message in a chat room.

Manage message reactions

Use the following commands to manage reactions on individual chat messages. Message reactions are tied to specific messages, unlike room-level reactions which respond to overall room activity:

CommandDescription
ably rooms messages reactions sendSend a reaction to a message.
ably rooms messages reactions subscribeSubscribe to message reactions.
ably rooms messages reactions removeRemove a reaction from a message.

Room presence

Use the following commands to manage presence in chat rooms. Presence enables users to indicate when they are online or offline and track who is currently in the room:

CommandDescription
ably rooms presence enterEnter presence in a chat room.
ably rooms presence getGet current presence members in a chat room.
ably rooms presence subscribeSubscribe to presence events in a chat room.

Room reactions

Use the following commands to manage room-level reactions in chat rooms. Room reactions are ephemeral and capture real-time sentiment about overall room activity, such as a livestream:

CommandDescription
ably rooms reactions sendSend a reaction in a chat room.
ably rooms reactions subscribeSubscribe to reactions in a chat room.

Room typing

Use the following commands to manage typing indicators in chat rooms. Typing indicators display which users are currently composing messages in a room:

CommandDescription
ably rooms typing keystrokeSend a typing indicator in a chat room.
ably rooms typing subscribeSubscribe to typing indicators in a chat room.

Room occupancy

Use the following commands to monitor occupancy in chat rooms. Occupancy tracks the number of users currently connected to a room and must be explicitly enabled:

CommandDescription
ably rooms occupancy getGet current occupancy metrics for a room.
ably rooms occupancy subscribeSubscribe to real-time occupancy metrics.

See also