CXone GET /agents/states returning empty array - agent not showing as logged in

\nStatus: 200 OK\nPayload: { "items": [] }\n\nThe endpoint GET /agents/states consistently returns an empty items array when queried via a CXone Studio Data Action. The target agent is actively logged into the desktop and routing is enabled. I am mapping the response through a JSON Data Action with method: "GET" and path: "/agents/states?agentId={agent_id}". The authentication header uses a valid OAuth2 bearer token generated via GetOAuthProxy(). Token scope includes agent:read and interaction:read. \n\nComparing this to our previous Twilio GET /Accounts/{AccountSid}/Agents calls, the payload structure should explicitly contain state objects with stateCode, label, and timestamp. Instead, the response body is structurally valid but functionally empty. I have verified the agent_id parameter against the GET /agents roster endpoint. The ID matches exactly. \n\nDoes the /agents/states endpoint require a specific query parameter to bypass the default filtering logic? I suspect the Data Action execution context might be stripping the agent context before the HTTP call executes. Need to know if GetRESTProxy() requires explicit header injection for agent-bound endpoints or if this is a known scope limitation in the CXone REST gateway.

You need to pass the userId query parameter instead of agentId for this endpoint. I hit this same snag coming from Five9 because the parameter names differ between platforms.

GET /api/v2/agents/states?userId={agent_uuid}