CXone /agents/states returning empty array for logged-in agent

Hey folks,

I’m hitting a weird wall with the CXone API. I’ve got an agent who is definitely logged into the platform, status set to Available, but when I hit the GET /api/v2/users/me/agents/states endpoint, the response comes back with an empty array [] for the states field.

Here’s the payload I’m seeing:

{
 "id": "12345",
 "name": "Test Agent",
 "email": "agent@company.com",
 "states": []
}

I’ve checked the OAuth token and it’s valid. I’ve tried hitting the generic GET /api/v2/agents/states/{agentId} endpoint too, same result. The agent isn’t in a wrap-up, not on a call, nothing blocking it.

Has anyone seen this before? Is there a specific permission or role requirement that causes the states array to hide even if the user is authenticated? I’m using Python requests with a standard client credentials token.

response = requests.get(
 f"{base_url}/api/v2/users/me/agents/states",
 headers={"Authorization": f"Bearer {token}"}
)
print(response.json())

The status code is 200, so it’s not an auth error. Just empty data.

You’re probably hitting a scope issue. That endpoint needs agent:view or user:agent:view. Check your OAuth token. If the scopes are correct, try hitting GET /api/v2/users/{userId}/agents/states instead. Sometimes the me alias doesn’t resolve correctly for agent-specific resources.