CXone API client_credentials 401 Unauthorized

Trying to grab a token for a custom integration using the client_credentials grant. The docs say it’s straightforward, but I keep hitting a 401 Unauthorized on the /oauth/token endpoint. I’m using Postman to test the call first before moving it into the Studio script. Here’s the raw JSON payload I’m sending:

{
 "grant_type": "client_credentials",
 "client_id": "my_app_id",
 "client_secret": "my_secret_key"
}

I’ve double-checked the credentials in the CXone portal. They match exactly. The request headers include Content-Type: application/json. The error response just says “Unauthorized” with no helpful details. Is there a specific scope I need to include in the body? The documentation is vague on this part. I’ve tried adding scope: "api" but that didn’t change anything. Any ideas on what’s missing here?

Are you sending the credentials as x-www-form-urlencoded or JSON? The OAuth endpoint strictly expects form data. If you’re posting JSON, it’ll fail silently or with a 401. Switch the body type in Postman and try this:

curl -X POST https://api.nicecxone.com/oauth/token \
 -d "grant_type=client_credentials&client_id=YOUR_ID&client_secret=YOUR_SECRET"

Check your app’s scope permissions next if that doesn’t stick.