Skip to main content
Occupancy provides high level metrics about the clients attached to a channel. This includes the number of connections currently attached to a channel, and the number of connections attached that are permitted to publish and subscribe to the channel.

Occupancy metrics

The following are the metric categories that occupancy reports:
MetricDescription
connectionsThe number of connections
publishersThe number of connections that are authorized to publish
subscribersThe number of connections that are authorized to subscribe to messages
presenceSubscribersThe number of connections that are authorized to subscribe to presence messages
presenceConnectionsThe number of connections that are authorized to enter members into the presence channel
presenceMembersThe number of members currently entered into the presence channel

Realtime occupancy updates

Subscribe to occupancy events in realtime using the occupancy channel option:

Query occupancy via REST

You can query occupancy for a single channel using the REST API:

Enumerate channels with occupancy

List all active channels and their occupancy:

Occupancy payload structure

When subscribing to [meta]occupancy events, the message structure is:

Use cases

Display active users

Monitor capacity

Track engagement

Occupancy vs Presence

FeatureOccupancyPresence
PurposeHigh-level channel metricsIndividual member tracking
Identifies usersNoYes (by clientId)
Member dataNoYes (custom status)
OverheadMinimalHigher (per-member events)
Best forShowing “X users online”Avatar stacks, member lists
Use occupancy when you only need counts. Use presence when you need to know who is online.

Next steps

Build docs developers (and LLMs) love