Subscribe for notification about state changes for all agents in the system

I'm looking for an API to inform us about agent state changes for all agents in the system.
I know about "v2.users.{id}.activity topic". However, this topic requires us to provide an ID of each user in the system. Is there a way to subscribe to this or a similar event topic without prior knowledge of all agent IDs?

HI borys.spiridonov,

You can find a list of all available notification topics on API Explorer using this endpoint:
GET /api/v2/notifications/availabletopics

All of the user topics take an id as a parameter, so it requires getting the userId for the agent first.
You could get those by searching with user email address, for example, with the POST /api/v2/users/search endpoint with a post body such as:

{
    pageSize: 25,
    pageNumber: 1,
    query: [{
        type: "TERM",
        fields: ["email", "name"],
        value: email
    }]
};

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.