Genesys Cloud Client Credentials grant returns 5m token for CI/CD pipeline

Docs state: “The client credentials grant type is designed for machine-to-machine authentication and does not require user interaction.” We are building a Terraform-based CI/CD pipeline to update Genesys Cloud routing configurations automatically. The goal is to authenticate using the client credentials flow without relying on short-lived user tokens or manual refresh logic in the build agent.

We created an API integration with the admin:flow:view and admin:flow:edit scopes. The build script runs a simple cURL request to /oauth/token with the client_id, client_secret, and grant_type=client_credentials. The response comes back clean. No errors. Just a standard JSON payload with an access_token, token_type of Bearer, and an expires_in value of 300.

Three hundred seconds. Five minutes. That is way too short for a pipeline that might take 15 minutes to plan and apply changes across multiple environments. We tried adding duration_hint or requested_duration parameters, but the API ignores them. We also checked the integration settings in the admin portal. There is no slider for “token lifetime” like there is for some other providers.

Is there a way to request a longer-lived token via the API? Or are we supposed to implement a token refresh loop in the CI script? That feels wrong for a headless build process. We want the token to last for the duration of the job. Maybe 24 hours max.

Here is the request we are sending:

curl -X POST 'https://api.mypurecloud.com/oauth/token' \
 -H 'Content-Type: application/x-www-form-urlencoded' \
 -d 'client_id=OUR_CLIENT_ID&client_secret=OUR_SECRET&grant_type=client_credentials'

The response is always 300 seconds. We’ve checked the OAuth 2.0 spec. It says the server decides the lifetime. But surely Genesys allows some configuration for automated tools? We don’t want to poll the token endpoint every 4 minutes during a deployment. It feels brittle.

Any ideas on how to get a 1-hour token for this use case? Or is the only option to use a long-lived refresh token? But refresh tokens are tied to user sessions usually. We don’t have a user context here. Just the app.

Stuck on this. The docs don’t mention a max duration setting for client creds.