Hitting the CXone endpoint GET /api/v2/agents/states but getting an empty [] in the response body. The agent is definitely logged in and active on the console. Auth token is valid, refreshed just seconds ago. Tried passing the agentId query param too, same result.
const response = await fetch(`${baseUrl}/api/v2/agents/states?agentId=${agentId}`, {
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});
console.log(await response.json()); // outputs []
Checked the headers, no errors. Status 200. Is there a delay in state propagation or a specific filter I’m missing? The UI shows the agent status as Ready but the API sees nothing.