Trying to set up our Jenkins CI/CD pipeline to manage Genesys Cloud resources without manual intervention. We’re using the standard OAuth client credentials flow to fetch a token, but the default expiry is 3600 seconds. That’s way too short for some of our longer Terraform runs. I’ve checked the docs and the expires_in claim in the response, but I can’t find a parameter to extend this window in the POST request to /api/v2/oauth/token. Here is the cURL command we’re using in the build step:
curl -X POST https://api.mypurecloud.com/api/v2/oauth/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&client_id=OUR_CLIENT_ID&client_secret=OUR_SECRET'
The response comes back with "expires_in": 3600. Is there a hidden parameter or a different grant type I should be using for automated tools? We’ve tried adding expires_in=86400 to the body, but it gets ignored. The token just refreshes or fails. We need a way to keep the session alive for at least 4 hours without constantly refreshing in the script. Any ideas?