Genesys Cloud: OAuth token retrieval failing after SAML SSO migration

We’ve just migrated our Genesys Cloud org to SAML SSO via Azure AD. The UI login works fine, but our internal Python scripts that rely on OAuth 2.0 client credentials are now failing. We need to keep using OAuth for programmatic access to the API (like /api/v2/analytics/conversations/details/query), but the token endpoint is returning a 401 Unauthorized error.

Here’s the request we’re sending:

POST /oauth/token
Host: api.mypurecloud.com
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=OUR_CLIENT_ID&client_secret=OUR_SECRET

The response is:

{
 "error": "invalid_client",
 "error_description": "Client authentication failed"
}

We’ve double-checked the client ID and secret. They’re correct. We also tried using the authorization_code grant with a user who has admin rights, but that redirects to the SAML login page and doesn’t return a code. It seems like the OAuth endpoints are blocked or require a different flow now that SAML is enforced. Is there a way to whitelist our client credentials for API access without disabling SAML? Or do we need to use a different grant type? We’ve looked at the docs, but they don’t mention this specific scenario. We need a solution that allows our scripts to continue fetching data without manual intervention. Any help would be appreciated.