We’re setting up a Jenkins pipeline to deploy our custom agent desktop widgets via the Genesys Cloud API. The goal is to generate a long-lived API token using the OAuth client credentials flow so the pipeline can run unattended.
I’m using the standard POST request to /v2/oauth/token with grant_type=client_credentials. I’ve registered the app in the Genesys Cloud admin console and copied the client ID and secret directly from the settings page. The request looks like this:
POST /v2/oauth/token
Content-Type: application/x-www-form-urlencoded
client_id=abc123&client_secret=xyz789&grant_type=client_credentials
The response comes back with a 401 Unauthorized error. The body just says {"code":"bad_request","message":"Invalid client credentials"}. I’ve double-checked the secrets multiple times. I even tried generating a new secret in the UI and updating the Jenkins credential store, but it’s still failing.
Is there a specific scope required for the client credentials flow that I’m missing? The app has all scopes enabled. Or is there a timeout issue with the token generation in this context? I’ve been staring at this for an hour and it’s driving me nuts.