Check Agent Availability
Before starting a session, you can check the availability of your chat agents and then provide your users with more accurate expectations. For instance, when no agents are available, you can hide or disable the button to contact an agent
The legacy chat product is scheduled for retirement on February 14, 2026, and is in maintenance mode until then. During this phase, you can continue to use chat, but we no longer recommend that you implement new chat channels. To avoid service interruptions to your customers, migrate to Messaging for In-App and Web before that date. Messaging offers many of the chat features that you love plus asynchronous conversations that can be picked back up at any time. Learn about chat retirement in Help.
To check whether agents are available, create an AgentAvailabilityClient object and asynchronously check the AvailabilityState status.
In Java:
In Kotlin:
To understand the algorithm used for the estimated wait time, see the estimated wait time documentation in the Chat REST API Developer Guide.
You can also use this API to get an updated Chat server before starting a session to determine whether a server has changed for your pod. Call the getLiveAgentPod method from the AvailabilityState object you get back from the AgentAvailabilityClient. If the server has changed, update this configuration value in the future to prevent an unnecessary round-trip request.