CXone client_credentials flow returning 401 with valid client secret

Trying to automate some Studio snippet calls using the REST Proxy. I need a server-to-server token so I’m hitting https://login.voximplant.com/oauth2/token with the client_credentials grant. The request body looks standard enough, but I keep getting a 401 Unauthorized error. Here’s the curl command I’m testing with:

curl -X POST "https://login.voximplant.com/oauth2/token" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d "grant_type=client_credentials&client_id=my_id&client_secret=my_secret&scope=api"

The response is just {"error":"invalid_client","error_description":"Client authentication failed"}. I’ve double-checked the ID and secret in the developer portal. They work fine for password grant flows. Am I missing a specific scope for client credentials or is the endpoint different for CXone?

You’re hitting the wrong endpoint entirely. Genesys Cloud uses https://api.mypurecloud.com/oauth/token, not Voximplant. Also, client_credentials tokens don’t have a user context, so they’ll fail if your Studio flow tries to access agent-specific data. You’ll need a JWT or OAuth password grant for that.