Hit a weird snag with GET /api/v2/agents/states. I’m trying to verify the login status of a specific agent in our CXone instance, but the response body always contains an empty array []. The agent is definitely logged in-I can see them in the desktop client and they’re taking calls.
Here’s the cURL request I’m using:
curl -X GET "https://api.cxone.com/api/v2/agents/states?ids=<agent_id>&divisionId=<division_id>" \
-H "Authorization: Bearer <access_token>"
The token is valid, generated via OAuth2 client credentials flow. I’ve double-checked the divisionId against the agent’s profile, and it matches. No HTTP errors, just a 200 OK with nothing inside. I’ve tried passing the state parameter as all and login, but same result.
Is there a delay in the state propagation? I’ve waited 5 minutes after the agent logged in. Or am I missing a required header? The docs don’t mention anything about role permissions blocking this specific endpoint, but I’m starting to wonder if the service account lacks access to agent state data.
Any ideas why the array is empty when the agent is clearly active?