GetRESTProxy throwing INVALID_FUNCTION in CXone Studio Snippet despite correct JSON syntax

Getting an INVALID_FUNCTION error when trying to call GetRESTProxy in a CXone Studio Snippet. I’ve been debugging this for two hours and the syntax looks identical to the docs, but the script fails immediately upon execution.

Here is the snippet code:

ASSIGN restProxy = GetRESTProxy()
ASSIGN request = restProxy.createRequest("GET", "/api/v2/conversations/voice/details", {}, {})
ASSIGN response = restProxy.executeRequest(request)

The error log in the Studio trace shows:
Error: Function 'GetRESTProxy' is not valid or not found in current context.

I’m used to writing Kotlin where types are explicit, so this dynamic scripting feels weird. I’ve verified the endpoint path is correct by testing it in Postman with a valid Bearer token. The JSON structure for the headers and body is also standard. I’ve tried adding the Content-Type header explicitly in the options map, but it doesn’t change the outcome. The function just doesn’t seem to exist for the engine.

Is there a specific permission required for the bot user to access REST proxies? Or is this a syntax quirk in the latest Studio update? I’ve restarted the flow and checked the debug console, but nothing jumps out. The createRequest method signature seems right based on the help text, but if the proxy object isn’t initializing, the rest of the chain fails.

Any ideas why the function would be marked invalid? I’ve checked the API docs for CXone Studio scripting and GetRESTProxy is listed under available functions. Maybe I’m missing a namespace prefix? I’ve tried System.GetRESTProxy() but that throws a different error about undefined classes.

Just need to hit an internal endpoint to pull CRM data before routing. It’s blocking the whole flow.