Setting Realm Override User-Initiated Action Lifespan value via curl

Hey, i’m basically having the same problem as this person from this thread: Set Realm Override User-Initiated Action Lifespan value via API

And so far I’ve been successful by making the change in the browser then copying the PUT request as a CURL command but that copies a whole array of variables that it’s hard to predict how they will act in an automated deployment. The specific variable im looking at to configure is “actionTokenGeneratedByUserLifespan.verify-email”. How can i format my curl command to include only this change? does this attribute need any other attributes accompanying it?

found a solution. Basically you can first simulate the change with devtools open in your browser, then you can copy the PUT command as a CURL command. Of course before that you have to also generate an admin token right before you use that curl command.

curl -k --location --request POST “https://url/” --header ‘Content-Type: application/x-www-form-urlencoded’ --data-urlencode ‘username=’ --data-urlencode ‘password=’ --data-urlencode ‘grant_type=password’ --data-urlencode ‘client_id=admin-cli’ -s | jq -r ‘.access_token’

then post the data

curl "http://<url>/admin/realms/digital" -X PUT \
-H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' \
-H 'Content-Type: application/json;charset=utf-8' -H "Authorization: Bearer ${admin_token}" \
-H "Origin: http://url" -H 'Connection: keep-alive' \