OAuth Grant Type for Server-Side Reporting Script

Building a Python script to pull queue metrics every hour. The docs show both Client Credentials and Authorization Code flows. Since this is a headless server process with no human login, does it make sense to use Authorization Code? Or should I stick to Client Credentials? I tried Client Credentials first, but the token seems to lack permissions for some analytics endpoints. Here’s the request payload:

POST /oauth/token
{
 "grant_type": "client_credentials",
 "client_id": "my_id",
 "client_secret": "my_secret"
}

Am I missing a scope or is this the wrong flow entirely?

Client credentials is the right choice for headless scripts. The issue is likely missing scopes. Check the app settings in Genesys Cloud. Add analytics:read and queue:read. Here is the corrected payload:

{
 "grant_type": "client_credentials",
 "client_id": "your_id",
 "client_secret": "your_secret"
}

The point above is correct. Just ensure your app in the Genesys Cloud admin UI has the analytics:read scope explicitly checked. Without that, the token is useless.