CXone client_credentials token request returns 401

Trying to get an access token for a server-to-server integration using the client_credentials grant. The endpoint is POST /oauth/token with Basic auth in the header and grant_type in the body. Getting a 401 Unauthorized immediately.

POST /oauth/token
Authorization: Basic aHR0cHM6Ly9hcGkuY29udGFjdGNlbnRlci5uaWNlLmNvbQ==
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials

Is the client_id supposed to be in the Authorization header or the body? Docs are vague.

You probably didn’t base64 encode the client_id and client_secret correctly for that Basic Auth header. The value you posted looks like it’s just encoding the URL instead of the id:secret string.